From: Junio C Hamano <gitster@pobox.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: cherry-pick applies some other changes than the specified one?
Date: Mon, 21 Mar 2011 13:54:31 -0700 [thread overview]
Message-ID: <7vsjugnqig.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v62rcp6m6.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 21 Mar 2011 13:21:21 -0700")
Junio C Hamano <gitster@pobox.com> writes:
>> Thanks, didn't know about that (and it's not documented in diff man page).
>
> These "compare a particular stage against working tree file" modes
> only make sense when you are comparing the index and the working tree, so
> the description is in "git diff-files" manpage but hasn't been ported to
> the documentation of generic "git diff" frontend.
>
> Perhaps we should.
And here is a quick attempt to do so.
This just leaves the details of what -c/--cc are about to the combined
diff format section in diff-generate-patch.txt, which I updated in the
separate patch.
Documentation/diff-options.txt | 31 +++++++++++++++++++++++++++++++
Documentation/git-diff-files.txt | 19 -------------------
Documentation/git-diff-tree.txt | 20 --------------------
3 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index c93124b..19ce302 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -24,6 +24,37 @@ ifndef::git-format-patch[]
--patch::
Generate patch (see section on generating patches).
{git-diff? This is the default.}
+
+-1 --base::
+-2 --ours::
+-3 --theirs::
+-0::
+ These make sense only when comparing the index and the working
+ tree (i.e. `git diff-files` or `git diff <path>...`) and compares
+ against the "base" version, "our branch" or "their
+ branch" respectively. With these options, diffs for
+ merged entries are not shown.
++
+The default is to diff against our branch (-2) and the
+cleanly resolved paths. The option -0 can be given to
+omit diff output for unmerged entries and just show "Unmerged".
+
+-c::
+--cc::
+ Produce "combined diff" (and "dense combined diff" showing how the
+ result is different compared to more than one original.
++
+When used in showing a merge commit (i.e. `git show <merge>`,
+`git diff-tree <merge>` or when feeding a merge commit
+to `git diff-tree --stdin`), compare the parent commits of the
+merge with the merge commit.
++
+When used in comparison between the index and the working tree
+(i.e. `git diff` during a conflicted merge or rebase),
+compare stage 2 (our branch), stage 3 (their
+branch) and the working tree file and outputs a combined
+diff.
+
endif::git-format-patch[]
-U<n>::
diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt
index 8d48194..82d2e2e 100644
--- a/Documentation/git-diff-files.txt
+++ b/Documentation/git-diff-files.txt
@@ -21,25 +21,6 @@ OPTIONS
-------
include::diff-options.txt[]
--1 --base::
--2 --ours::
--3 --theirs::
--0::
- Diff against the "base" version, "our branch" or "their
- branch" respectively. With these options, diffs for
- merged entries are not shown.
-+
-The default is to diff against our branch (-2) and the
-cleanly resolved paths. The option -0 can be given to
-omit diff output for unmerged entries and just show "Unmerged".
-
--c::
---cc::
- This compares stage 2 (our branch), stage 3 (their
- branch) and the working tree file and outputs a combined
- diff, similar to the way 'diff-tree' shows a merge
- commit with these flags.
-
-q::
Remain silent even on nonexistent files
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 4e5f127..ebcfcfb 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -88,26 +88,6 @@ include::pretty-options.txt[]
'git diff-tree' outputs a line with the commit ID when
applicable. This flag suppressed the commit ID output.
--c::
- This flag changes the way a merge commit is displayed
- (which means it is useful only when the command is given
- one <tree-ish>, or '--stdin'). It shows the differences
- from each of the parents to the merge result simultaneously
- instead of showing pairwise diff between a parent and the
- result one at a time (which is what the '-m' option does).
- Furthermore, it lists only files which were modified
- from all parents.
-
---cc::
- This flag changes the way a merge commit patch is displayed,
- in a similar way to the '-c' option. It implies the '-c'
- and '-p' options and further compresses the patch output
- by omitting uninteresting hunks whose the contents in the parents
- have only two variants and the merge result picks one of them
- without modification. When all hunks are uninteresting, the commit
- itself and the commit log message is not shown, just like in any other
- "empty diff" case.
-
--always::
Show the commit itself and the commit log message even
if the diff itself is empty.
next prev parent reply other threads:[~2011-03-21 20:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 9:27 cherry-pick applies some other changes than the specified one? Piotr Krukowiecki
2011-03-21 16:09 ` Junio C Hamano
2011-03-21 16:41 ` Johannes Sixt
2011-03-21 18:12 ` Piotr Krukowiecki
2011-03-21 19:47 ` Junio C Hamano
2011-03-21 20:06 ` Piotr Krukowiecki
2011-03-21 19:58 ` Jonathan Nieder
2011-03-21 20:07 ` Piotr Krukowiecki
2011-03-21 20:21 ` Junio C Hamano
2011-03-21 20:54 ` Junio C Hamano [this message]
2011-03-22 5:27 ` Jonathan Nieder
2011-03-22 6:37 ` Junio C Hamano
2011-03-22 8:04 ` Piotr Krukowiecki
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=7vsjugnqig.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=jrnieder@gmail.com \
--cc=piotr.krukowiecki@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 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).