git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cherry-pick applies some other changes than the specified one?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 22, 2011, 06:37 UTC
Message-ID
<7vlj07mzie.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110322052742.GA7637@elie>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 23 quoted lines
>> --- 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".
>
> I am not sure what this comment about the default means.  Isn't the
> default to use --cc?

Depends on where this is included. That passage originally came from diff-files, for which "-2 if exists otherwise -0" has been the default. When included in "diff" (and perhaps "show"), --cc is used by default. So we would need the "ifdef::git-diff-files[]/endif::git-diff-files[]" around it.

Show 5 quoted lines
>> +
>> +-c::
>> +--cc::
>> +	Produce "combined diff" (and "dense combined diff" showing how the
>> +	result is different compared to more than one original.

Similarly, we would need "ifdef::defaults-to-cc[]/endif" around a sentence here to say that this is the default when showing unmerged entry.

Show 7 quoted lines
> Missing an article after "Produce" (produce a combined diff) and a
> closing parenthesis after "dense combined diff", I think.
>
> More importantly, it might be nice to say
>
> 	See the section "diff format for merges" of
> 	linkgit:git-diff[1] for details.
Thanks.
Previous: Jonathan NiederNext: Piotr Krukowiecki
Message 12 of 13 in “cherry-pick applies some other changes than the specified one?”
  1. Piotr KrukowieckiMar 21, 2011
  2. Junio C HamanoMar 21, 2011
  3. Johannes SixtMar 21, 2011
  4. Piotr KrukowieckiMar 21, 2011
  5. Junio C HamanoMar 21, 2011
  6. Piotr KrukowieckiMar 21, 2011
  7. Jonathan NiederMar 21, 2011
  8. Piotr KrukowieckiMar 21, 2011
  9. Junio C HamanoMar 21, 2011
  10. Junio C HamanoMar 21, 2011
  11. Jonathan NiederMar 22, 2011
  12. Junio C HamanoMar 22, 2011
  13. Piotr KrukowieckiMar 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.