All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: "Jean-Noël AVILA" <jn.avila@free.fr>
Cc: git@vger.kernel.org, gitster@pobox.com, sunshine@sunshineco.com
Subject: Re: [PATCH 3/3] grep docs: describe --no-index further and improve formatting a bit
Date: Sat, 23 Mar 2024 20:46:16 +0100	[thread overview]
Message-ID: <ed050f2d496a6db07e698fd2f1094b81@manjaro.org> (raw)
In-Reply-To: <6056709.lOV4Wx5bFT@cayenne>

Hello Jean-Noël,

On 2024-03-23 20:26, Jean-Noël AVILA wrote:
> On Wednesday, 20 March 2024 22:08:46 CET Dragan Simic wrote:
>> diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
>> index f64f40e9775a..b144401b3698 100644
>> --- a/Documentation/git-grep.txt
>> +++ b/Documentation/git-grep.txt
>> @@ -28,7 +28,7 @@ SYNOPSIS
>>  	   [-f <file>] [-e] <pattern>
>>  	   [--and|--or|--not|(|)|-e <pattern>...]
>>  	   [--recurse-submodules] [--parent-basename <basename>]
>> -	   [ [--[no-]exclude-standard] [--cached | --no-index | --
> untracked] | <tree>...]
>> +	   [ [--[no-]exclude-standard] [--cached | --untracked | --no-
> index] | <tree>...]
> 
> This change gives precedence to some option in alternatives, which 
> seems
> weird.

As explained in the patch description, it isn't about the precedence,
but about grouping together the options that have something in common.
In more detail, --cached and --untracked have something in common,
i.e. they both leave git-grep in the usual state, in which it treats
the directory as a local git repository, unlike --no-index that makes
git-grep treat the directory not as a git repository.

>> @@ -45,13 +45,20 @@ OPTIONS
>>  	Instead of searching tracked files in the working tree, search
>>  	blobs registered in the index file.
>> 
>> ---no-index::
>> -	Search files in the current directory that is not managed by Git.
>> -
>>  --untracked::
>>  	In addition to searching in the tracked files in the working
>>  	tree, search also in untracked files.
>> 
>> +--no-index::
>> +	Search files in the current directory that is not managed by Git,
>> +	or by ignoring that the current directory is managed by Git.  This
>> +	allows `git-grep(1)` to be used as the regular `grep(1)` utility,
> 
> Auto-referencing the git-grep manpage in itself is useless.

Please note this isn't a link, it just mentions the operation.  Though,
I agree that rewording it a bit might be beneficial.

>>  When grepping the object store (with `--cached` or giving tree 
>> objects),
> running
>> -with multiple threads might perform slower than single threaded if 
>> `--
> textconv`
>> -is given and there are too many text conversions. So if you 
>> experience low
>> -performance in this case, it might be desirable to use `--threads=1`.
>> +with multiple threads might perform slower than single-threaded if 
>> `--
> textconv`
>> +is given and there are too many text conversions.  Thus, if low 
>> performance
> is
>> +experienced in this case, it might be desirable to use `--threads=1`.
> 
> I'm not native speaker, but I'm not sure the switch to passive form is
> helpful. In Simplified English, passive form is considered harmful and
> difficult to translate because the subject is elided.

In general, not addressing the user/reader directly is preferred in
technical documentation, because it eliminates the possible element
of persuading the user to do something.  In other words, we should be
telling the user what our software can do, instead of telling the
user what to do.

      reply	other threads:[~2024-03-23 19:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 21:08 [PATCH 0/3] Assorted improvements salvaged from an earlier series Dragan Simic
2024-03-20 21:08 ` [PATCH 1/3] grep: perform some minor code and comment cleanups Dragan Simic
2024-03-20 21:08 ` [PATCH 2/3] grep docs: describe --recurse-submodules further and improve formatting a bit Dragan Simic
2024-03-20 21:08 ` [PATCH 3/3] grep docs: describe --no-index " Dragan Simic
2024-03-23 19:26   ` Jean-Noël AVILA
2024-03-23 19:46     ` Dragan Simic [this message]

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=ed050f2d496a6db07e698fd2f1094b81@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jn.avila@free.fr \
    --cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.