git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Marko MacekNext: Johannes Schindelin
Message 28 of 35 in “Question about "git commit -a"”
  1. Paolo CiarrocchiOct 4, 2007
  2. Matthieu MoyOct 4, 2007
  3. Paolo CiarrocchiOct 4, 2007
  4. Wincent ColaiutaOct 4, 2007
  5. Nguyen Thai Ngoc DuyOct 4, 2007
  6. Johannes SchindelinOct 4, 2007
  7. Nguyen Thai Ngoc DuyOct 4, 2007
  8. Shawn O. PearceOct 4, 2007
  9. Paolo CiarrocchiOct 5, 2007
  10. Andreas EricssonOct 5, 2007
  11. Paolo CiarrocchiOct 5, 2007
  12. Andreas EricssonOct 5, 2007
  13. Matthieu MoyOct 5, 2007
  14. Andreas EricssonOct 5, 2007
  15. Matthieu MoyOct 5, 2007
  16. Andreas EricssonOct 5, 2007
  17. Paolo CiarrocchiOct 5, 2007
  18. Andreas EricssonOct 5, 2007
  19. Matthieu MoyOct 5, 2007
  20. Kristian HøgsbergOct 5, 2007
  21. Matthieu MoyOct 5, 2007
  22. Marko MacekOct 5, 2007
  23. Andy ParkinsOct 6, 2007
  24. Linus TorvaldsOct 6, 2007
  25. Wincent ColaiutaOct 7, 2007
  26. Dmitry PotapovOct 5, 2007
  27. Marko MacekOct 7, 2007
  28. Dmitry PotapovOct 7, 2007
  29. Johannes SchindelinOct 7, 2007
  30. Wincent ColaiutaOct 5, 2007
  31. Andy ParkinsOct 4, 2007
  32. Miles BaderOct 5, 2007
  33. David SoriaOct 4, 2007
  34. Alex RiesenOct 4, 2007
  35. Johannes SchindelinOct 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.