* Merge format documented?
@ 2009-03-23 3:19 Andreas Gruenbacher
2009-03-23 3:50 ` Junio C Hamano
2009-03-27 16:05 ` Jakub Narebski
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Gruenbacher @ 2009-03-23 3:19 UTC (permalink / raw)
To: git
Hello,
is the format that git normally uses for indicating merge conflicts in files
(the <<< === >>> markers) documented somewhere? How exactly does it differ
from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems to come close
to what git does, except that git doesn't produce the ||| section:
$ seq 1 7 > a
$ seq 1 7 | sed -e 's/4/4b/' > b
$ seq 1 7 | sed -e 's/3/3c/' > c
$ diff3 -m c a b
> 1
> 2
> <<<<<<< c
> 3c
> 4
> ||||||| a
> 3
> 4
> =======
> 3
> 4b
> >>>>>>> b
> 5
> 6
> 7
Git's output in this case is:
> 1
> 2
> <<<<<<< this-branch
> 3c
> 4
> =======
> 3
> 4b
> >>>>>>> merged-branch
> 5
> 6
> 7
Does git ever output a ||| section?
Thanks,
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merge format documented?
2009-03-23 3:19 Merge format documented? Andreas Gruenbacher
@ 2009-03-23 3:50 ` Junio C Hamano
2009-03-23 7:18 ` Andreas Gruenbacher
2009-03-27 16:05 ` Jakub Narebski
1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-03-23 3:50 UTC (permalink / raw)
To: Andreas Gruenbacher; +Cc: git
Andreas Gruenbacher <agruen@suse.de> writes:
> is the format that git normally uses for indicating merge conflicts in files
> (the <<< === >>> markers) documented somewhere? How exactly does it differ
> from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems to come close
> to what git does, except that git doesn't produce the ||| section:
It is an imitation of output from "merge" program of RCS suite Paul you
know maintains ;-) Recent versions of git supports merge.conflictstyle
configuration variable and --conflict option in 'git-checkout' to write
the conflicts out in a format that is an imitation of "diff3 -m" output.
As far as I know, neither "git" format is documented anywhere, but I
didn't find an official format specification of the "upstream" formats,
and that is why I keep saying "imitation" in the above paragraph ;-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merge format documented?
2009-03-23 3:50 ` Junio C Hamano
@ 2009-03-23 7:18 ` Andreas Gruenbacher
2009-03-23 7:52 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Gruenbacher @ 2009-03-23 7:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:
> Andreas Gruenbacher <agruen@suse.de> writes:
> > is the format that git normally uses for indicating merge conflicts in
> > files (the <<< === >>> markers) documented somewhere? How exactly does
> > it differ from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems
> > to come close to what git does, except that git doesn't produce the |||
> > section:
>
> It is an imitation of output from "merge" program of RCS suite Paul you
> know maintains ;-)
So it's the same format except that diff3's ||| section isn't shown. I was
wondering if there are any additional tricks.
Patch should support that too, even from the more limited information it has.
> Recent versions of git supports merge.conflictstyle
> configuration variable and --conflict option in 'git-checkout' to write
> the conflicts out in a format that is an imitation of "diff3 -m" output.
>
> As far as I know, neither "git" format is documented anywhere, but I
> didn't find an official format specification of the "upstream" formats,
> and that is why I keep saying "imitation" in the above paragraph ;-)
The diff info pages describe the diff3 format; that may be enough
documentation:
info -f diff -n "Marking Conflicts"
Thanks,
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merge format documented?
2009-03-23 7:18 ` Andreas Gruenbacher
@ 2009-03-23 7:52 ` Junio C Hamano
2009-03-23 9:17 ` Johannes Sixt
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-03-23 7:52 UTC (permalink / raw)
To: Andreas Gruenbacher; +Cc: git
Andreas Gruenbacher <agruen@suse.de> writes:
> On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:
>> Andreas Gruenbacher <agruen@suse.de> writes:
>> > is the format that git normally uses for indicating merge conflicts in
>> > files (the <<< === >>> markers) documented somewhere? How exactly does
>> > it differ from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems
>> > to come close to what git does, except that git doesn't produce the |||
>> > section:
>>
>> It is an imitation of output from "merge" program of RCS suite Paul you
>> know maintains ;-)
>
> So it's the same format except that diff3's ||| section isn't shown. I was
> wondering if there are any additional tricks.
No additional tricks.
As far as I can remember, the format was not really chosen, but simply
fell out as a natural consequence of using "merge" rather than "diff3" as
a merge backend (we originally used to invoke "merge" from RCS suite
instead of performing file-level merges ourselves), but we could say we
chose "merge" over "diff3 -m" because the output format should be more
familiar than the diff3-m format with |||, especially to anybody who came
from subversion or CVS background.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merge format documented?
2009-03-23 7:52 ` Junio C Hamano
@ 2009-03-23 9:17 ` Johannes Sixt
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Sixt @ 2009-03-23 9:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Andreas Gruenbacher, git
Junio C Hamano schrieb:
> Andreas Gruenbacher <agruen@suse.de> writes:
>
>> On Monday, 23 March 2009 4:50:24 Junio C Hamano wrote:
>>> Andreas Gruenbacher <agruen@suse.de> writes:
>>>> is the format that git normally uses for indicating merge conflicts in
>>>> files (the <<< === >>> markers) documented somewhere? How exactly does
>>>> it differ from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems
>>>> to come close to what git does, except that git doesn't produce the |||
>>>> section:
>>> It is an imitation of output from "merge" program of RCS suite Paul you
>>> know maintains ;-)
>> So it's the same format except that diff3's ||| section isn't shown. I was
>> wondering if there are any additional tricks.
>
> No additional tricks.
I think there's one additional trick: git moves common parts of the
conflict section outside of the conflict markers, and it even splits the
sections into two if there are common parts between two conflicting lines.
(But that doesn't change how the conflict markers look.)
-- Hannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Merge format documented?
2009-03-23 3:19 Merge format documented? Andreas Gruenbacher
2009-03-23 3:50 ` Junio C Hamano
@ 2009-03-27 16:05 ` Jakub Narebski
1 sibling, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2009-03-27 16:05 UTC (permalink / raw)
To: Andreas Gruenbacher; +Cc: git
Andreas Gruenbacher <agruen@suse.de> writes:
> Hello,
>
> is the format that git normally uses for indicating merge conflicts in files
> (the <<< === >>> markers) documented somewhere? How exactly does it differ
> from the diff3 format (<<< ||| === >>>)? Diff3's -m mode seems to come close
> to what git does, except that git doesn't produce the ||| section:
It is rcmerge / merge from RCS / CVS output format (and I think it is
also format used for other VCS), and IIRC it is equivalent to "diff3
-E" format
> Does git ever output a ||| section?
You can ask for it with merge.conflictstyle configuration variable, or
--conflict=<style> option to git-checkout.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-03-27 16:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 3:19 Merge format documented? Andreas Gruenbacher
2009-03-23 3:50 ` Junio C Hamano
2009-03-23 7:18 ` Andreas Gruenbacher
2009-03-23 7:52 ` Junio C Hamano
2009-03-23 9:17 ` Johannes Sixt
2009-03-27 16:05 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).