Re: A note on merging conflicts..
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 1, 2006, 16:25 UTC
- Message-ID
- <Pine.LNX.4.64.0607010921450.12404@g5.osdl.org>
- In-Reply-To
- <20060701150926.GA25800@lsrfire.ath.cx>
On Sat, 1 Jul 2006, Rene Scharfe wrote:
> > You mean something like the following patch on top of the 'next' branch? > It also documents the --not switch because I needed it for the example.
Yes.
However, I think that 90% of the code for the ".." and "..." case are the same, as is largely the finding of it.
So why not just do this all inside the already existing
dotdot = strstr(arg, "..");
if (dotdot) {
unsigned char other_sha1[20];
const char *one = arg;
const char *two = arg + 2;
int symmetric = *two == '.';*dotdot = '\0'; two += symmetric;
if (one == arg) one = "HEAD"; if (!*two) two = "HEAD"; ...
because the only difference is really at the very end.
Did you test that it looks correct too?
Linus