threads / discuss / 5836

git show and gitweb gives different result for kernel

Subject: git show and gitweb gives different result for kernel

## tl;dr

3 messages between Oct 6, 2006 and Oct 6, 2006.

replies: 2people: 3as markdown or json

Aneesh Kumar K.V· Oct 6, 2006, 17:56 UTC · lore
Hi All,
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=363e065c02b1273364d5356711a83e7f548fc0c8
git show 363e065c02b1273364d5356711a83e7f548fc0c8
git show  gives the correct values.
-aneesh
Martin Waitz· Oct 6, 2006, 18:30 UTC · re: Aneesh Kumar K.V · lore

Re: git show and gitweb gives different result for kernel

hoi :)
On Fri, Oct 06, 2006 at 11:26:35PM +0530, Aneesh Kumar K.V wrote:
> http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=363e065c02b1273364d5356711a83e7f548fc0c8
> 
> git show 363e065c02b1273364d5356711a83e7f548fc0c8

what do you mean? the diff? git show uses diff --cc so that only changes which are not in the parent trees are shown. gitweb just diffs against the first parent, and this diff is large in your example because a new upstream Linux kernel got merged into a topic branch. But it should still be correct.

But perhaps gitweb should use --cc, too.
-- 
Martin Waitz
Linus Torvalds· Oct 6, 2006, 19:08 UTC · re: Martin Waitz · lore

Re: git show and gitweb gives different result for kernel

On Fri, 6 Oct 2006, Martin Waitz wrote:
> 
> But perhaps gitweb should use --cc, too.
Both have their uses.

For example, the diff against the first parent is really broken in some cases (if a _downstream_ developer synchronizes up with the upstream, the diff ends up being potentially absolutely huge, and most of the time it's exactly the wrogn diff to show), but in other cases it's a really wonderful diff.

So for the kernel, the current gitweb behaviour tends to be exactly what you want if it's a merge that I did, especially if it was a smallish merge.

In contrast, the default for "git show" (--cc) always shows something that makes sense, but it's not necessarily going to always be _useful_. It just shows the conflicting parts, which is something that is sensible regardless of which way the merge went, but it obviously doesn't really say anything about what the real _changes_ were.

So gitweb often shows what people want it to show, but then at other times it shows totally pointless stuff. While --cc always shows something "relevant" (and often that's the empty set), but it's relevant only in a very specific way: it is about how the merge fixed up data conflicts, and that's not necessarily anything most people are even interested in.

I think it might make sense for gitweb to just have the option to show the diff against any of the parents _or_ to show the conflicting parts (--cc). Simply because different people and different uses will have different ideas of what they find useful.

		Linus

← back to recent threads