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

Re: [PATCH v6 0/4] "git reset --merge" related improvements

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 1, 2010, 20:42 UTC
Message-ID
<7vljghlfq5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.0912311623210.3630@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 21 quoted lines
> On Wed, 30 Dec 2009, Christian Couder wrote:
>>
>> Another reroll with the following changes:
>> - patches to add --keep option have been removed for now
>> - documentation patch has been moved before the core code changes
>> - commit messages have been improved
>> - tests have been much improved thanks to Junio's suggestions
>> 
>> Christian Couder (3):
>>   reset: improve mixed reset error message when in a bare repo
>>   Documentation: reset: add some tables to describe the different
>>     options
>>   reset: add a few tests for "git reset --merge"
>> 
>> Stephan Beyer (1):
>>   reset: use "unpack_trees()" directly instead of "git read-tree"
>
> FWIW, Ack on this version of the whole series - I don't think there is 
> anything controversial here, and I think avoiding the execve of read-tree 
> for something we have a library function for is a good thing (and the 
> change in behavior looks like a bug-fix to me).

The "bug-fix" needs my follow-up patch [*1*] to be a real "bug-fix", I think.

By the way, I've always felt it somewhat confusing that "reset --merge" implementation uses one-tree form of "read-tree -m -u", especially given that your 9e8ecea (Add 'merge' mode to 'git reset', 2008-12-01) that describes the "bug" contrasts its behaviour with the behaviour of going to a different branch with "checkout", that is inherently an operation that depends on the two-tree "read-tree -m -u" semantics.

In the context of "reset", however, we don't want the check "checkout" does between the tree that the index came from (the first tree argument, typically HEAD) and the index before going to the target tree (the second tree argument), so it is the right thing to do to use the one-tree form semantics "go from the state in the index to the target tree".

[Refererence]
*1* http://article.gmane.org/gmane.comp.version-control.git/136004
Previous: Linus Torvalds
Message 14 of 14 in “"git reset --merge" related improvements”
  1. 0/4 "git reset --merge" related improvementsChristian Couder, Dec 30, 2009
  2. 1/4 reset: improve mixed reset error message when in a bare repoChristian Couder, Dec 30, 2009
  3. 2/4 Documentation: reset: add some tables to describe the different optionsChristian Couder, Dec 30, 2009
  4. Junio C HamanoJan 1, 2010
  5. Christian CouderJan 2, 2010
  6. 3/4 reset: add a few tests for "git reset --merge"Christian Couder, Dec 30, 2009
  7. Junio C HamanoJan 1, 2010
  8. Christian CouderJan 2, 2010
  9. 4/4 reset: use "unpack_trees()" directly instead of "git read-tree"Christian Couder, Dec 30, 2009
  10. Junio C HamanoJan 1, 2010
  11. Junio C HamanoJan 1, 2010
  12. Christian CouderJan 2, 2010
  13. Linus TorvaldsJan 1, 2010
  14. Junio C HamanoJan 1, 2010

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.