Thread (18 messages) 18 messages, 7 authors, 2016-06-15

Re: A note on merging conflicts..

flat view

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:32

Possibly related (same subject, not in this thread)


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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help