{"thread":{"id":"50778","subject":"git command history","startedAt":"2019-03-19T16:04:02Z","lastAt":"2019-03-25T15:40:54Z","messageCount":5,"participants":["balaji marisetti","Junio C Hamano","Johannes Schindelin","Jeff Hostetler"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"371911","messageId":"CAKcrOwe2ARK4J6YuiXUiVXic=q568VC8JtgWMNs6WEd4hhZs3A@mail.gmail.com","threadId":"50778","inReplyTo":null,"subject":"git command history","fromName":"balaji marisetti","fromEmail":"balajimarisetti@gmail.com","sentAt":"2019-03-19T16:03:34Z","receivedAt":"2019-03-19T16:04:02Z","isPatch":false,"sender":{"key":"balajimarisetti@gmail.com","avatar":null},"body":"Hi All,\n\nCan anyone please tell me if there is way to see the command history\nof a local git repo? If there isn't a way, why hasn't the\ncommand-history feature been implemented?\n\n\nThanks,\nBalaji M\n\n-- \n:-)balaji\n"},{"id":"371940","messageId":"xmqq1s32xtg8.fsf@gitster-ct.c.googlers.com","threadId":"50778","inReplyTo":"CAKcrOwe2ARK4J6YuiXUiVXic=q568VC8JtgWMNs6WEd4hhZs3A@mail.gmail.com","subject":"Re: git command history","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-03-20T00:47:35Z","receivedAt":"2019-03-20T00:47:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"balaji marisetti <balajimarisetti@gmail.com> writes:\n\n> Can anyone please tell me if there is way to see the command history\n> of a local git repo? If there isn't a way, why hasn't the\n> command-history feature been implemented?\n\nAnother question may be why anybody would want to have such a per\nrepository command history, want Git to spend cycles and disk I/O to\nstore it, and want developers to spend braincycles to think about\nit.\n\nDepending on where you come from (i.e. if the interest in such a\nhistory is coming from corporate management and/or big brother side\nthat wants to learn what its users are doing), I think JeffH's\ntrace2 effort that allows \"telemetry\" to be collected may be a\nbetter match than a command history (e.g. \"history | grep git\").\nWithout knowing (not that I am all that interested in) what the\nmotivation of wanting such a thing, it is rather hard to guess,\nthough ;-).\n"},{"id":"372237","messageId":"nycvar.QRO.7.76.6.1903221343090.41@tvgsbejvaqbjf.bet","threadId":"50778","inReplyTo":"CAKcrOwe2ARK4J6YuiXUiVXic=q568VC8JtgWMNs6WEd4hhZs3A@mail.gmail.com","subject":"Re: git command history","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-03-22T12:46:53Z","receivedAt":"2019-03-22T12:47:13Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Balaji,\n\nOn Tue, 19 Mar 2019, balaji marisetti wrote:\n\n> Can anyone please tell me if there is way to see the command history\n> of a local git repo?\n\nIf you really are only interested in the *Git* commands, you will be able\nto implement something on top of the Trace2 feature (which just made it\ninto `master` but not into any official Git version yet, so it will most\nlikely be available when Git v2.22.0 comes out).\n\nIf you are instead interested in all shell commands in a local Git\nworktree (you probably meant the worktree, not the repository, I assume),\nthen you might need to play some games with Bash aliases to override `cd`\nand reroute the history by re-setting `HISTFILE` and then calling `history\n-cr` or something similar.\n\n> If there isn't a way, why hasn't the command-history feature been\n> implemented?\n\nBecause Git is an open source project. This means that nobody is\nresponsible for fulfilling your wishes, except for you. And you can do it,\ntoo, this project welcomes all high-quality contributions.\n\nCiao,\nJohannes\n"},{"id":"372239","messageId":"f52ef736-9d58-a6cf-e3b0-501b065ae325@jeffhostetler.com","threadId":"50778","inReplyTo":"nycvar.QRO.7.76.6.1903221343090.41@tvgsbejvaqbjf.bet","subject":"Re: git command history","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2019-03-22T13:19:36Z","receivedAt":"2019-03-22T13:19:40Z","isPatch":false,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 3/22/2019 8:46 AM, Johannes Schindelin wrote:\n> Hi Balaji,\n> \n> On Tue, 19 Mar 2019, balaji marisetti wrote:\n> \n>> Can anyone please tell me if there is way to see the command history\n>> of a local git repo?\n> \n> If you really are only interested in the *Git* commands, you will be able\n> to implement something on top of the Trace2 feature (which just made it\n> into `master` but not into any official Git version yet, so it will most\n> likely be available when Git v2.22.0 comes out).\n> \n\nTrace2 will let you see all of the git commands,\nthe alias expansions, and any shell commands launched\nby git. If those shell commands also run git commands,\nthey will be listed too.\n\nHowever, it can't tell you what was otherwise done within\nthe shell script.\n\n\n> If you are instead interested in all shell commands in a local Git\n> worktree (you probably meant the worktree, not the repository, I assume),\n> then you might need to play some games with Bash aliases to override `cd`\n> and reroute the history by re-setting `HISTFILE` and then calling `history\n> -cr` or something similar.\n> \n>> If there isn't a way, why hasn't the command-history feature been\n>> implemented?\n> \n> Because Git is an open source project. This means that nobody is\n> responsible for fulfilling your wishes, except for you. And you can do it,\n> too, this project welcomes all high-quality contributions.\n> \n> Ciao,\n> Johannes\n> \n"},{"id":"372434","messageId":"CAKcrOwfz=W+HwAZUDCo9u=prH-orUph0f-H5bXZ14pcyjFTiFA@mail.gmail.com","threadId":"50778","inReplyTo":"f52ef736-9d58-a6cf-e3b0-501b065ae325@jeffhostetler.com","subject":"Re: git command history","fromName":"balaji marisetti","fromEmail":"balajimarisetti@gmail.com","sentAt":"2019-03-25T15:40:25Z","receivedAt":"2019-03-25T15:40:54Z","isPatch":false,"sender":{"key":"balajimarisetti@gmail.com","avatar":null},"body":"Thanks Johannes, and Jeff for your responses\n\n> you probably meant the worktree, not the repository, I assume\nYou introduced me to a new feature :) I didn't know about this\n\"worktree\" feature. Thanks.\n\n> Trace2 will let you see all of the git commands,\n> the alias expansions, and any shell commands launched\n> by git. If those shell commands also run git commands,\n> they will be listed too.\nCurrently, I'm going through the code and documentation of this\nfeature. I'll see how I can leverage this feature to work for my\nusecase.\n\n\n- Balaji M\n\nOn Fri, Mar 22, 2019 at 6:49 PM Jeff Hostetler <git@jeffhostetler.com> wrote:\n>\n>\n>\n> On 3/22/2019 8:46 AM, Johannes Schindelin wrote:\n> > Hi Balaji,\n> >\n> > On Tue, 19 Mar 2019, balaji marisetti wrote:\n> >\n> >> Can anyone please tell me if there is way to see the command history\n> >> of a local git repo?\n> >\n> > If you really are only interested in the *Git* commands, you will be able\n> > to implement something on top of the Trace2 feature (which just made it\n> > into `master` but not into any official Git version yet, so it will most\n> > likely be available when Git v2.22.0 comes out).\n> >\n>\n> Trace2 will let you see all of the git commands,\n> the alias expansions, and any shell commands launched\n> by git. If those shell commands also run git commands,\n> they will be listed too.\n>\n> However, it can't tell you what was otherwise done within\n> the shell script.\n>\n>\n> > If you are instead interested in all shell commands in a local Git\n> > worktree (you probably meant the worktree, not the repository, I assume),\n> > then you might need to play some games with Bash aliases to override `cd`\n> > and reroute the history by re-setting `HISTFILE` and then calling `history\n> > -cr` or something similar.\n> >\n> >> If there isn't a way, why hasn't the command-history feature been\n> >> implemented?\n> >\n> > Because Git is an open source project. This means that nobody is\n> > responsible for fulfilling your wishes, except for you. And you can do it,\n> > too, this project welcomes all high-quality contributions.\n> >\n> > Ciao,\n> > Johannes\n> >\n\n\n\n-- \n:-)balaji\n"}]}