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

Re: [PATCH 2/2] git-gui: support for diff3 conflict style

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Oct 3, 2019, 20:54 UTC
Message-ID
<20191003205407.uaguw7qyabfy3aym@yadavpratyush.com>
In-Reply-To
<dc210bf0-eef3-ed58-f596-0999fd9d9a98@iee.email>
On 03/10/19 09:02PM, Philip Oakley wrote:
Show 46 quoted lines
> On 30/09/2019 13:17, Bert Wesarg wrote:
> > Pratyush,
> > 
> > On Sun, Sep 29, 2019 at 5:04 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > > Hi Philip, Bert,
> > > 
> > > Is there any way I can test this change? Philip, I ran the rebase you
> > > mention in the GitHub issue [0], and I get that '9c8cba6862abe5ac821' is
> > > an unknown revision.
> > > 
> > > Is there any quick way I can reproduce this (maybe on a sample repo)?
> > The easiest way to produce a merge conflict, is to change the same
> > line differently in two branches and try to merge them. I added a
> > fast-import file to demonstrate this for you.
> > 
> > $ git init foo
> > $ cd foo
> > $ git fast-import <../conflict-merge.fi
> > $ git reset --hard master
> > $ git merge branch
> > 
> > this gets you into the conflict, probably the usual style. Which looks
> > in liek this on the terminal:
> > 
> > @@@ -2,7 -2,7 +2,11 @@@ Lorem ipsum dolor sit amet, consectetu
> >    Sed feugiat nisl eget efficitur ultrices.
> >    Nunc cursus metus rutrum, mollis lorem vitae, hendrerit mi.
> >    Aenean vestibulum ante ac libero venenatis, non hendrerit orci pharetra.
> > ++<<<<<<< HEAD
> >   +Proin bibendum purus ut est tristique, non pharetra dui consectetur.
> > ++=======
> > + Proin placerat leo malesuada lacinia lobortis.
> > ++>>>>>>> branch
> >    Pellentesque aliquam libero et nisi scelerisque commodo.
> >    Quisque id velit sed magna molestie porttitor.
> >    Vivamus sed urna in risus molestie ultricies.
> > 
> > and this in git gui: https://kgab.selfhost.eu/s/gHHaQqowGp7mXEb
> 
> The snapshot of the Gui looks just the thing! (I've been away).
> 
> I'm sure this would solve my immediate issue.
> 
> My only remaining bikeshed question it prompted was to check which parts
> would be committed as part of committing the whole "hunk". But haven't had
> time to look at all!

I'm not sure what you mean by "committing the whole hunk". In a merge conflict state, you don't get the usual "Stage hunk" and "Stage lines" options, but instead get 3 options:

  Use Remote Version
  Use Local Version
  Revert To Base
You can use these to choose how you want to resolve the conflict.
These 3 options seem to work fine on my quick testing.
-- 
Regards,
Pratyush Yadav
Previous: Philip OakleyNext: Philip Oakley
Message 6 of 9 in “git-gui: use existing interface to query a path's attribute”
  1. 1/2 git-gui: use existing interface to query a path's attributeBert Wesarg, Sep 25, 2019
  2. 2/2 git-gui: support for diff3 conflict styleBert Wesarg, Sep 25, 2019
  3. Pratyush YadavSep 29, 2019
  4. Bert WesargSep 30, 2019
  5. Philip OakleyOct 3, 2019
  6. Pratyush YadavOct 3, 2019
  7. Philip OakleyOct 3, 2019
  8. Pratyush YadavSep 27, 2019
  9. Philip OakleyOct 4, 2019

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.