threads / discuss / 21764

Strange behavior of gitweb

Subject: Strange behavior of gitweb

## tl;dr

3 messages between Nov 26, 2009 and Nov 27, 2009.

replies: 2people: 2as markdown or json

Alan Stern· Nov 26, 2009, 17:32 UTC · lore

If this isn't the right place to post this, could somebody please let me know where would be better?

I recently ran across this strange behavior in the gitweb server at git.kernel.org. The following URL:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.27.y.git;a=commit;h=2d93148ab6988cad872e65d694c95e8944e1b62

brings up a page containing commit 2d93148[...]. But that commit isn't part of the 2.6.27.y tree! It belongs to Linus's main tree, and it was added long after 2.6.27.y was forked off. The actual commit applied to 2.6.27.y was 070bb0f3b6df167554f0ecdeb17a5bcdb1cd7b83.

So what's going on here? Shouldn't the correct behavior be to report an error, since the requested commit isn't in the history of the specified tree?

Thanks,
Alan Stern
Andreas Schwab· Nov 26, 2009, 23:58 UTC · re: Alan Stern · lore

Re: Strange behavior of gitweb

Alan Stern <stern@rowland.harvard.edu> writes:
Show 11 quoted lines
> I recently ran across this strange behavior in the gitweb server at 
> git.kernel.org.  The following URL:
>
> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.27.y.git;a=commit;h=2d93148ab6988cad872e65d694c95e8944e1b62
>
> brings up a page containing commit 2d93148[...].  But that commit isn't
> part of the 2.6.27.y tree!  It belongs to Linus's main tree, and it was
> added long after 2.6.27.y was forked off.  The actual commit applied to
> 2.6.27.y was 070bb0f3b6df167554f0ecdeb17a5bcdb1cd7b83.
>
> So what's going on here?

Nothing mysterious. Every tree on kernel.org borrows from Linus' main tree via .git/objects/info/alternates, thus includes its whole object database by reference.

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Alan Stern· Nov 27, 2009, 17:29 UTC · re: Andreas Schwab · lore

Re: Strange behavior of gitweb

On Fri, 27 Nov 2009, Andreas Schwab wrote:
Show 17 quoted lines
> Alan Stern <stern@rowland.harvard.edu> writes:
> 
> > I recently ran across this strange behavior in the gitweb server at 
> > git.kernel.org.  The following URL:
> >
> > http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.27.y.git;a=commit;h=2d93148ab6988cad872e65d694c95e8944e1b62
> >
> > brings up a page containing commit 2d93148[...].  But that commit isn't
> > part of the 2.6.27.y tree!  It belongs to Linus's main tree, and it was
> > added long after 2.6.27.y was forked off.  The actual commit applied to
> > 2.6.27.y was 070bb0f3b6df167554f0ecdeb17a5bcdb1cd7b83.
> >
> > So what's going on here?
> 
> Nothing mysterious.  Every tree on kernel.org borrows from Linus' main
> tree via .git/objects/info/alternates, thus includes its whole object
> database by reference.

Hmm. That's all fine, but it can produce very misleading results like the one above. I can imagine the same sort of thing happening in other situations not involving alternates (e.g., orphaned commits).

Is there any way the web software can check whether the commit it found is actually an ancestor of the tip node in the requested tree, and if not add a big warning near the top of the page?

Alan Stern

← back to recent threads