# Merge conflicts as .rej .orig files

4 messages from 2005-08-19 to 2005-08-19. Participants: Martin Langhoff, Linus Torvalds, Catalin Marinas, Daniel Barkalow.
Thread: https://gitlist.dev/t/1584

## Martin Langhoff, 2005-08-19 03:06

Subject: Merge conflicts as .rej .orig files
Message-ID: <46a038f9050818200625d64a12@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f9050818200625d64a12%40mail.gmail.com

```
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, 2005-08-19 04:29

Subject: Re: Merge conflicts as .rej .orig files
Message-ID: <Pine.LNX.4.58.0508182125490.3412@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0508182125490.3412%40g5.osdl.org
In-Reply-To: <46a038f9050818200625d64a12@mail.gmail.com>

```


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, 2005-08-19 08:27

Subject: Re: Merge conflicts as .rej .orig files
Message-ID: <tnxmznepbzn.fsf@arm.com>
URL: https://gitlist.dev/e/tnxmznepbzn.fsf%40arm.com
In-Reply-To: <46a038f9050818200625d64a12@mail.gmail.com>

```
Martin Langhoff <martin.langhoff@gmail.com> wrote:
> 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, 2005-08-19 15:30

Subject: Re: Merge conflicts as .rej .orig files
Message-ID: <Pine.LNX.4.63.0508191115200.23242@iabervon.org>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0508191115200.23242%40iabervon.org
In-Reply-To: <46a038f9050818200625d64a12@mail.gmail.com>

```
On Fri, 19 Aug 2005, Martin Langhoff wrote:

> 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*

```
