git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] doc: don't claim that cherry-pick calls patch-id
@ 2013-09-24 22:05 Michael S. Tsirkin
  2013-09-24 22:14 ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-09-24 22:05 UTC (permalink / raw)
  To: git; +Cc: Jonathan Nieder

The id is already different for binary files.
Let's document that they are similar, not identical.

Cc: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 Documentation/git-cherry.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt
index f6c19c7..66ff52f 100644
--- a/Documentation/git-cherry.txt
+++ b/Documentation/git-cherry.txt
@@ -13,12 +13,13 @@ SYNOPSIS
 DESCRIPTION
 -----------
 The changeset (or "diff") of each commit between the fork-point and <head>
-is compared against each commit between the fork-point and <upstream>.
-The commits are compared with their 'patch id', obtained from
-the 'git patch-id' program.
+is compared against diff of each commit between the fork-point and <upstream>.
+The diffs are compared with their diff id (sha1) calculated after removing
+any whitespace and line numbers (similar but not necessarily identical
+to 'patch id', obtained from the 'git patch-id' program).
 
 Every commit that doesn't exist in the <upstream> branch
-has its id (sha1) reported, prefixed by a symbol.  The ones that have
+has its diff id (sha1) reported, prefixed by a symbol.  The ones that have
 equivalent change already
 in the <upstream> branch are prefixed with a minus (-) sign, and those
 that only exist in the <head> branch are prefixed with a plus (+) symbol:
