Re: Question about "git commit -a"
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Oct 7, 2007, 14:50 UTC
- Message-ID
- <37fcd2780710070750g23deb2e1q1b9a7e5c555a44bf@mail.gmail.com>
- In-Reply-To
- <470878CB.2010609@gmx.net>
On 10/7/07, Marko Macek <Marko.Macek@gmx.net> wrote:
Show 6 quoted lines
> Dmitry Potapov wrote: > > You don't. Even with 'commit -a' there is no guarantee that the > > result will compile, because you can forget to add a new file. > > Actually, it would be a good idea for commit to report an error if there > are any new files that have not been 'added' or 'ignored'
If it is good for you, you can add this check to your pre-commit hook. However, I don't like your idea at all. Sometimes, you do want to have some file that is not 'added' or 'ignored' as a reminder that you have something else to do. IMHO, git acts in the most reasonable way in this respect. When you say 'commit -a' and you have some files not added, it will show you all untracked files in your editor when you type a commit message. So, it is more difficult to forget to add a new file with git than with many other version control systems.
> (or even > if there are missing files that have not been 'deleted'.
Actually, 'commit -a' will automatically delete all missing files. IMHO, it is the right thing to do.
Dmitry