git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: The merge from hell...
@ 2006-02-03  4:20 Brown, Len
  2006-02-03  5:45 ` Linus Torvalds
  0 siblings, 1 reply; 28+ messages in thread
From: Brown, Len @ 2006-02-03  4:20 UTC (permalink / raw)
  To: Linus Torvalds, Junio C Hamano
  Cc: Git Mailing List, Paul Mackerras, Marco Costalba, Aneesh Kumar

 
>Thank Len. He may have done it as a way to avoid having extra merges, 
>since I complained about those last time ;)

Seems I'm batting 1000 for entertainment value
over my last two kernel patch pushes:-)

The previous one I took abuse for unwittingly cluttering
history with "extra" merges.  The thread went on
and on, but buried in there were some interesting
observations on work flow, and somebody
asserted that the "cleanest" way to cherry pick
the topic branches onto the release branch was
with a multi-branch merge.

As git merge seemed to advertise support for it w/o
me needing to learn a new command, I tried it out
and it seemed to work fine -- including a nice colorful
diagram in gitk:-)

I can do 16 next time, or 22, or none -- or you can have
git merge under the covers do this via iteration instead
of all at once -- that's up to you guys.  My topic branches
tend to be disjoint topics with little expected overlap;
so grabbing a bunch of them when they're fully "cooked"
in -mm and plunking them down in one merge is actually
an example of history matching reality.

cheers,
-Len

^ permalink raw reply	[flat|nested] 28+ messages in thread
* RE: The merge from hell...
@ 2006-02-03 18:34 Brown, Len
  2006-02-04  2:35 ` Junio C Hamano
  0 siblings, 1 reply; 28+ messages in thread
From: Brown, Len @ 2006-02-03 18:34 UTC (permalink / raw)
  To: Dave Jones, Junio C Hamano
  Cc: Linus Torvalds, Git Mailing List, Paul Mackerras, Marco Costalba,
	Aneesh Kumar

>On Thu, Feb 02, 2006 at 10:28:43PM -0800, Junio C Hamano wrote:
>
> > > One thing I'd ask for: would it be possible to have more 
>descriptive 
> > > branch names than just numbers? Even if you want to track 
>it by bugzilla 
> > > entry number, how about calling it "bugzilla-12345" instead? 
> > 
> > When kernel people (not just Len) talk about a "bugzilla ID",
> > does that ID always come from the same namespace, or do some
> > subsystems have their own bugzilla?
>
>Not only do some subsystems have their own bugtracker (ALSA for eg),
>but referring to 'bugzilla' alone is meaningless, as it could
>mean bugme.osdl.org, bugzilla.redhat.com, bugzilla.novell.com,
>bugzilla.ubuntu.com etc etc, all of which are a prime source of
>juicy kernel bugs.

Naming the branch is just eye-candy for the merge comment.
My topic branch labels in refs/my-branch never get to kernel.org, so you're
not going to see the pretty green tags on topic branches branches that I see.

I include the full-URL of the bug report in the original commit comments
for those who are interested.  I think this it the important place to put it,
and in practice I've found it to be extremely useful.

-Len

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: The merge from hell...
@ 2006-02-03  6:41 linux
  0 siblings, 0 replies; 28+ messages in thread
From: linux @ 2006-02-03  6:41 UTC (permalink / raw)
  To: git

While we're stress-testing the ystem, does anyone feel like fixing
git-rev-parse 9fdb62af92c741addbea15545f214a6e89460865^10 ?

The following is my attempt, but it doesn't seem sufficient...

$ ~/git/git-rev-parse 9fdb62af92c741addbea15545f214a6e89460865^{1,2,3,4,5,6,7,8,9,10,11,12}
3ee68c4af3fd7228c1be63254b9f884614f9ebb2
876c184b31dc73cc3f38c5b86dee55d091a56769
729b4d4ce1982c52040bbf22d6711cdf8db07ad8
cf82478840188f8c8494c1d7a668a8ae170d0e07
dacd9b80355525be0e3c519687868410e304ad1c
63c94b68ec30847a6e2b36651703f41066f91480
35f652b5ef4ef145ac5514f6302b3f4cebfbbad4
1a38416cea8ac801ae8f261074721f35317613dc
4a90c7e86202f46fa9af011bdbcdf36e355d1721
fatal: '9fdb62af92c741addbea15545f214a6e89460865^10': No such file or directory

