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

Re: [PATCH] builtin-revert: Make use of merge_recursive()

From
Stephan Beyer <s-beyer@gmx.net>
Date
Aug 11, 2008, 23:47 UTC
Message-ID
<20080811234733.GB28340@leksak.fem-net>
In-Reply-To
<7v7ianuo8q.fsf@gitster.siamese.dyndns.org>
Hi,
Junio C Hamano wrote:
> I am not absolutely sure if the phoney commit-looking object that has
> nonsense SHA-1 created by make_virtual_commit() would have any unintended
> side effects to the rest of the system, but it does not look like it is
> even inserted into the global object hash table, so this should be Ok.

Hmm, the git-merge-recursive process that was run before, calls get_ref() and that also used make_virtual_commit() and thus this virtual_id. So if there is some danger regarding this, then it has also been there before my patch :-)

> That was the last piece of worry coming from me regarding this "call
> recursive internally" theme.

Well, for simple cherry-pick/revert your other worries can be ignored, because it only runs merge_recursive() _once_ and the die()s do not hurt. Wrong?

Show 7 quoted lines
> Would we need to consolidate this and Miklos's "call recursive internally
> from git-merge wrapper" by making them into three patches?
> I.e.
> 
>  (1) move bulk of code from builtin-merge-recursive.c to a new file
>      merge-recursive.c and introduce merge_recursive_helper() in there so
>      that both of you and cmd_merge_recursive() itself can call it;

I'd like to see a "libified" merge-recursive.c, but I wouldn't call the interesting function merge_recursive_helper(), I'd just take merge_recursive(). Of course those index locking could be done in it.

Looking at my sequencer code, I'd also be satisfied, if it takes SHAs as argument and no "struct commit *". But then this should be more generic, i.e. OBJ_TAG has to be handled correctly (builtin-revert does that at the beginning at parse-args()).

Hmm, then step (1) is ok. :-)
>  (2) make revert.c use merge_recursive_helper();
> 
>  (3) make builtin-merge.c use merge_recursive_helper().
This is ok then.
Thanks and regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 38 in “Avoid run_command() for recursive in builtin-merge”
  1. 0/2 Avoid run_command() for recursive in builtin-mergeMiklos Vajna, Aug 10, 2008
  2. 1/2 merge-recursive: prepare merge_recursive() to be called from builtinsMiklos Vajna, Aug 10, 2008
  3. 2/2 builtin-merge: avoid run_command_v_opt() for recursiveMiklos Vajna, Aug 10, 2008
  4. Junio C HamanoAug 11, 2008
  5. Miklos VajnaAug 11, 2008
  6. Junio C HamanoAug 11, 2008
  7. Miklos VajnaAug 11, 2008
  8. Add a new test to ensure merging a submodule is handled properly.Miklos Vajna, Aug 11, 2008
  9. Stephan BeyerAug 11, 2008
  10. Miklos VajnaAug 11, 2008
  11. Junio C HamanoAug 11, 2008
  12. Stephan BeyerAug 11, 2008
  13. builtin-revert.c: Make use of merge_recursive()Stephan Beyer, Aug 11, 2008
  14. Johannes SchindelinAug 11, 2008
  15. Stephan BeyerAug 11, 2008
  16. Miklos VajnaAug 11, 2008
  17. builtin-revert: Make use of merge_recursive()Stephan Beyer, Aug 11, 2008
  18. Stephan BeyerAug 11, 2008
  19. Junio C HamanoAug 11, 2008
  20. Junio C HamanoAug 11, 2008
  21. Stephan BeyerAug 11, 2008
  22. Junio C HamanoAug 11, 2008
  23. Split out merge_recursive() to merge-recursive.cMiklos Vajna, Aug 12, 2008
  24. Stephan BeyerAug 12, 2008
  25. Miklos VajnaAug 12, 2008
  26. merge-recursive.c: Add more generic merge_recursive_generic()Stephan Beyer, Aug 12, 2008
  27. Make builtin-revert.c use merge_recursive_generic()Stephan Beyer, Aug 12, 2008
  28. Miklos VajnaAug 12, 2008
  29. Stephan BeyerAug 13, 2008
  30. Miklos VajnaAug 13, 2008
  31. Daniel BarkalowAug 13, 2008
  32. Stephan BeyerAug 13, 2008
  33. Daniel BarkalowAug 13, 2008
  34. Junio C HamanoAug 13, 2008
  35. Stephan BeyerAug 13, 2008
  36. Daniel BarkalowAug 13, 2008
  37. Junio C HamanoAug 13, 2008
  38. Junio C HamanoAug 14, 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.