git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: git-whatchanged does not show merge result?
       [not found] <4dd15d180510140929x2c69f61ag19a1409cfd993e7b@mail.gmail.com>
@ 2005-10-14 16:33 ` David Ho
  2005-10-14 17:13   ` Linus Torvalds
  2005-10-14 17:24   ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: David Ho @ 2005-10-14 16:33 UTC (permalink / raw)
  To: git

Hi,

Maybe someone can clear up a confusion I have with git-whatchanged.
I created a new repo with just one file hello, split out a new branch "mybranch.
When I merged back the changes from mybranch, git-whatchanged -p did
not should the diff of the merge.
Does it have some special behaviour I am not aware of.  I'd appreciate
if you can clarify.
Notice that git-whatchange does not show the diff between (last
commit) fd494be and 83ac91a1

Thanks, David

git version 0.99.7b

commands used (roughly to repeat the test)

mkdir git-tutorial
cd git-tutorial
git-init-db
echo "Hello World" >hello
git-update-index --add hello
echo "It's a new day for git" >>hello
echo "Initial commit" | git-commit-tree $(git-write-tree) > .git/HEAD
git -m "added It's a new day..." commit hello
git checkout -b mybranch
git checkout mybranch
echo "Work, work, work" >>hello
git commit -m 'Some work.' hello
git checkout master
echo "Play, play, play" >>hello
git commit -m 'Some fun.' hello
git pull . mybranch
vi hello (merge the change by hand...)
git -m "merge work,work,... from mybranch" commit hello

last commit
#cat .git/HEAD
fd494becb20a8d9eddad01921de1cc9fe2cbf354

output from git-whatchanged -p hello

diff-tree 83ac91a13297887760f252aa9026e76235adcdd9 (from
7a78a9c5bb38ad4db1b5c9b14c1d409b2f36c0b0)
Author:  <davidho@penguin.nanometrics.ca>
Date:   Fri Oct 14 12:02:50 2005 -0400

    Some fun.

diff --git a/hello b/hello
--- a/hello
+++ b/hello
@@ -1,2 +1,3 @@
 Hello World
 It's a new day for git
+Play, play, play

diff-tree b12ea5026dbc9ad651fcad6b44a683548fda47a7 (from
7a78a9c5bb38ad4db1b5c9b14c1d409b2f36c0b0)
Author:  <davidho@penguin.nanometrics.ca>
Date:   Fri Oct 14 12:02:22 2005 -0400

    Some work.

diff --git a/hello b/hello
--- a/hello
+++ b/hello
@@ -1,2 +1,3 @@
 Hello World
 It's a new day for git
+Work, work, work

diff-tree 7a78a9c5bb38ad4db1b5c9b14c1d409b2f36c0b0 (from
e45b23ab79bec72ba4ef0a79820a3c172751e59b)
Author:  <davidho@penguin.nanometrics.ca>
Date:   Fri Oct 14 12:00:48 2005 -0400

    Add line "It's a new day..."

diff --git a/hello b/hello
--- a/hello
+++ b/hello
@@ -1 +1,2 @@
 Hello World
+It's a new day for git

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