(Placed in the public domain; go nuts.)

diff --git a/sha1_name.c b/sha1_name.c
index ba0747c..adf49d2 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -388,52 +388,33 @@ static int peel_onion(const char *name, 
 
 static int get_sha1_1(const char *name, int len, unsigned char *sha1)
 {
-	int parent, ret;
-	const char *cp;
-
-	/* foo^[0-9] or foo^ (== foo^1); we do not do more than 9 parents. */
-	if (len > 2 && name[len-2] == '^' &&
-	    name[len-1] >= '0' && name[len-1] <= '9') {
-		parent = name[len-1] - '0';
-		len -= 2;
-	}
-	else if (len > 1 && name[len-1] == '^') {
-		parent = 1;
-		len--;
-	} else
-		parent = -1;
-
-	if (parent >= 0)
-		return get_parent(name, len, sha1, parent);
-
-	/* "name~3" is "name^^^",
-	 * "name~12" is "name^^^^^^^^^^^^", and
-	 * "name~" and "name~0" are name -- not "name^0"!
-	 */
-	parent = 0;
-	for (cp = name + len - 1; name <= cp; cp--) {
-		int ch = *cp;
-		if ('0' <= ch && ch <= '9')
-			continue;
-		if (ch != '~')
-			parent = -1;
-		break;
+	int parent = 0, pow10 = 1;
+	const char *cp = name + len;
+	char ch = 0;	/* In case len == 0 */
+
+	/* Parse trailing number and check for ^5 or ~5 */
+	while (cp > name && (ch = *--cp) >= '0' && ch <= '9') {
+		parent += ch - '0' * pow10;
+		pow10 *= 10;
 	}
-	if (!parent && *cp == '~') {
-		int len1 = cp - name;
-		cp++;
-		while (cp < name + len)
-			parent = parent * 10 + *cp++ - '0';
-		return get_nth_ancestor(name, len1, sha1, parent);
+
+	/* Handle foo^[0-9]* case */
+	if (ch == '^') {
+		/* foo^ means foo^1, first parent */
+		if (cp + 1 == name)
+			parent = 1;
+		return get_parent(name, cp - name, sha1, parent);
 	}
+	/* Handle foo~[0-9]* case.  name~ = name~0 = name (not name^0!) */
+	if (ch == '~')
+		return get_nth_ancestor(name, cp - name, sha1, parent);
 
-	ret = peel_onion(name, len, sha1);
-	if (!ret)
+	if (!peel_onion(name, len, sha1))
 		return 0;
 
-	ret = get_sha1_basic(name, len, sha1);
-	if (!ret)
+	if (!get_sha1_basic(name, len, sha1))
 		return 0;
+
 	return get_short_sha1(name, len, sha1, 0);
 }
 

^ permalink raw reply related	[flat|nested] 28+ messages in thread
* RE: The merge from hell...
@ 2006-02-03  6:04 Brown, Len
  2006-02-03  6:16 ` Linus Torvalds
  0 siblings, 1 reply; 28+ messages in thread
From: Brown, Len @ 2006-02-03  6:04 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Junio C Hamano, Git Mailing List, Paul Mackerras, Marco Costalba,
	Aneesh Kumar

>The 12-way merge was a bit over the top, but it worked. I'd 
>suggest not being quite _that_ aggressive in the future,
>though, but it's not a big deal.

I favor "assertive" over "aggressive" --
I assert that the tools I use must work as advertised;-)

> #define MAXPARENT (16)

How about setting this #define to the number
that you're comfortable with?  Then folks like me --
who wouldn't dream of checking code into Linux with a hopped-up git --
will simply obey the limit that comes with the tool?

>One thing I'd ask for: would it be possible to have more descriptive 
>branch names than just numbers? Even if you want to track it 
>by bugzilla entry number, how about calling it "bugzilla-12345" instead? 

bugzilla-#### -- no problem -- will do.

thanks,
-Len

ps. 
In the back of my head I was worried about using plain
numbers when I saw somebody refer to "shorthand SHA1".
Hopefully this is an idle worry and it is not possible
for the tool to confuse a numeric branch name with a SHA1 id.

^ permalink raw reply	[flat|nested] 28+ messages in thread
* The merge from hell...
@ 2006-02-02  6:28 Linus Torvalds
  2006-02-02  7:05 ` Junio C Hamano
  2006-02-02  7:25 ` Marco Costalba
  0 siblings, 2 replies; 28+ messages in thread
From: Linus Torvalds @ 2006-02-02  6:28 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List, Paul Mackerras, Marco Costalba,
	Aneesh Kumar


Ok,
 I've been holding off on having octopus merges in the kernel tree, but I 
just merged an ACPI update that had used one of them, and I didn't really 
see any real reason not to take it.

That octopus commit has got _twelve_ parents.

It's commit 9fdb62af92c741addbea15545f214a6e89460865, and passing it to 
git-diff-tree with the "--cc" option seems to do the largely the right 
thing (although arguably, since one of the parents always matches the end 
result in all the files, it shouldn't have shown anything at all, so I 
think it could do with some tweaking).

git-diff-tree takes almost three seconds to get its result, though.

However, if git-diff-tree is a bit slow, then gitk gets _really_ upset 
when you click on it. Apparently the colorized multi-way diff just breaks 
down into some O(2**n) hell.

I'm sure it's making progress, it's just very slow, and gitk is 
essentially unusable on that commit (gitk also gets visually confused by 
the fact that it forces a wider set of history than gitk expects, since it 
can't prune it down with the arrow notation).

[ Ahh. gitk just came back. After a _loong_ time thinking, and having run
  out of different colors, but looking otherwise fairly nice ;]

So think of it as a correctness/scalability test.

I haven't tried qgit or gitview on it, but am cc'ing Marco and Aneesh in 
case they want to hone their octopus skills on it.

Btw, I think you're better off parsing the "git-diff-tree --cc" output 
than doing it yourself like gitk does, now that core git has support for 
things like that.

			Linus

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2006-02-05 19:42 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03  4:20 The merge from hell Brown, Len
2006-02-03  5:45 ` Linus Torvalds
2006-02-03  6:28   ` Junio C Hamano
2006-02-03  7:48     ` [PATCH] get_sha1_1: allow octopus^12 to be properly parsed Junio C Hamano
2006-02-03 16:21     ` The merge from hell Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2006-02-03 18:34 Brown, Len
2006-02-04  2:35 ` Junio C Hamano
2006-02-04  2:47   ` Linus Torvalds
2006-02-03  6:41 linux
2006-02-03  6:04 Brown, Len
2006-02-03  6:16 ` Linus Torvalds
2006-02-03  6:33   ` Junio C Hamano
2006-02-02  6:28 Linus Torvalds
2006-02-02  7:05 ` Junio C Hamano
2006-02-02  7:51   ` Linus Torvalds
2006-02-02  7:55     ` Linus Torvalds
2006-02-02  8:08       ` Linus Torvalds
2006-02-04 10:46   ` Paul Mackerras
2006-02-04 12:22     ` Junio C Hamano
2006-02-04 19:42     ` Linus Torvalds
2006-02-04 20:59       ` Linus Torvalds
2006-02-02  7:25 ` Marco Costalba
2006-02-02  8:02   ` Linus Torvalds
2006-02-02  8:07     ` Aneesh Kumar
2006-02-02  8:27       ` Junio C Hamano
2006-02-02  8:44       ` Linus Torvalds
2006-02-02 10:41         ` Junio C Hamano
2006-02-05 19:42           ` Linus Torvalds

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).