-- 
MST

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:05 [PATCH] doc: don't claim that cherry-pick calls patch-id Michael S. Tsirkin
@ 2013-09-24 22:14 ` Jonathan Nieder
  2013-09-24 22:28   ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2013-09-24 22:14 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

Michael S. Tsirkin wrote:

> Subject: [PATCH] doc: don't claim that cherry-pick calls patch-id

s/cherry-pick/cherry/

> The id is already different for binary files.
> Let's document that they are similar, not identical.

Thanks.

[...]
> --- a/Documentation/git-cherry.txt
> +++ b/Documentation/git-cherry.txt
> @@ -13,12 +13,13 @@ SYNOPSIS
>  DESCRIPTION
>  -----------
>  The changeset (or "diff") of each commit between the fork-point and <head>
> -is compared against each commit between the fork-point and <upstream>.
> +is compared against diff of each commit between the fork-point and <upstream>.

I think the old version of this sentence is clearer.

> -The commits are compared with their 'patch id', obtained from
> -the 'git patch-id' program.
> +The diffs are compared with their diff id (sha1) calculated after removing
> +any whitespace and line numbers (similar but not necessarily identical
> +to 'patch id', obtained from the 'git patch-id' program).

The hash used internally is just an implementation detail, so maybe this
sentence could just be dropped?

>  Every commit that doesn't exist in the <upstream> branch
> -has its id (sha1) reported, prefixed by a symbol.  The ones that have
> +has its diff id (sha1) reported, prefixed by a symbol.  The ones that have

Confusingly, here 'id' means 'commit name'.  For example:

 $ git log --oneline -1 sb/repack-in-c
 0b63c6a repack: improve warnings about failure of renaming and removing files
 $ git cherry sb/repack-in-c^ sb/repack-in-c
 + 0b63c6a5b78f3fdd8c4e4fed4e535e7f4eed4257

Hope that helps,
Jonathan

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:14 ` Jonathan Nieder
@ 2013-09-24 22:28   ` Michael S. Tsirkin
  2013-09-24 22:44     ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-09-24 22:28 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

On Tue, Sep 24, 2013 at 03:14:09PM -0700, Jonathan Nieder wrote:
> Michael S. Tsirkin wrote:
> 
> > Subject: [PATCH] doc: don't claim that cherry-pick calls patch-id
> 
> s/cherry-pick/cherry/
> 
> > The id is already different for binary files.
> > Let's document that they are similar, not identical.
> 
> Thanks.
> 
> [...]
> > --- a/Documentation/git-cherry.txt
> > +++ b/Documentation/git-cherry.txt
> > @@ -13,12 +13,13 @@ SYNOPSIS
> >  DESCRIPTION
> >  -----------
> >  The changeset (or "diff") of each commit between the fork-point and <head>
> > -is compared against each commit between the fork-point and <upstream>.
> > +is compared against diff of each commit between the fork-point and <upstream>.
> 
> I think the old version of this sentence is clearer.
> 
> > -The commits are compared with their 'patch id', obtained from
> > -the 'git patch-id' program.
> > +The diffs are compared with their diff id (sha1) calculated after removing
> > +any whitespace and line numbers (similar but not necessarily identical
> > +to 'patch id', obtained from the 'git patch-id' program).
> 
> The hash used internally is just an implementation detail, so maybe this
> sentence could just be dropped?

I think the fact whitespace is ignored is relevant to users, no?
We probably should drop talking about hash here.

> >  Every commit that doesn't exist in the <upstream> branch
> > -has its id (sha1) reported, prefixed by a symbol.  The ones that have
> > +has its diff id (sha1) reported, prefixed by a symbol.  The ones that have
> 
> Confusingly, here 'id' means 'commit name'.  For example:
> 
>  $ git log --oneline -1 sb/repack-in-c
>  0b63c6a repack: improve warnings about failure of renaming and removing files
>  $ git cherry sb/repack-in-c^ sb/repack-in-c
>  + 0b63c6a5b78f3fdd8c4e4fed4e535e7f4eed4257
> 
> Hope that helps,
> Jonathan

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:28   ` Michael S. Tsirkin
@ 2013-09-24 22:44     ` Jonathan Nieder
  2013-09-24 22:52       ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2013-09-24 22:44 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

Michael S. Tsirkin wrote:
> On Tue, Sep 24, 2013 at 03:14:09PM -0700, Jonathan Nieder wrote:
>> Michael S. Tsirkin wrote:

>>> -The commits are compared with their 'patch id', obtained from
>>> -the 'git patch-id' program.
>>> +The diffs are compared with their diff id (sha1) calculated after removing
>>> +any whitespace and line numbers (similar but not necessarily identical
>>> +to 'patch id', obtained from the 'git patch-id' program).
>>
>> The hash used internally is just an implementation detail, so maybe this
>> sentence could just be dropped?
>
> I think the fact whitespace is ignored is relevant to users, no?
> We probably should drop talking about hash here.

Ah, good point.  So, something like the following, then?

	Whitespace and line numbers are ignored when comparing the diffs,
	similarly to linkgit:git-patch-id[1].

Maybe some other wording would make it clearer that we are not using
"git diff -w" output.

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:44     ` Jonathan Nieder
@ 2013-09-24 22:52       ` Michael S. Tsirkin
  2013-09-24 22:53         ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-09-24 22:52 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

On Tue, Sep 24, 2013 at 03:44:31PM -0700, Jonathan Nieder wrote:
> Michael S. Tsirkin wrote:
> > On Tue, Sep 24, 2013 at 03:14:09PM -0700, Jonathan Nieder wrote:
> >> Michael S. Tsirkin wrote:
> 
> >>> -The commits are compared with their 'patch id', obtained from
> >>> -the 'git patch-id' program.
> >>> +The diffs are compared with their diff id (sha1) calculated after removing
> >>> +any whitespace and line numbers (similar but not necessarily identical
> >>> +to 'patch id', obtained from the 'git patch-id' program).
> >>
> >> The hash used internally is just an implementation detail, so maybe this
> >> sentence could just be dropped?
> >
> > I think the fact whitespace is ignored is relevant to users, no?
> > We probably should drop talking about hash here.
> 
> Ah, good point.  So, something like the following, then?
> 
> 	Whitespace and line numbers are ignored when comparing the diffs,
> 	similarly to linkgit:git-patch-id[1].
> 
> Maybe some other wording would make it clearer that we are not using
> "git diff -w" output.

See v2 that I sent, maybe that's clear enough.

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:52       ` Michael S. Tsirkin
@ 2013-09-24 22:53         ` Jonathan Nieder
  2013-09-24 22:58           ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2013-09-24 22:53 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: git

Michael S. Tsirkin wrote:

> See v2 that I sent, maybe that's clear enough.

Yep, looks sensible.  Thanks.

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

* Re: [PATCH] doc: don't claim that cherry-pick calls patch-id
  2013-09-24 22:53         ` Jonathan Nieder
@ 2013-09-24 22:58           ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-09-24 22:58 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

On Tue, Sep 24, 2013 at 03:53:56PM -0700, Jonathan Nieder wrote:
> Michael S. Tsirkin wrote:
> 
> > See v2 that I sent, maybe that's clear enough.
> 
> Yep, looks sensible.  Thanks.

OK, ack that please :)

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

end of thread, other threads:[~2013-09-24 22:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 22:05 [PATCH] doc: don't claim that cherry-pick calls patch-id Michael S. Tsirkin
2013-09-24 22:14 ` Jonathan Nieder
2013-09-24 22:28   ` Michael S. Tsirkin
2013-09-24 22:44     ` Jonathan Nieder
2013-09-24 22:52       ` Michael S. Tsirkin
2013-09-24 22:53         ` Jonathan Nieder
2013-09-24 22:58           ` Michael S. Tsirkin

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