From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>, Phil Hord <phil.hord@gmail.com>
Subject: Re: [PATCH 2/2] diffcore-pickaxe doc: document -S and -G properly
Date: Sun, 19 May 2013 00:33:12 -0700 [thread overview]
Message-ID: <7vsj1jzao7.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vfvxlw055.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 17 May 2013 18:24:22 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
> ...
>> -G<regex>::
>> - Look for differences whose added or removed line matches
>> - the given <regex>.
>> + Grep through the patch text of commits for added/removed lines
>> + that match <regex>. `--pickaxe-regex` is implied in this
>> + mode.
>
> The same comment on differences vs commits apply to this.
> ...
> it will _not_ apply to users of -G.
s/.$/ unless they say --pickaxe-regex./; so -G does not imply it at
all.
> "grep through", if the reader knows "grep", with "match <regex>", it
> is crystal clear that this expects a regular expression. And that
> is the only thing that makes -G and --pickaxe-regex superficially
> related.
s/^The description begins with /; Sorry, but I couldn't write
complete sentences on a bus ;-)
>> -This transformation is used to find filepairs that represent
>> -changes that touch a specified string, and is controlled by the
>> --S option and the `--pickaxe-all` option to the 'git diff-*'
>> -commands.
>> -
>> -When diffcore-pickaxe is in use, it checks if there are
>> -filepairs whose "result" side and whose "origin" side have
>> -different number of specified string. Such a filepair represents
>> -"the string appeared in this changeset". It also checks for the
>> -opposite case that loses the specified string.
>> -
>> -When `--pickaxe-all` is not in effect, diffcore-pickaxe leaves
>> -only such filepairs that touch the specified string in its
>> -output. When `--pickaxe-all` is used, diffcore-pickaxe leaves all
>> -filepairs intact if there is such a filepair, or makes the
>> -output empty otherwise. The latter behaviour is designed to
>> -make reviewing of the changes in the context of the whole
>> -changeset easier.
>
> This part is impossible to review on a bus, so I won't comment in
> this message.
>
> Why did you even have to touch the paragraph for --pickaxe-all?
> That applies to both -S and -G. I thought it would be just the
> matter of slightly tweaking the introductory paragraph (which was
> written back when there was only -S), keeping the second paragraph
> for -S as-is, and insert an additional paragraph for -G before
> --pickaxe-all.
Now I see that the paragraph for --pickaxe-all needs to be touched;
the original talks about "touch the specified string", which only
applies to -S and needs to be adjusted.
So here is my attempt of clarifying it.
This transformation is used to find filepairs that represent
two kinds of changes, and is controlled by the -S, -G and
--pickaxe-all options.
The "-S<block of text>" option tells Git to consider that a
filepair has differences only if the number of occurrences
of the specified block of text is different between its
preimage and its postimage, and treat other filepairs as if
they did not have any change. This is meant to be used with
a block of text that is unique enough to occur only once (so
expected the number of occurences is 1 vs 0 or 0 vs 1) to
use with "git log" to find a commit that touched the block
of text the last time. When used with the "--pickaxe-regex"
option, the <block of text> is used as a POSIX extended
regular expression to match, instead of a literal string.
The "-G<regular expression>" option tells Git to consider
that a filepair has differences only if a textual diff
between its preimage and postimage would indicate a line
that matches the given regular expression is changed, and
treat other filepairs as if they did not have any change.
When -S or -G option is used without "--pickaxe-all" option,
only filepairs that match their respective criterion are
kept in the output. When `--pickaxe-all` is used, all
filepairs intact if there is such a filepair, or makes the
output empty otherwise. This behaviour is designed to make
reviewing of the changes in the context of the whole
changeset easier.
next prev parent reply other threads:[~2013-05-19 7:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 12:23 [PATCH v2 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-17 12:23 ` [PATCH 1/2] diffcore-pickaxe: make error messages more consistent Ramkumar Ramachandra
2013-05-18 1:25 ` Junio C Hamano
2013-05-17 12:23 ` [PATCH 2/2] diffcore-pickaxe doc: document -S and -G properly Ramkumar Ramachandra
2013-05-18 1:24 ` Junio C Hamano
2013-05-19 7:33 ` Junio C Hamano [this message]
2013-05-24 9:37 ` Ramkumar Ramachandra
2013-05-24 14:58 ` Phil Hord
2013-05-24 16:01 ` Ramkumar Ramachandra
2013-05-24 16:54 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2013-05-24 10:33 [PATCH v3 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-24 10:33 ` [PATCH 2/2] diffcore-pickaxe doc: document -S and -G properly Ramkumar Ramachandra
2013-05-24 17:31 ` Junio C Hamano
2013-05-31 12:04 ` Ramkumar Ramachandra
2013-06-02 19:56 ` Junio C Hamano
2013-06-02 20:28 ` Ramkumar Ramachandra
2013-05-31 12:12 [PATCH v4 0/2] Improve diffcore-pickaxe documentation Ramkumar Ramachandra
2013-05-31 12:12 ` [PATCH 2/2] diffcore-pickaxe doc: document -S and -G properly Ramkumar Ramachandra
2013-06-03 17:54 ` Junio C Hamano
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=7vsj1jzao7.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=phil.hord@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).