# Strange behavior of gitweb

3 messages from 2009-11-26 to 2009-11-27. Participants: Alan Stern, Andreas Schwab.
Thread: https://gitlist.dev/t/21764

## Alan Stern, 2009-11-26 17:32

Subject: Strange behavior of gitweb
Message-ID: <Pine.LNX.4.44L0.0911261225130.17259-100000@netrider.rowland.org>
URL: https://gitlist.dev/e/Pine.LNX.4.44L0.0911261225130.17259-100000%40netrider.rowland.org

```
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, 2009-11-26 23:58

Subject: Re: Strange behavior of gitweb
Message-ID: <m24oogyh2o.fsf@igel.home>
URL: https://gitlist.dev/e/m24oogyh2o.fsf%40igel.home
In-Reply-To: <Pine.LNX.4.44L0.0911261225130.17259-100000@netrider.rowland.org>

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

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, 2009-11-27 17:29

Subject: Re: Strange behavior of gitweb
Message-ID: <Pine.LNX.4.44L0.0911271221460.30903-100000@netrider.rowland.org>
URL: https://gitlist.dev/e/Pine.LNX.4.44L0.0911271221460.30903-100000%40netrider.rowland.org
In-Reply-To: <m24oogyh2o.fsf@igel.home>

```
On Fri, 27 Nov 2009, Andreas Schwab wrote:

> 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

```
