git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlo Arenas <carenas@gmail.com>
To: "孙世龙 sunshilong" <sunshilong369@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	git@vger.kernel.org
Subject: Re: How can I search git log with ceratin keyword but without the other keyword?
Date: Sun, 19 Jul 2020 01:26:55 -0700	[thread overview]
Message-ID: <CAPUEspj3A-bCo+WqiGksuLkqm65HAPiOjrWaAyy7S8XSy_Ohiw@mail.gmail.com> (raw)
In-Reply-To: <CAAvDm6aNN2kDh=SF6_K-v+cq0a94tcQ1AQ-Fpgs2mNo18FTFfQ@mail.gmail.com>

On Sat, Jul 18, 2020 at 10:28 PM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
> Is there some method(or command provided by git) that could get the
> comments of a certain commit (e.g: first, second,... nth)

what you are looking for is described sometimes as "relative
reference" [1], so for example if you want to refer to the commit
before last (ex: second from the top, counting as 0 base) in a
repository that looks like:

$ git log --oneline
b1824b2 (HEAD -> master) second
00d85f1 first
68757c9 initial

$ git log --oneline -n 1 HEAD@{1}
00d85f1 first

Carlo

[1] https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E9%80%89%E6%8B%A9%E4%BF%AE%E8%AE%A2%E7%89%88%E6%9C%AC

  reply	other threads:[~2020-07-19  8:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10  4:31 How can I search git log with ceratin keyword but without the other keyword? 孙世龙 sunshilong
2020-07-10  8:14 ` Carlo Arenas
2020-07-11  5:48   ` 孙世龙 sunshilong
2020-07-16 15:31     ` Jeff King
2020-07-17  1:45       ` 孙世龙 sunshilong
2020-07-17  6:33         ` Jeff King
2020-07-17  7:45           ` Junio C Hamano
2020-07-17 10:19             ` Junio C Hamano
2020-07-18  4:51               ` 孙世龙 sunshilong
2020-07-18 18:07                 ` Junio C Hamano
2020-07-19  5:28                   ` 孙世龙 sunshilong
2020-07-19  8:26                     ` Carlo Arenas [this message]
2020-07-20 17:50                       ` Junio C Hamano
2020-07-22  6:46                         ` Carlo Arenas
2020-07-17 10:27             ` 孙世龙 sunshilong
2020-07-17 10:42           ` 孙世龙 sunshilong
     [not found] <BYAPR21MB11587632058438090FE265B8E0DA9@BYAPR21MB1158.namprd21.prod.outlook.com>
2020-12-27 23:45 ` Dan Moseley

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=CAPUEspj3A-bCo+WqiGksuLkqm65HAPiOjrWaAyy7S8XSy_Ohiw@mail.gmail.com \
    --to=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=sunshilong369@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).