4 ms·
Right now, I would take a button to go to the previous revision of a file, showing the full file with the diff underneath. That way I could very easily 'browse'
by oneeyedpigeon 10y ago
Right now, I would take a button to go to the previous revision of a file, showing the full file with the diff underneath. That way I could very easily 'browse' through the history of a file to find out things like when a particular change got introduced or just get a feel for its history. Why on earth don't github/bitbucket provide this? Surely it's a reasonable and common requirement? Or is there something inherent to git that makes it too awkward?
- pricechild 10y agoAre you looking for something akin to `git blame`? Github & Bitbucket both provide a gui for this. Something even closer to what you're asking for... in github hit the 'history' button on a file (next to blame) and you'll get the commits which affected it. Hit the 7 character commit-id and you'll be taken to the diff of that change, jumped specifically to the file in question.
- oneeyedpigeon 10y agoI never really use `git blame` - my primary git use case is as a single user. The history button in github is close to what I'd like, but it's not quite as friendly as single next/previous buttons that just paginate the changes to a file. That makes cycling through the history very easy, whilst 'click commit id, back, remember which commit we just viewed, click following commit id, repeate' all sounds a bit painful.
- robinshen 10y agoGitPlex can show history of any path (a file or directory) quickly via history button, and from there you can even refine the history (search for certain tags, commits made by certain people, etc) of the file, and once you get to the point, you can either view content of the file, or hit the compare button to compare with your previous browsed copy. An example here: http://gitplex.pmease.com/demo/android-framework-base/commits?compareWith=836e74052e16f4c24c3e7e9eab0dbcaee462986f&query=path%28core/java/android/view/View.java%29 http://gitplex.pmease.com/demo/android-framework-base/commit...
- sdesol 10y agoMy product for GitLab and GitHub does this. This is an example of browsing diffs one by one: https://gitsense.com/rapid-browsing-1.mp4 https://gitsense.com/rapid-browsing-1.mp4 And this is an example of bulk diffs browsing: https://gitsense.com/rapid-browsing-2.mp4 https://gitsense.com/rapid-browsing-2.mp4 You can find the source for the chrome extension at http://github.com/gitsense/insight http://github.com/gitsense/insight And the Git indexing engine at http://gitsense.com/download http://gitsense.com/download Edit: It may not be obvious, but for the second example, I'm clicking the right arrow to quickly iterate through the diffs.
- oneeyedpigeon 10y agoYes, that second video is pretty much exactly what I'm looking for. I've been considering implementing it myself as a general-purpose git tool (i.e. not github etc. dependant) - were there any major gotchas? Do you need to pre-cache commit or diff info. or is it efficient enough to do everything in real-time?
- sdesol 10y agoThe major gotchas is building the indexing engine. Once you have that in place, getting the commit information takes milliseconds. The only time consuming thing is extracting the from and to blobs from the repo. However, that is a one time hit, since you can cache the blobs. For the diff, this is done in realtime with https://github.com/Microsoft/monaco-editor https://github.com/Microsoft/monaco-editor Also my product isn't really dependent on GitLab or GitHub. It works in standalone mode as well.
- Livven 10y agoSome (if not most) GUI Git tools should do this, e.g. I personally use Git Extensions[1] which shows history and diff side-by-side. For what it's worth, features like that (along with, say, line-by-line staging) are the reason why I usually use a GUI client and only drop down to the command line when necessary. [1] https://github.com/gitextensions/gitextensions https://github.com/gitextensions/gitextensions