git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: ZheNing Hu <adlternative@gmail.com>
To: Elijah Newren <newren@gmail.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 3/4] ls-files: clarify descriptions of status tags for -t
Date: Tue, 17 Jan 2023 01:21:03 +0800	[thread overview]
Message-ID: <CAOLTT8Tvkz39sigiQgdRzTfFAcQO6kf3t8Pei9Mb1R2-UNje1g@mail.gmail.com> (raw)
In-Reply-To: <CABPp-BFFfDPT1x9E4bucuQnyVrWacego2agzyqjT7h+wQ=xpUg@mail.gmail.com>

Elijah Newren <newren@gmail.com> 于2023年1月15日周日 04:27写道:
>
> On Sat, Jan 14, 2023 at 12:27 AM ZheNing Hu <adlternative@gmail.com> wrote:
> >
> > Elijah Newren via GitGitGadget <gitgitgadget@gmail.com> 于2023年1月13日周五 12:41写道:
> > >
> > > From: Elijah Newren <newren@gmail.com>
> > >
> > > Much like the file selection options we tweaked in the last commit, the
> > > status tags printed with -t had descriptions that were easy to
> > > misunderstand, and for many of the same reasons.  Clarify them.
> > >
> > > Also, while at it, remove the "semi-deprecated" comment for "git
> > > ls-files -t".  The -t option was marked as semi-deprecated in 5bc0e247c4
> > > ("Document ls-files -t as semi-obsolete.", 2010-07-28) because:
> > >
> > >     "git ls-files -t" is [...] badly documented, hence we point the
> > >     users to superior alternatives.
> > >     The feature is marked as "semi-obsolete" but not "scheduled for removal"
> > >     since it's a plumbing command, scripts might use it, and Git testsuite
> > >     already uses it to test the state of the index.
> > >
> > > Marking it as obsolete because it was easily misunderstood, which I
> > > think was primarily due to documentation problems, is one strategy, but
> > > I think fixing the documentation is a better option.  Especially since
> > > in the intervening time, "git ls-files -t" has become heavily used by
> > > sparse-checkout users where the same confusion just doesn't apply.
> > >
> > > Signed-off-by: Elijah Newren <newren@gmail.com>
> > > ---
> > >  Documentation/git-ls-files.txt | 28 +++++++++++++++-------------
> > >  1 file changed, 15 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
> > > index f89ab1bfc98..3886d58d178 100644
> > > --- a/Documentation/git-ls-files.txt
> > > +++ b/Documentation/git-ls-files.txt
> > > @@ -137,25 +137,27 @@ OPTIONS
> > >         with `-s` or `-u` options does not make any sense.
> > >
> > >  -t::
> > > -       This feature is semi-deprecated. For scripting purpose,
> > > -       linkgit:git-status[1] `--porcelain` and
> > > +       Show status tags together with filenames.  Note that for
> > > +       scripting purposes, linkgit:git-status[1] `--porcelain` and
> > >         linkgit:git-diff-files[1] `--name-status` are almost always
> > >         superior alternatives, and users should look at
> > >         linkgit:git-status[1] `--short` or linkgit:git-diff[1]
> > >         `--name-status` for more user-friendly alternatives.
> > >  +
> > >  --
> > > -This option identifies the file status with the following tags (followed by
> > > -a space) at the start of each line:
> > > -
> > > -       H::     cached
> > > -       S::     skip-worktree
> > > -       M::     unmerged
> > > -       R::     removed/deleted
> > > -       C::     modified/changed
> > > -       K::     to be killed
> > > -       ?::     other
> > > -       U::     resolve-undo
> > > +This option provides a reason for showing each filename, in the form
> > > +of a status tag (which is followed by a space and then the filename).
> > > +The status tags are all single characters from the following list:
> > > +
> > > +       H::     tracked file that is not either unmerged or skip-worktree
> > > +       S::     tracked file that is skip-worktree
> > > +       M::     tracked file that is unmerged
> > > +       R::     tracked file with unstaged removal/deletion
> > > +       C::     tracked file with unstaged modification/change
> > > +       K::     untracked paths which are part of file/directory conflicts
> > > +               which prevent checking out tracked files
> > > +       ?::     untracked file
> > > +       U::     file with resolve-undo information
> > >  --
> > >
> >
> > Good to see these tags describe are changed, especially "K" (reader
> > don't know what is "to be killed")
> >
> > Maybe we should mention which option will output these tags?
> > e.g. default -> "H"/"S" ,`--other` -> "?", `--modified` -> "C",
> > `--killed` -> "K"...
>
> We could, but...
>
>   * It's H/S/M, not just H/S that is shown by default.
>   * It gets weird because other options aren't added to the default,
> so if someone specifies "-m" then suddenly H/S/M go away...unless they
> also specify "-c".
>
> Trying to explain all that feels like we're getting close to repeating
> the documentation of the individual options.  But maybe we could just
> ignore everything around default behavior and find a way to be brief
> such as with:
>
>     Note that H, S, and M entries are shown with --cached; R entries
>     are shown with --deleted, C entries are shown with --modified, K
>     entries are shown with --killed, ? entries are shown with
>     --others, and U entries are shown with --resolve-undo.
>

What you mean is that each tag will appear in which commands, rather than
each command will have which tags. I think this segment is pretty good.

> I'm not sure if I like the documentation better with or without this
> added paragraph.  What do others think?

  reply	other threads:[~2023-01-16 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  4:41 [PATCH 0/4] clarify ls-files docs Elijah Newren via GitGitGadget
2023-01-13  4:41 ` [PATCH 1/4] ls-files: add missing documentation for --resolve-undo option Elijah Newren via GitGitGadget
2023-01-14  8:07   ` ZheNing Hu
2023-01-13  4:41 ` [PATCH 2/4] ls-files: clarify descriptions of file selection options Elijah Newren via GitGitGadget
2023-01-14  8:21   ` ZheNing Hu
2023-01-14 19:42     ` Elijah Newren
2023-01-16 17:12       ` ZheNing Hu
2023-01-13  4:41 ` [PATCH 3/4] ls-files: clarify descriptions of status tags for -t Elijah Newren via GitGitGadget
2023-01-14  8:26   ` ZheNing Hu
2023-01-14 20:26     ` Elijah Newren
2023-01-16 17:21       ` ZheNing Hu [this message]
2023-01-13  4:41 ` [PATCH 4/4] ls-files: guide folks to --exclude-standard over other --exclude* options Elijah Newren via GitGitGadget

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOLTT8Tvkz39sigiQgdRzTfFAcQO6kf3t8Pei9Mb1R2-UNje1g@mail.gmail.com \
    --to=adlternative@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).