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

Destructive pre-commit behaviour and "--all"

From
JRJan Rüegg <rggjan@gmail.com>
Date
Mar 22, 2023, 10:34 UTC
Message-ID
<CAMbUV8F8y62n5ud3AoWQak8J==Zrn7kzwTE7jCveVJEpfcqncg@mail.gmail.com>

Why doesn't "git commit --all" keep the files added to the staging area, so "git commit --all" would have the same behaviour as "git add --all && git commit"?

As described here a pre-commit hook which changes files, when run with "git commit --all", will make it impossible to see what the hook changed.

Making "git commit --all" and "git add --all && git commit" have the same behaviour (or at least having that configurable) would allow looking (and reverting if necessary) the changes generated by the hooks.

- Jan
Next: Chris Torek
Message 1 of 5 in “Destructive pre-commit behaviour and "--all"”
  1. Jan RüeggMar 22, 2023
  2. Chris TorekMar 22, 2023
  3. Chris TorekMar 22, 2023
  4. Junio C HamanoMar 22, 2023
  5. Jan RüeggMar 28, 2023

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.