{"thread":{"id":"58299","subject":"[Question]: Does \"git log\" involve some stochastic operations?","startedAt":"2022-08-13T02:06:17Z","lastAt":"2022-08-13T10:15:57Z","messageCount":3,"participants":["Wang, Lei","Chris Torek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"461158","messageId":"20d7c54f-7438-1124-7a9e-fdc902a4cc18@intel.com","threadId":"58299","inReplyTo":null,"subject":"[Question]: Does \"git log\" involve some stochastic operations?","fromName":"Wang, Lei","fromEmail":"lei4.wang@intel.com","sentAt":"2022-08-13T02:06:10Z","receivedAt":"2022-08-13T02:06:17Z","isPatch":false,"sender":{"key":"lei4.wang@intel.com","avatar":null},"body":"Hi,\n\nI have a question about the internal of \"git log\". Each time when I \nexecute the following command:\n\n > git log --numstat --since=\"2022-06-01\" --until=\"2022-06-21\" \n--no-merges --format=%n%n%s%n%H%n%cs%n%an\\<%ae\n\nThe number of the commits in the output is slightly different. I didn't \ndo any sync operation in the repo, so the only reason I can found is \nthat maybe git log involves some stochastic operations, so each time the \noutput will be a little changed. Is my assumption right?\n\n-- \nBR,\nLei\n\n"},{"id":"461159","messageId":"CAPx1GveLZm0NH7hBqRSKHJMXttT8Wwnqm3ebjUEpbEXNwh+61w@mail.gmail.com","threadId":"58299","inReplyTo":"20d7c54f-7438-1124-7a9e-fdc902a4cc18@intel.com","subject":"Re: [Question]: Does \"git log\" involve some stochastic operations?","fromName":"Chris Torek","fromEmail":"chris.torek@gmail.com","sentAt":"2022-08-13T02:35:37Z","receivedAt":"2022-08-13T02:35:53Z","isPatch":false,"sender":{"key":"chris.torek@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16826774?v=4"},"body":"On Fri, Aug 12, 2022 at 7:11 PM Wang, Lei <lei4.wang@intel.com> wrote:\n>  > git log --numstat --since=\"2022-06-01\" --until=\"2022-06-21\"\n> --no-merges --format=%n%n%s%n%H%n%cs%n%an\\<%ae\n>\n> The number of the commits in the output is slightly different. I didn't\n> do any sync operation in the repo, so the only reason I can found is\n> that maybe git log involves some stochastic operations, so each time the\n> output will be a little changed. Is my assumption right?\n\nThe `--since` and `--until` date values use the *current time* if you do\nnot specify an exact time.  For instance, \"yesterday\" means \"precisely\n24 hours ago\" (86400 seconds ago), and \"--since 2022-06-01\" means\n\"since 1 June 2022 at whatever time of day it is right now\".  If you want\ncommits with timestamps that are since *midnight* on that day, include\nthe midnight part in the date.\n\n(This is probably a UX bug, of sorts: to mean \"at now-oclock on a given\ndate\" we should probably have a syntax like \"2022-06-21:(now)\" and\nwhen a specific date is given, the default should be midnight for \"since\"\nand 23:59:59 for \"until\", or 23:59:60 if that's a leap-second date.  But\nchanging this is probably not in the cards.)\n\nChris\n"},{"id":"461169","messageId":"27fe218d-886d-2c26-e436-104acd2b9bf6@intel.com","threadId":"58299","inReplyTo":"CAPx1GveLZm0NH7hBqRSKHJMXttT8Wwnqm3ebjUEpbEXNwh+61w@mail.gmail.com","subject":"Re: [Question]: Does \"git log\" involve some stochastic operations?","fromName":"Wang, Lei","fromEmail":"lei4.wang@intel.com","sentAt":"2022-08-13T10:15:51Z","receivedAt":"2022-08-13T10:15:57Z","isPatch":false,"sender":{"key":"lei4.wang@intel.com","avatar":null},"body":"Wonderful! That make sense that each time I do the calculation, the \nresult will be slightly different.\n\nBR,\nLei\n\nOn 8/13/2022 10:35 AM, Chris Torek wrote:\n> On Fri, Aug 12, 2022 at 7:11 PM Wang, Lei <lei4.wang@intel.com> wrote:\n>>   > git log --numstat --since=\"2022-06-01\" --until=\"2022-06-21\"\n>> --no-merges --format=%n%n%s%n%H%n%cs%n%an\\<%ae\n>>\n>> The number of the commits in the output is slightly different. I didn't\n>> do any sync operation in the repo, so the only reason I can found is\n>> that maybe git log involves some stochastic operations, so each time the\n>> output will be a little changed. Is my assumption right?\n> The `--since` and `--until` date values use the *current time* if you do\n> not specify an exact time.  For instance, \"yesterday\" means \"precisely\n> 24 hours ago\" (86400 seconds ago), and \"--since 2022-06-01\" means\n> \"since 1 June 2022 at whatever time of day it is right now\".  If you want\n> commits with timestamps that are since *midnight* on that day, include\n> the midnight part in the date.\n>\n> (This is probably a UX bug, of sorts: to mean \"at now-oclock on a given\n> date\" we should probably have a syntax like \"2022-06-21:(now)\" and\n> when a specific date is given, the default should be midnight for \"since\"\n> and 23:59:59 for \"until\", or 23:59:60 if that's a leap-second date.  But\n> changing this is probably not in the cards.)\n>\n> Chris\n"}]}