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

Re: GIT 0.99.7d, and end of week status.

From
Junio C Hamano <junkio@cox.net>
Date
Sep 26, 2005, 22:03 UTC
Message-ID
<7vr7bba3lo.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1127765852.5735.36.camel@cashmere.sps.mot.com>
Jon Loeliger <jdl@freescale.com> writes:

There is a small problem in that proposal. "Merging" in git does not work that way. Specifically,

>     # When merging, merge origin, maint and pu into master
>     Merge: master origin maint pu
>     # Merge into master the just the origin bits
>     Merge: master origin

the problem with these is that you may be in your "test" branch and say "git pull". 'git pull' does not let you say 'pull into this branch which is not my current branch', and "into master" part would not work -- merge in git always merges things into the current branch, so writing

>     # When merging, merge origin, maint and pu into the current
>     Merge: origin maint pu
>     # Merge just the origin bits into the current
>     Merge: origin
may make sense.

Having said that I doubt Octopus is what people do regularly, so being able to write "Merge: origin maint pu" (or "Merge: ncq chs-support") as a short-hand makes much sense.

There is not much inherent reason to require that the merge happens only to the current branch, if we stop using the files in the working tree for resolving conflicts (either manually or automatically). We could rewrite 'git pull' like this:

 - have it take 'merge into this branch' parameter, defaulting
   to the current branch, or your "Merge: <into> <remote>..."
   proposal.
 - if the merge is not to happen in the current branch, then
   use a temporary index file and a temporary working directory
   to do the merge -- when manual conflict resolution is needed,
   ask the user to go to that temporary working directory and
   resolve conflicts there and make commits there.  The
   temporary working directory is actually cheap because we do
   not have to checkout all the paths -- only the paths involved
   in the merge.

I remember the merge Linus originally envisioned would have worked along the above lines, until he changed his mind around 2a68a8659f7dc55fd285d235ae2d19e7a8116c30 commit, beginning of June, for 1.0 (ewww, we were already aiming for 1.0 back then).

	http://marc.theaimsgroup.com/?l=git&m=111806925225305&w=2

declared the merge in separate directory is post 1.0 item, and I tend to agree with that. Most of the time you will be merging into the current branch, and otherwise you could make it so by switching to that branch before pulling.

Previous: Jon LoeligerNext: Junio C Hamano
Message 16 of 23 in “GIT 0.99.7d, and end of week status.”
  1. Junio C HamanoSep 25, 2005
  2. Alan ChandlerSep 25, 2005
  3. Junio C HamanoSep 25, 2005
  4. Alan ChandlerSep 25, 2005
  5. Junio C HamanoSep 26, 2005
  6. Alan ChandlerSep 26, 2005
  7. Junio C HamanoSep 26, 2005
  8. Tom PrinceSep 25, 2005
  9. Junio C HamanoSep 25, 2005
  10. Petr BaudisSep 26, 2005
  11. Junio C HamanoSep 26, 2005
  12. Petr BaudisSep 27, 2005
  13. Matthias UrlichsSep 29, 2005
  14. Junio C HamanoSep 29, 2005
  15. Jon LoeligerSep 26, 2005
  16. Junio C HamanoSep 26, 2005
  17. Fix default pull not to do an unintended Octopus.Junio C Hamano, Sep 27, 2005
  18. Josef WeidendorferSep 27, 2005
  19. Petr BaudisSep 27, 2005
  20. Josef WeidendorferSep 27, 2005
  21. Junio C HamanoSep 27, 2005
  22. Petr BaudisSep 27, 2005
  23. Petr BaudisSep 27, 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.