git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Question]: Does "git log" involve some stochastic operations?
@ 2022-08-13  2:06 Wang, Lei
  2022-08-13  2:35 ` Chris Torek
  0 siblings, 1 reply; 3+ messages in thread
From: Wang, Lei @ 2022-08-13  2:06 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi,

I have a question about the internal of "git log". Each time when I 
execute the following command:

 > 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?

-- 
BR,
Lei


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question]: Does "git log" involve some stochastic operations?
  2022-08-13  2:06 [Question]: Does "git log" involve some stochastic operations? Wang, Lei
@ 2022-08-13  2:35 ` Chris Torek
  2022-08-13 10:15   ` Wang, Lei
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Torek @ 2022-08-13  2:35 UTC (permalink / raw)
  To: Wang, Lei; +Cc: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Question]: Does "git log" involve some stochastic operations?
  2022-08-13  2:35 ` Chris Torek
@ 2022-08-13 10:15   ` Wang, Lei
  0 siblings, 0 replies; 3+ messages in thread
From: Wang, Lei @ 2022-08-13 10:15 UTC (permalink / raw)
  To: Chris Torek; +Cc: git@vger.kernel.org

Wonderful! That make sense that each time I do the calculation, the 
result will be slightly different.

BR,
Lei

On 8/13/2022 10:35 AM, Chris Torek wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-13 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-13  2:06 [Question]: Does "git log" involve some stochastic operations? Wang, Lei
2022-08-13  2:35 ` Chris Torek
2022-08-13 10:15   ` Wang, Lei

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).