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

Re: [PATCH 0/3] merge -Xindex-only

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jul 9, 2013, 19:38 UTC
Message-ID
<51DC66A5.80500@alum.mit.edu>
In-Reply-To
<878v1gey16.fsf@linux-k42r.v.cablecom.net>
On 07/09/2013 02:08 PM, Thomas Rast wrote:
Show 12 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> 
>> Since you've already implemented a way to merge into the index (even an
>> alternative index) without touching the working copy, I'll just cross my
>> fingers and hope for the appearance of an option that makes merge leave
>> HEAD, MERGE_HEAD, etc. untouched.
> 
> The most annoying part is probably where to put the output, since
> merging is more or less defined to do one of:
> 
> - update HEAD and return 0
> - update MERGE_HEAD and return 1

I don't understand what you mean here. Why does *any* reference need to be updated? Why not

* load arbitrary commit-ish A into index
* merge arbitrary commit-ish B into index
* return error/OK depending on whether there was a conflict

? The script that started the whole process would know what A and B are and could create the commit itself using "git write-tree" and "git commit-tree -p A -p B". And if the index were an alternative index chosen via GIT_INDEX_FILE then the rest of the git repo would be none the wiser.

Show 10 quoted lines
> I'm not sure how much flexibility is worth having.  Would it be
> sufficient if you had an option, e.g. -Xresult-ref=refs/heads/foo, that
> changes it to:
> 
> - update refs/heads/foo and return 0
> - return 1, not updating any refs
> 
> That would mean that it would only work for noninteractive use.  In the
> conflicting case, the driving script would need to remember what it
> wanted to merge so as have the information when finally committing.
That would be fine with me.
Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Thomas RastNext: Thomas Rast
Message 10 of 15 in “merge -Xindex-only”
  1. 0/3 merge -Xindex-onlyThomas Rast, Jul 7, 2013
  2. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Jul 7, 2013
  3. 2/3 merge-recursive: untangle double meaning of o->call_depthThomas Rast, Jul 7, 2013
  4. Junio C HamanoJul 7, 2013
  5. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Jul 7, 2013
  6. Michael HaggertyJul 8, 2013
  7. Thomas RastJul 8, 2013
  8. Michael HaggertyJul 9, 2013
  9. Thomas RastJul 9, 2013
  10. Michael HaggertyJul 9, 2013
  11. Thomas RastJul 9, 2013
  12. Thomas RastOct 26, 2013
  13. 1/3 merge-recursive: remove dead conditional in update_stages()Thomas Rast, Oct 26, 2013
  14. 2/3 merge-recursive: internal flag to avoid touching the worktreeThomas Rast, Oct 26, 2013
  15. 3/3 merge-recursive: -Xindex-only to leave worktree unchangedThomas Rast, Oct 26, 2013

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.