git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-reflog.txt: add an EXAMPLES section
Date: Mon, 3 Oct 2022 15:53:06 +0200	[thread overview]
Message-ID: <CA+EOSBkp7xUPOa1uJcSi1MBYqUG6r7KQmDjAWDLqLXJwwQ0djA@mail.gmail.com> (raw)
In-Reply-To: <221003.86o7uttfxg.gmgdl@evledraar.gmail.com>

Il giorno lun 3 ott 2022 alle ore 11:27 Ævar Arnfjörð Bjarmason
<avarab@gmail.com> ha scritto:
>
>
> On Mon, Oct 03 2022, Elia Pinto wrote:
>
> > This commit adds an "EXAMPLES" section to the git reflog man page.
> > This new section currently provides examples of using git reflog
> > with branches, for which doubts often exist. In this commit we also
> > add a "SEE ALSO" section which refers to further information
> > on git commands or documentation referenced in the git reflog man page.
>
> I think it can be valuable to have an EXAMPLES section, but:
>
> > +EXAMPLES
> > +--------
> > +
> > +`git reflog`::
> > +     Lists entries of reflog of HEAD, starting at `HEAD@{0}`.
> > +
> > +`git reflog HEAD`::
> > +     The same.
> > +
> > +`git reflog show HEAD`::
> > +     The same.
> > +
> > +`git reflog HEAD@{4}`::
> > +     The same, starting at the 4th prior value of HEAD.
> > +
> > +`git reflog master`::
> > +     Lists entries of reflog of `master`.
> > +
> > +`git reflog master@{0}`::
> > +     The same.
> > +
> > +`git reflog master@{now}`::
> > +     The same, show with timestamp.
> > +
> > +`git reflog master@{4.minutes}`::
> > +     The same, starting at master, 4 minutes ago.
> > +
> > +For the branch that is currently checked out, you can omit the name
> > +when you use any of the @{..} notation, so
> > +
> > +`git reflog @{0}`
> > +
> > +`git reflog @{now}`
> > +
> > +are often the easiest ways to view what you did on the current
> > +branch
>
> Most of this really just seems to be duplicating "SPECIFYING REVISIONS",
> and some of it such as "show with timestamp" is ambiguous/misleading. If
> I didn't know how it worked I'd think that it might affect the output
> itself (maybe showing times "relative to now"), but it's just
> gitrevisions syntax.

Thanks a lot, in the meantime.

The examples included are based on an email exchange done here between
a user and a git developer, maybe Junio, I don't remember. The user
found the explanation useful, as he had a hard time understanding how
git-reflog worked with branches. I agree that better could be done,
for example by entering how to recover lost commits, but that was not
the goal at the moment. Later this is something that it is  always
possible to do. It is also true that the examples in practice show
what should already be known with gitrevisions however obviously many
users cannot find the link between the two, I must imagine
>
> > +SEE ALSO
> > +--------
> > +linkgit:gitrevisions[7],
> > +linkgit:git-log[1]
>
> Likewise "SEE ALSO" sections can be really valuable, but they're really
> for "now that you've read the above, maybe this is also useful". It's
> not a "SEE STUFF YOU SAW BEFORE" :)
>
> In this case we link to these in the first and third paragraphs of the
> DESCRIPTION section (respectively), since explaining the revision syntax
> etc. is really core to understanding how this command works.
>
> The "SEE ALSO" section is really more for stuff like (in this case)
> 'git-fsck', 'git-filter-branch', 'git-rev-list' or 'git-stash'. All of
> those commansd have some direct interaction with the 'reflog', but are
> not mentioned in the main prose.
>

Better not to put a "SEE ALSO" then? I personally don't know

>
>
>
>

  reply	other threads:[~2022-10-03 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03  8:46 [PATCH] git-reflog.txt: add an EXAMPLES section Elia Pinto
2022-10-03  9:20 ` Ævar Arnfjörð Bjarmason
2022-10-03 13:53   ` Elia Pinto [this message]
2022-10-03 16:40     ` Junio C Hamano
2022-10-03 16:31   ` Junio C Hamano
2022-10-03 13:07 ` Bagas Sanjaya
2022-10-03 16:36   ` 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

  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=CA+EOSBkp7xUPOa1uJcSi1MBYqUG6r7KQmDjAWDLqLXJwwQ0djA@mail.gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    /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).