Re: Commit-ish shortcut for immediate parent range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andy Parkins wrote:

> Git's commit-ish is very powerful.  I was wondering however, if there was a 
> shortcut for (for example)?
> 
>  git-diff 3435fdb4c^..3435fdb4c

Thats "git-diff 3435fdb4c^ 3435fdb4c" - diff need pair of things
(one or more might be implied/default), not DAG.

> That is - the short range of a particular commit's parent to that commit; like
> 
>  git-diff 3435fdb4c!
> 
> Or similar.

Or similar. You have to use git-diff-tree, not git-diff as git-diff
uses working tree as second tree if second argument is not given 
(and index as first tree if first argument is not given).

$ git diff-tree -p 3435fdb4c

(-p to show patch instead of "whatchanged" output) shows diff to parent
of commit 3435fdb4c (if commit is merge commit, show nothing; use -m
or -c or --cc then).


By the way 3435fdb4c.. means 3435fdb4c..HEAD, and ..3435fdb4c means
HEAD..3435fdb4c (where HEAD means current branch).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]