git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Chris Torek <chris.torek@gmail.com>
To: "Wang, Lei" <lei4.wang@intel.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [Question]: Does "git log" involve some stochastic operations?
Date: Fri, 12 Aug 2022 19:35:37 -0700	[thread overview]
Message-ID: <CAPx1GveLZm0NH7hBqRSKHJMXttT8Wwnqm3ebjUEpbEXNwh+61w@mail.gmail.com> (raw)
In-Reply-To: <20d7c54f-7438-1124-7a9e-fdc902a4cc18@intel.com>

On Fri, Aug 12, 2022 at 7:11 PM Wang, Lei <lei4.wang@intel.com> wrote:
>  > git log --numstat --since="2022-06-01" --until="2022-06-21"
> --no-merges --format=%n%n%s%n%H%n%cs%n%an\<%ae
>
> The number of the commits in the output is slightly different. I didn't
> do any sync operation in the repo, so the only reason I can found is
> that maybe git log involves some stochastic operations, so each time the
> output will be a little changed. Is my assumption right?

The `--since` and `--until` date values use the *current time* if you do
not specify an exact time.  For instance, "yesterday" means "precisely
24 hours ago" (86400 seconds ago), and "--since 2022-06-01" means
"since 1 June 2022 at whatever time of day it is right now".  If you want
commits with timestamps that are since *midnight* on that day, include
the midnight part in the date.

(This is probably a UX bug, of sorts: to mean "at now-oclock on a given
date" we should probably have a syntax like "2022-06-21:(now)" and
when a specific date is given, the default should be midnight for "since"
and 23:59:59 for "until", or 23:59:60 if that's a leap-second date.  But
changing this is probably not in the cards.)

Chris

  reply	other threads:[~2022-08-13  2:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13  2:06 [Question]: Does "git log" involve some stochastic operations? Wang, Lei
2022-08-13  2:35 ` Chris Torek [this message]
2022-08-13 10:15   ` Wang, Lei

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=CAPx1GveLZm0NH7hBqRSKHJMXttT8Wwnqm3ebjUEpbEXNwh+61w@mail.gmail.com \
    --to=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lei4.wang@intel.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).