All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Lea Wiemann <lewiemann@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: gitweb/gitk: empty merge diffs
Date: Sun, 29 Jun 2008 10:21:37 -0700 (PDT)	[thread overview]
Message-ID: <m34p7ci2ch.fsf@localhost.localdomain> (raw)
In-Reply-To: <4867B105.7070208@gmail.com>

Lea Wiemann <lewiemann@gmail.com> writes:

> I'm trying to get the diff of a merge ("git diff master^1 master")
> with gitk and gitweb, but both of them only show empty diffs (you can
> try yourself using the test script below).

Note that if you are handcrafting gitweb URL, gitweb does not allow
"master^1" as value of 'hp' ($hash_parent) parameter due to overly
strict validation (checking) of this parameter: only values suitable
as refnames, or (shortened) SHA-1 identifiers are accepted.

> Gitk doesn't seem to allow me to view the merge diff at all.
> 
> Gitweb only shows "Trivial merge" in the commitdiff view.  

Because it _is_ trivial (tree level) merge, see documentation of diff
format for merges in git-diff(1) or Documentation/diff-format.txt:

  Note that 'combined diff' lists only files which were modified from
  all parents.

If combined diff raw (difftree) format lists nothing, gitweb denotes
this as "Trivial merge".

> In the commit view, I can get the merge diff I want by clicking the
> "diff" link behind the first parent.

You can also click on the "commitdiff" link in the navbar (at top of
the page), or you can click on commit title to switch between 'commit'
and 'commitdiff' views.
 
> Why is this a "trivial merge", and what's the reason for gitweb not
> displaying the diff to the first parent in the commitdiff view?  I'm
> kinda confused here.

Lets take git.git repository as an example.  Gitweb can display both
combined diff output for merge commit, and compact combined (--cc)
output (default); if you however provide both parents it would always
display ordinary diff.  The "diff" links in the 'commit' view you have
mentioned, and "1"/"2"/... links in treediff part of combined merge
output in 'commitdiff' view, always display ordinary diff.

Default compact combined diff of a merge commit (c.f. "git show pu")
  http://repo.or.cz/w/git.git?a=commitdiff;h=58829d79 ('pu' branch)

Diff to first parent (c.f. "git diff pu^1 pu")
  http://repo.or.cz/w/git.git?a=commitdiff;h=58829d79;hp=c944eebd

Diff to second parent (c.f. "git diff pu^2 pu")
Warning: large diff, and it takes some time to be displayed!
  http://repo.or.cz/w/git.git?a=commitdiff;h=58829d79;hp=f1646543

> ===== Graph: =====
> 
> *   master      merge mybranch into master
> |\
> | * mybranch    change file2 on mybranch
> | * mybranch~1  change file2 on mybranch
> * | master~1    change file1 on master
> * | master~2    change file1 on master
> |/
> * mybranch~2    initial commit
> 
> 
> ===== Script to set up the repository: =====

Well, you can display diff to first parent in gitweb, see

  http://localhost/gitweb.cgi/test-repo.git?a=commitdiff;h=36c2b5d0;hp=62868699

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      reply	other threads:[~2008-06-29 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29 15:57 gitweb/gitk: empty merge diffs Lea Wiemann
2008-06-29 17:21 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34p7ci2ch.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lewiemann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.