* git command history @ 2019-03-19 16:03 balaji marisetti 2019-03-20 0:47 ` Junio C Hamano 2019-03-22 12:46 ` Johannes Schindelin 0 siblings, 2 replies; 5+ messages in thread From: balaji marisetti @ 2019-03-19 16:03 UTC (permalink / raw) To: git Hi All, Can anyone please tell me if there is way to see the command history of a local git repo? If there isn't a way, why hasn't the command-history feature been implemented? Thanks, Balaji M -- :-)balaji ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git command history 2019-03-19 16:03 git command history balaji marisetti @ 2019-03-20 0:47 ` Junio C Hamano 2019-03-22 12:46 ` Johannes Schindelin 1 sibling, 0 replies; 5+ messages in thread From: Junio C Hamano @ 2019-03-20 0:47 UTC (permalink / raw) To: balaji marisetti; +Cc: git balaji marisetti <balajimarisetti@gmail.com> writes: > Can anyone please tell me if there is way to see the command history > of a local git repo? If there isn't a way, why hasn't the > command-history feature been implemented? Another question may be why anybody would want to have such a per repository command history, want Git to spend cycles and disk I/O to store it, and want developers to spend braincycles to think about it. Depending on where you come from (i.e. if the interest in such a history is coming from corporate management and/or big brother side that wants to learn what its users are doing), I think JeffH's trace2 effort that allows "telemetry" to be collected may be a better match than a command history (e.g. "history | grep git"). Without knowing (not that I am all that interested in) what the motivation of wanting such a thing, it is rather hard to guess, though ;-). ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git command history 2019-03-19 16:03 git command history balaji marisetti 2019-03-20 0:47 ` Junio C Hamano @ 2019-03-22 12:46 ` Johannes Schindelin 2019-03-22 13:19 ` Jeff Hostetler 1 sibling, 1 reply; 5+ messages in thread From: Johannes Schindelin @ 2019-03-22 12:46 UTC (permalink / raw) To: balaji marisetti; +Cc: git Hi Balaji, On Tue, 19 Mar 2019, balaji marisetti wrote: > Can anyone please tell me if there is way to see the command history > of a local git repo? If you really are only interested in the *Git* commands, you will be able to implement something on top of the Trace2 feature (which just made it into `master` but not into any official Git version yet, so it will most likely be available when Git v2.22.0 comes out). If you are instead interested in all shell commands in a local Git worktree (you probably meant the worktree, not the repository, I assume), then you might need to play some games with Bash aliases to override `cd` and reroute the history by re-setting `HISTFILE` and then calling `history -cr` or something similar. > If there isn't a way, why hasn't the command-history feature been > implemented? Because Git is an open source project. This means that nobody is responsible for fulfilling your wishes, except for you. And you can do it, too, this project welcomes all high-quality contributions. Ciao, Johannes ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git command history 2019-03-22 12:46 ` Johannes Schindelin @ 2019-03-22 13:19 ` Jeff Hostetler 2019-03-25 15:40 ` balaji marisetti 0 siblings, 1 reply; 5+ messages in thread From: Jeff Hostetler @ 2019-03-22 13:19 UTC (permalink / raw) To: Johannes Schindelin, balaji marisetti; +Cc: git On 3/22/2019 8:46 AM, Johannes Schindelin wrote: > Hi Balaji, > > On Tue, 19 Mar 2019, balaji marisetti wrote: > >> Can anyone please tell me if there is way to see the command history >> of a local git repo? > > If you really are only interested in the *Git* commands, you will be able > to implement something on top of the Trace2 feature (which just made it > into `master` but not into any official Git version yet, so it will most > likely be available when Git v2.22.0 comes out). > Trace2 will let you see all of the git commands, the alias expansions, and any shell commands launched by git. If those shell commands also run git commands, they will be listed too. However, it can't tell you what was otherwise done within the shell script. > If you are instead interested in all shell commands in a local Git > worktree (you probably meant the worktree, not the repository, I assume), > then you might need to play some games with Bash aliases to override `cd` > and reroute the history by re-setting `HISTFILE` and then calling `history > -cr` or something similar. > >> If there isn't a way, why hasn't the command-history feature been >> implemented? > > Because Git is an open source project. This means that nobody is > responsible for fulfilling your wishes, except for you. And you can do it, > too, this project welcomes all high-quality contributions. > > Ciao, > Johannes > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: git command history 2019-03-22 13:19 ` Jeff Hostetler @ 2019-03-25 15:40 ` balaji marisetti 0 siblings, 0 replies; 5+ messages in thread From: balaji marisetti @ 2019-03-25 15:40 UTC (permalink / raw) To: Jeff Hostetler; +Cc: Johannes Schindelin, git Thanks Johannes, and Jeff for your responses > you probably meant the worktree, not the repository, I assume You introduced me to a new feature :) I didn't know about this "worktree" feature. Thanks. > Trace2 will let you see all of the git commands, > the alias expansions, and any shell commands launched > by git. If those shell commands also run git commands, > they will be listed too. Currently, I'm going through the code and documentation of this feature. I'll see how I can leverage this feature to work for my usecase. - Balaji M On Fri, Mar 22, 2019 at 6:49 PM Jeff Hostetler <git@jeffhostetler.com> wrote: > > > > On 3/22/2019 8:46 AM, Johannes Schindelin wrote: > > Hi Balaji, > > > > On Tue, 19 Mar 2019, balaji marisetti wrote: > > > >> Can anyone please tell me if there is way to see the command history > >> of a local git repo? > > > > If you really are only interested in the *Git* commands, you will be able > > to implement something on top of the Trace2 feature (which just made it > > into `master` but not into any official Git version yet, so it will most > > likely be available when Git v2.22.0 comes out). > > > > Trace2 will let you see all of the git commands, > the alias expansions, and any shell commands launched > by git. If those shell commands also run git commands, > they will be listed too. > > However, it can't tell you what was otherwise done within > the shell script. > > > > If you are instead interested in all shell commands in a local Git > > worktree (you probably meant the worktree, not the repository, I assume), > > then you might need to play some games with Bash aliases to override `cd` > > and reroute the history by re-setting `HISTFILE` and then calling `history > > -cr` or something similar. > > > >> If there isn't a way, why hasn't the command-history feature been > >> implemented? > > > > Because Git is an open source project. This means that nobody is > > responsible for fulfilling your wishes, except for you. And you can do it, > > too, this project welcomes all high-quality contributions. > > > > Ciao, > > Johannes > > -- :-)balaji ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-25 15:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-03-19 16:03 git command history balaji marisetti 2019-03-20 0:47 ` Junio C Hamano 2019-03-22 12:46 ` Johannes Schindelin 2019-03-22 13:19 ` Jeff Hostetler 2019-03-25 15:40 ` balaji marisetti
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 NNTP newsgroup(s).