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

Re: More Beginning Git Questions

From
Ttactical <a5158017@nepwk.com>
Date
Sep 25, 2011, 20:23 UTC
Message-ID
<1rwoliveqwr1v.u3bsx5axtgsb$.dlg@40tude.net>
In-Reply-To
<m31uv4rc47.fsf@localhost.localdomain>
Jakub Narebski wrote:
> With merging into branch with uncomitted changes your fairly well
> understood 3-way merge (sometimes virtual 3-way merge in the case of
> multiple common ancestors) would turn into 4-way merge.
I don't see why it would be a four-way merge rather than a three-way merge.
> Even if you
> can automate it somehow (I do wonder how Mercurial manages that),
> there could be problem resolving conflicts, unless you happen to touch
> different parts of file.

This behaviour is by design in Mercurial. It's simple, and it works. I've never had a problem with resolving conflicts here, and I don't see why I ever would.

Show 7 quoted lines
>> And that, I feel, is a problem with Git.  In some cases, you can't do
>> things how you want -- you have to do things how Git wants.
> 
> Please take into account the fact that when you were creating your
> workflow to suit your situation you were "forced" to fit it to
> Mercurial abilities and best practices.  No wonder that it does not
> fit Git-ish workflows.

No, I came to the distributed world only recently, from Subversion. I choose to use clones over plain anonymous branching, over bookmarks, and over named branching because I prefer the approach. I can, of course, do "Git branching" in Mercurial very easily if I want (with Mercurial bookmarks).

> What you use uncomitted changes for, I would use is a separate branch,
> and keep it rebasing (something like using 'mq' in Mercurial).

Yes, but, as I mentioned, rebasing is less flexible. A rebase here is effectively a merge and a commit in one step, whereas my approach separates the merge and the commit.

Show 5 quoted lines
>> Another example of this is the lack of support for anonymous branching as
>> part of a normal workflow in Git.  Anonymous branching is very powerful and
>> very simple.  I use it all the time in Mercurial.
> 
> What do you use anonymous branching for?

Anonymous branching is great for minor divergence that isn't really significant enough to deserve a name. It's also great for branches that *are* significant enough to deserve a name, but where you want to defer naming the branch right up until you merge it into another branch. At that point you can 'name' the branch in the commit message. (Of course, you could also create a Mercurial bookmark at that point, and then you'd essentially have a "Git branch".)

Show 5 quoted lines
> Note that with Git by default pushing "matching" branches, you can
> create private local-only branches.  The have to have _some_ name
> (even if it is 'foo/temp'), but I think that it makes them perhaps
> more work to create, but easier to use (to switch branches)... and for
> single anonymous branch you can always use "detached HEAD".
>From what I read, detached heads are subject to garbage collection.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 13 of 24 in “More Beginning Git Questions”
  1. Jon ForrestSep 23, 2011
  2. Matthieu MoySep 23, 2011
  3. Jakub NarebskiSep 23, 2011
  4. Jon ForrestSep 23, 2011
  5. Mihamina RakotomandimbySep 23, 2011
  6. Jakub NarebskiSep 23, 2011
  7. tacticalSep 24, 2011
  8. Frans KlaverSep 24, 2011
  9. tacticalSep 24, 2011
  10. Seth RobertsonSep 24, 2011
  11. tacticalSep 25, 2011
  12. Jakub NarebskiSep 25, 2011
  13. tacticalSep 25, 2011
  14. Jakub NarebskiSep 25, 2011
  15. tacticalSep 25, 2011
  16. Konstantin KhomoutovSep 26, 2011
  17. tacticalSep 26, 2011
  18. Andrew ArdillSep 26, 2011
  19. tacticalSep 26, 2011
  20. Jakub NarebskiSep 26, 2011
  21. Jakub NarebskiSep 24, 2011
  22. tacticalSep 24, 2011
  23. Jakub NarebskiSep 25, 2011
  24. Junio C HamanoSep 23, 2011

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.