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

Re: commiting while the current version is in conflict

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 17, 2008, 08:37 UTC
Message-ID
<7vwsg7mxb6.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<2d460de70810170021q5daa902er1e6e2fb6633400ec@mail.gmail.com>
"Richard Hartmann" <richih.mailinglist@gmail.com> writes:
Show 6 quoted lines
>>  (2) pre-commit hook is a last ditch effort to help ignorant
>>     users who have already done "git add" without thinking and
>>     lost the "unmerged" state.  It has to look at and guess at
>>     the contents for that.
>
> Ignoring the ad hominem attack, I would argue that the two

Eh, Sorry about that --- I did not mean "ignorant" in that sense. Perhaps replacing the word with "unfortunate" would sound nicer?

Show 5 quoted lines
> To err is human, which is why rm -i exists. Else, you could
> just use alias rm='rm -rf'.
>
> Also, within certain boundaries, a tool should adapt to the
> user, not vice versa.

Don't you realize that is what the hook is doing already? After making such an error, the definitive information is lost, because the user told the tool that the resolution is done and the file is ready to be committed) by mistake. Even then the hook is trying its best to help the user.

Replace your "rm=rm -rf" sentence with "why undelete exists" and read it again. No, filesystem undelete does not always work (disk block could have been recycled for other files), but it could help you when you did remove a file you wanted to keep by mistake when it can.

As to pre-add hook, I am not enthused, but if somebody sends in a clean patch, I wouldn't be opposed to it at least in principle.

Previous: Richard HartmannNext: Richard Hartmann
Message 3 of 7 in “Re: commiting while the current version is in conflict”
  1. Junio HamanoOct 16, 2008
  2. Richard HartmannOct 17, 2008
  3. Junio C HamanoOct 17, 2008
  4. Richard HartmannOct 17, 2008
  5. Jakub NarebskiOct 17, 2008
  6. Richard HartmannOct 17, 2008
  7. Junio C HamanoOct 17, 2008

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.