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

Re: Please undo "Use git-merge instead of git-resolve in git-pull"

From
Junio C Hamano <junkio@cox.net>
Date
Sep 21, 2005, 21:48 UTC
Message-ID
<7vu0genlc1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0509211310150.2553@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> Local changes are a problem ONLY IF THOSE LOCAL CHANGES INTERFERE WITH THE 
> MERGE.
True, sorry, and reverted.
* Regardless of whatever else, we could detect when there is
  only one strategy applicable and bypass that check -- "reset
  --hard" should never happen in that case and 'git pull -s
  stupid' would regain the traditional behaviour and we should
  probably make this the default for 'git pull'.
* Otherwise, if the user wants it to try multiple strategies, we
  need to detect the local changes in the tree that _could_
  interfere with the merge more precisely.
  In order for that, we need to have a way to figure out the set
  of paths that _could_ potentially be involved in the merge.
  Once we have that set, we can just check if we have local
  changes on those paths, and the "restoring to the pre-merge
  state" currently done with "reset --hard" kludge could just
  restore those paths from the pre-merge HEAD.
  This is however harder than it sounds once we start allowing
  renaming merges.  If the ancestor had A/foo, you kept it and
  have an addition of A/bar as a local change, and the head that
  is being merged renames stuff in A/ to B/A/, it is more likely
  than not that you would want to have A/bar moved to B/A/bar in
  your merge result.  Once we go this route, the only thing it
  makes sense would be to make it responsibility for each merge
  strategy to preserve before starting its work and to restore
  after it has failed.
* I thought you do not multitask and wonder why you are merging
  while you still have local changes, but that does not justify
  this regression.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 10 in “Please undo "Use git-merge instead of git-resolve in git-pull"”
  1. Linus TorvaldsSep 21, 2005
  2. Linus TorvaldsSep 21, 2005
  3. Junio C HamanoSep 21, 2005
  4. Linus TorvaldsSep 21, 2005
  5. David S. MillerSep 22, 2005
  6. Linus TorvaldsSep 22, 2005
  7. Olivier GalibertSep 22, 2005
  8. Martin LanghoffSep 22, 2005
  9. Linus TorvaldsSep 22, 2005
  10. Petr BaudisSep 23, 2005

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.