git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
Cc: git@vger.kernel.org
Subject: Re: Git log print commits between a revision range (inclusive)
Date: Mon, 04 Mar 2019 16:54:11 +0900	[thread overview]
Message-ID: <xmqq8sxvvzvg.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <62307e7b.399f4.169479a611e.Coremail.wuzhouhui14@mails.ucas.ac.cn> (wuzhouhui's message of "Mon, 4 Mar 2019 15:28:13 +0800 (GMT+08:00)")

wuzhouhui <wuzhouhui14@mails.ucas.ac.cn> writes:

> I want to know how to display logs between a revision range (both
> start and end are inclusive). I searched it and only found[1],
> which doesn't resolve my problem completely, because
>
>   git log <older hash>..<newer hash>
>
> doesn't contains the log of <older hash>.

 $ git log maint --not v2.20.0^@

gives you commits that are reachable from (i.e. ancestors of) maint,
excluding those that are reachable from the set of commits denoted
by v2.20.0^@.

v2.20.0^@ is how you spell the set of commits that are parents of
the commit v2.20.0.

If your "range" is simple and "old" is a single-parent commit,

 $ git log <old>~1..<new>

is equivalent, because <old>~1 (i.e. the first parent of commit
<old>) would be the same as <old>^@ for a single-parent commit, and
because the short-hand "git log A..B" is the same as the long-hand
"git log B --not A".








  parent reply	other threads:[~2019-03-04  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04  7:28 Git log print commits between a revision range (inclusive) wuzhouhui
2019-03-04  7:30 ` wuzhouhui
2019-03-04  7:54 ` Junio C Hamano [this message]
2019-03-05 23:42   ` Rafael Ascensão
2019-03-05 23:52     ` 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=xmqq8sxvvzvg.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=wuzhouhui14@mails.ucas.ac.cn \
    /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).