* Re: git-whatchanged does not show merge result?
  2005-10-14 16:33 ` git-whatchanged does not show merge result? David Ho
@ 2005-10-14 17:13   ` Linus Torvalds
  2005-10-14 17:31     ` David Ho
  2005-10-14 17:24   ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2005-10-14 17:13 UTC (permalink / raw)
  To: David Ho; +Cc: git



On Fri, 14 Oct 2005, David Ho wrote:
> 
> Maybe someone can clear up a confusion I have with git-whatchanged.
> I created a new repo with just one file hello, split out a new branch "mybranch.
> When I merged back the changes from mybranch, git-whatchanged -p did
> not should the diff of the merge.

You can use the "-m" flag to show merges. HOWEVER, it's not very useful 
in general, although it _is_ useful on a file-by-file basis. 

What "-m" does is that it will show diffs against each parent, which is 
_sometimes_ what you want. Try it.

		Linus

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

* Re: git-whatchanged does not show merge result?
  2005-10-14 16:33 ` git-whatchanged does not show merge result? David Ho
  2005-10-14 17:13   ` Linus Torvalds
@ 2005-10-14 17:24   ` Junio C Hamano
  2005-10-14 17:39     ` David Ho
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2005-10-14 17:24 UTC (permalink / raw)
  To: David Ho; +Cc: git

David Ho <davidkwho@gmail.com> writes:

> When I merged back the changes from mybranch, git-whatchanged -p did
> not should the diff of the merge.

You probably mean "git-whatchanged -p -m".

I've seen this question asked at least twice in the past.

    SYNOPSIS
    --------
    'git-whatchanged' <option>...

    DESCRIPTION
    -----------
    Shows commit logs and diff output each commit introduces.  The
    command internally invokes 'git-rev-list' piped to
    'git-diff-tree', and takes command line options for both of
    these commands.

    This manual page describes only the most frequently used options.

Perhaps the frequently used options should include '-m' as well.
This part is from git-diff-tree.txt:

    -m::
            By default, "git-diff-tree --stdin" does not show
            differences for merge commits.  With this flag, it shows
            differences to that commit from all of its parents.

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

* Re: git-whatchanged does not show merge result?
  2005-10-14 17:13   ` Linus Torvalds
@ 2005-10-14 17:31     ` David Ho
  2005-10-14 18:39       ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: David Ho @ 2005-10-14 17:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

I was a little worried when I did git-whatchanged on a file and there
was a hole in the history where the merge is.  This reassured me that
all changes to the file is accessible (I'm sure they are all stored
safely in the repo =).

Thanks, David

On 10/14/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Fri, 14 Oct 2005, David Ho wrote:
> >
> > Maybe someone can clear up a confusion I have with git-whatchanged.
> > I created a new repo with just one file hello, split out a new branch "mybranch.
> > When I merged back the changes from mybranch, git-whatchanged -p did
> > not should the diff of the merge.
>
> You can use the "-m" flag to show merges. HOWEVER, it's not very useful
> in general, although it _is_ useful on a file-by-file basis.
>
> What "-m" does is that it will show diffs against each parent, which is
> _sometimes_ what you want. Try it.
>
>                 Linus
>

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

* Re: git-whatchanged does not show merge result?
  2005-10-14 17:24   ` Junio C Hamano
@ 2005-10-14 17:39     ` David Ho
  0 siblings, 0 replies; 6+ messages in thread
From: David Ho @ 2005-10-14 17:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Sorry, I'm still reading the man pages on
http://www.kernel.org/pub/software/scm/git/docs/.
Thanks for pointing that out.

David

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

* Re: git-whatchanged does not show merge result?
  2005-10-14 17:31     ` David Ho
@ 2005-10-14 18:39       ` Linus Torvalds
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2005-10-14 18:39 UTC (permalink / raw)
  To: David Ho; +Cc: git



On Fri, 14 Oct 2005, David Ho wrote:
>
> I was a little worried when I did git-whatchanged on a file and there
> was a hole in the history where the merge is.  This reassured me that
> all changes to the file is accessible (I'm sure they are all stored
> safely in the repo =).

Btw, "git-whatchanged" really _can_ hide real stuff, namely when nothing 
changed.

A commit that has no changes at all (which is quite possible) will never 
be shown by git-whatchanged. 

So in many ways, "git log" is the way to see all commits. 
"git-whatchanged" is really just a way to see the _changes_, and by 
defauly it ignores merges just because the changes are "complicated".

		Linus

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

end of thread, other threads:[~2005-10-14 18:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4dd15d180510140929x2c69f61ag19a1409cfd993e7b@mail.gmail.com>
2005-10-14 16:33 ` git-whatchanged does not show merge result? David Ho
2005-10-14 17:13   ` Linus Torvalds
2005-10-14 17:31     ` David Ho
2005-10-14 18:39       ` Linus Torvalds
2005-10-14 17:24   ` Junio C Hamano
2005-10-14 17:39     ` David Ho

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