git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Template commit messages.
@ 2007-08-05 12:32 Thomas Adam
  2007-08-08 16:24 ` Jan Hudec
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Adam @ 2007-08-05 12:32 UTC (permalink / raw
  To: git

Hello all,

Am I correct in thinking that the new template messages that will be
in the up and coming git release will alleviate an "annoyance" I've
currently got with commit messages?

Basically, I want a way of removing what is now, a long list of
untracked files from the commit message before it hits the editor --
I've looked at $GIT_DIR/.git/hooks/{pre,post}-commit as well as:
$GIT_DIR/.git/hooks/commit-msg in the hopes I could add  a sed command
there to remove the list of files, and whilst the sed command worked
fine on the command line, adding it to any of those files didn't.

Was this even the right approach?  I didn't want to go messing with
git-commit, frankly, so I am hoping that these new templates might
just do the trick.

You might ask why I've got such a large list of untracked files -- the
reason is because I use the same repository to build files in, which
themselves have no need to be added.  And whilst I can catch some of
these instances by using .gitignore, it's not enough since not all of
the files have a common extension or anything.  And whilst I realise
the list of untracked file is just a friendly warning to me, I find it
annoying and would rather it didn't appear at all if possible, since I
know myself which files need explicitly adding.  :)

Hope that makes sense, at least.  :)

Kindly,

Thomas Adam

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Template commit messages.
  2007-08-05 12:32 Template commit messages Thomas Adam
@ 2007-08-08 16:24 ` Jan Hudec
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Hudec @ 2007-08-08 16:24 UTC (permalink / raw
  To: Thomas Adam; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2822 bytes --]

On Sun, Aug 05, 2007 at 13:32:48 +0100, Thomas Adam wrote:
> Am I correct in thinking that the new template messages that will be
> in the up and coming git release will alleviate an "annoyance" I've
> currently got with commit messages?

Reading the description below, I really doubt that. The templates are to
*add* stuff, not to remove it.

> Basically, I want a way of removing what is now, a long list of
> untracked files from the commit message before it hits the editor --
> I've looked at $GIT_DIR/.git/hooks/{pre,post}-commit as well as:
> $GIT_DIR/.git/hooks/commit-msg in the hopes I could add  a sed command
> there to remove the list of files, and whilst the sed command worked
> fine on the command line, adding it to any of those files didn't.

Neither of this commands actually see the list. Because the list is *not*
part of the commit message. It is a comment, which is added just before the
editor is started and stripped right afterwards.

> Was this even the right approach?  I didn't want to go messing with
> git-commit, frankly, so I am hoping that these new templates might
> just do the trick.
> 
> You might ask why I've got such a large list of untracked files -- the
> reason is because I use the same repository to build files in, which
> themselves have no need to be added.  And whilst I can catch some of
> these instances by using .gitignore, it's not enough since not all of
> the files have a common extension or anything.  And whilst I realise
> the list of untracked file is just a friendly warning to me, I find it
> annoying and would rather it didn't appear at all if possible, since I
> know myself which files need explicitly adding.  :)

a) The files don't need a common anything to be ignored with .gitignore. It
   is a list of patterns, so you can list the names. Of course not suitable
   if the names change or there is really a huge amount of them.
b) There is actually no problem in tracking files that match ignore pattern,
   as it is only applied to files that don't appear in index. That gives you
   the option to simply ignore '*' (and live with the minor annoyance that
   you have to add -f to add command line -- git commit -a and git add -u
   will include changes in tracked files all right).
c) Consider changing the build process to put the built files in
   a subdirectory, if you have a chance. In my experience it not only helps
   keeping track whether everything is versioned that should be, but also
   helps navigating the tree (no uninteresting files interfering with shell
   completion/cluttering file selection dialogs) and offer easy way to do
   a clean build when you suspect the build might have screwed up somewhere
   (just delete the directory).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-08 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-05 12:32 Template commit messages Thomas Adam
2007-08-08 16:24 ` Jan Hudec

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).