threads / discuss / 1584

Merge conflicts as .rej .orig files

Subject: Merge conflicts as .rej .orig files

## tl;dr

4 messages between Aug 19, 2005 and Aug 19, 2005.

replies: 3people: 4as markdown or json

Martin Langhoff· Aug 19, 2005, 03:06 UTC · lore

After using arch for a while, I've gotten used to getting .rej and .orig files instead of big ugly conflict markers inside the file. Emacs has a nice 'diff' mode that is a boon when dealing with conflicts this way.

Is there a way to convince cogito/git to leave reject files around? What utility is git using to do the merges? Or at least: where should I look?

cheers,
martin
Linus Torvalds· Aug 19, 2005, 04:29 UTC · re: Martin Langhoff · lore

Re: Merge conflicts as .rej .orig files

On Fri, 19 Aug 2005, Martin Langhoff wrote:
> 
> Is there a way to convince cogito/git to leave reject files around?
Nope.

Git just doesn't deal in patches. There's never any patch rejects: there are just two source files that get merged.

The ".orig" and ".rej" things are signs of patch-based systems. 

I'm sure you could fake it, but I'm also sure that there's an emacs mode for the "merge" style diffs. It is, after all, what CVS and RCS have used, so I'd expect that there be tons of support for making it look nice and help merges.

		Linus
Catalin Marinas· Aug 19, 2005, 08:27 UTC · re: Martin Langhoff · lore

Re: Merge conflicts as .rej .orig files

Martin Langhoff <martin.langhoff@gmail.com> wrote:
Show 8 quoted lines
> After using arch for a while, I've gotten used to getting .rej and
> .orig files instead of big ugly conflict markers inside the file.
> Emacs has a nice 'diff' mode that is a boon when dealing with
> conflicts this way.
>
> Is there a way to convince cogito/git to leave reject files around?
> What utility is git using to do the merges? Or at least: where should
> I look?

You could have a look at StGIT as well. The tool you use for merges is configurable via the stgitrc file (diff3 is used by default, which leaves markers in the file). StGIT also leaves the 3 files involved in the tree-way merge as <file>.{older,local,remote} for further inspection.

If you prefer other tool than diff3, you can define it in the stgitrc file. Two examples are given for emacs and xxdiff. You could also write a small script which invokes diff3 by default and, if it fails, run the emacs ediff-merge-files-with-ancestor function.

-- 
Catalin
Daniel Barkalow· Aug 19, 2005, 15:30 UTC · re: Martin Langhoff · lore

Re: Merge conflicts as .rej .orig files

On Fri, 19 Aug 2005, Martin Langhoff wrote:
Show 8 quoted lines
> After using arch for a while, I've gotten used to getting .rej and
> .orig files instead of big ugly conflict markers inside the file.
> Emacs has a nice 'diff' mode that is a boon when dealing with
> conflicts this way.
>
> Is there a way to convince cogito/git to leave reject files around?
> What utility is git using to do the merges? Or at least: where should
> I look?

I believe you should be able to get that effect by having a version of "git-merge-one-script" that does "diff -c $2 $3 | patch $1" or "diff -c $2 $1 | patch $3", depending on which you want as the orig. (Or something like that. I'm not sure exactly how to get the conflict files out of the script and into the right place, or the arguments it gets.)

Of course, you'll probably have more conflicts to deal with, because the merging code gets less information that way. (In particular, you'll lose the "already contains changes" behavior, so you'll be unhappy if you have patches merged upstream.)

	-Daniel
*This .sig left intentionally blank*

← back to recent threads