9 ms·
Show HN: Quickly browse the history of any GitHub file
- hugh-avherald 8y agoThis is really good. Thank you.
- egze 8y agoThis is nice. Can it be done with a browser extension only, without a web service? (to make it work for private repos)
- mike-cardwell 8y agoIf you try to view a file in a private repo, it asks you to "sign in with github", which presumably gives them access to read your code so that they can show you this UI.
- gamanoid 8y agoHere's his tweet where he links to them: https://twitter.com/pomber/status/1093600702071537664 https://twitter.com/pomber/status/1093600702071537664
- saagarjha 8y agoIf only GitHub could do this themselves instead of falling over if you try to run blame on any reasonably large repository…wait, hold on, it looks like this website does as well. Aww…
- oneeyedpigeon 8y agoExactly. I have wanted this on github for so long — even the animation is beyond what I'd like, I'd settle just for a 'prev/next' button that takes you from change to change. I'm pretty close to just coding it myself for local use.
- graphpapa 8y agoVim fugitive makes this pretty straightforward `:0Glog`. I imagine many other git wrappers provide similar functionality
- cpayne624 8y agoThis is super-slick. Suggestion, scroll to the (top) changed line before the change animation to reveal changes in large files that happened out of viewport. Nice work
- pomber 8y agoThanks, I was thinking in an effect like this: https://codesurfer.js.org/sample/#5 https://codesurfer.js.org/sample/#5. What do you think?
- miki725 8y agoThis is amazing! Simple and elegant. This puts any other history viewer to shame. Now I wish this was available for GitHub enterprise for work code.
- mark_l_watson 8y agoThanks! That is very cool. Definitely will add that to my workflow.
- aboutruby 8y agoI think keeping some color coding for the lines that got added / removed (better for the characters added / removed) would be nice (e.g. just an almost transparent background color on the lines / characters like Github does). Otherwise great idea and I really like the URL-based projects.
- jmiserez 8y agoBeen looking for something like this for ages. Is there a version that works with local repos? EDIT: at least for emacs, there's https://gitlab.com/pidu/git-timemachine https://gitlab.com/pidu/git-timemachine EDIT2: and a different one for Atom with a nice plot: https://github.com/littlebee/git-time-machine https://github.com/littlebee/git-time-machine
- pomber 8y agoNot yet, but I want to add a CLI for local repos soon
- koboll 8y agoThis is very cool. One suggestion: The long horizontal sliding animation seriously detracts from the user experience. It makes it difficult to track what changed because areas of the code go briefly blank while the next bit of code is sliding in. Would be a lot less difficult to track changes if new lines of code simply faded in in-place and pushed code around them up and down.
- pomber 8y agoThanks, check this issue: https://github.com/pomber/git-history/issues/22 https://github.com/pomber/git-history/issues/22, it has links to other versions with different animations.
- oneeyedpigeon 8y agoIt would also be useful to have some kind of additional indication, so that changes in files longer than one screen are visible.
- mike-cardwell 8y agoI wonder how many devs out there are going to basically hand over access to their companies property (private code repos) to this random guy by "signing in with github", without even thinking about what they're doing.
- hobofan 8y agoBy default access to private organization repositories is not given, and has to be specifically requested from the organization.
- mike-cardwell 8y agoThat's a good default.
- deleted 8y ago[deleted]
- blairanderson 8y agoits only for public files.
- mike-cardwell 8y agoNope
- alanbernstein 8y agoWhere is the "sign in with github" prompt?
- TheArcane 8y agoComes up if you request githistory for a file in a private repository
- typpo 8y agoI'm a bit sad to see this cynicism at the top of a Show HN thread. This project is a fun way to browse code history and it's done with an interesting visual style. It's also open source. I would think someone trying to view a private file is aware that they are signing in via Github to share it. Github Oauth also explicitly states that code access is shared. So, I don't think it detracts from pomber's project.
- buremba 8y agoCould you please make a bookmarklet as an alternative to Chrome extension?
- pedroborges 8y agoI just built a simple bookmarklet for myself. I hope you like it! javascript:(function(l){l.host.match('github.com') && (l.href = l.origin.replace('.com', '') + '.githistory.xyz' + l.pathname)})(window.location);
- mhw 8y agoNot quite as pretty, but here's a bookmarklet that allows you to go back by one commit in the github.com blame view (e.g. https://github.com/babel/babel/blame/master/packages/babel-core/test/browserify.js https://github.com/babel/babel/blame/master/packages/babel-c...). It basically finds the most recent 'View blame prior to this commit' link and follows it. javascript:(function(l){l.host.match('github.com') && (l.href = Array.prototype.slice.apply(document.querySelectorAll('.blame-hunk')).map((d) => [new Date(d.querySelector(".blame-commit-date time-ago").getAttribute('datetime')), d.querySelector(".blob-reblame a") && d.querySelector(".blob-reblame a").getAttribute('href')]).sort((a,b) => a[0] < b[0])[0][1])})(window.location);
- masha_sb 8y agomaybe have a sidebar, with vertical timeline - dates and profile?
- jibolso 8y agoVery neat implementation.
- mike-cardwell 8y agoSeems the project is MIT licensed and written in JavaScript so presumably somebody could package it up in a browser extension so there are no privacy issues when viewing private repos: https://github.com/pomber/git-history https://github.com/pomber/git-history - He does have browser extensions but they just look like they redirect you to the service.
- linkmotif 8y agoNot to be that guy but: git log -p $file. Works great IMO.
- pault 8y agoJust the other day I had a coworker freak out when he saw me do this. It baffles me how a professional developer could use git for years and never read the manual.
- linkmotif 8y agoyep. Or even just some blog posts or whatever. Git is the worst-presented tool I think, it’s a shame.
- u801e 8y agoThat will show you the diffs, but if you want to see the files side by side, you could do something like: diff -y <(first_sha1:path/to/file) <(second_sha1:path/to/file)
- u801e 8y agoThe command should actually read: diff -y <(git show first_sha1:path/to/file) <(git show second_sha1:path/to/file)
- azhenley 8y agoFinally! I’ve been waiting for a tool like this. If you want a similar tool built into Atom, check out this great plugin: https://atom.io/packages/git-time-machine https://atom.io/packages/git-time-machine A few years ago I also worked on a similar tool, except it was based on your undo history and was built into an IDE for a visual language: http://web.eecs.utk.edu/~azh/pubs/Henley2016VLHCC_Yestercode.pdf http://web.eecs.utk.edu/~azh/pubs/Henley2016VLHCC_Yestercode...
- ignaloidas 8y agoThis still needs performance improvements - on bigger files with longer history the transitions between commits get choppy, it shows only the newest 10 or so commits and doesn't load older ones, e.g. [0] has around 2500 lines and a history of around 200 commits. Usability is horrible for such files. [0] https://githistory.xyz/godotengine/godot/blob/master/servers/visual_server.cpp https://githistory.xyz/godotengine/godot/blob/master/servers...
- jakemor 8y agoThis is really cool. The animations are great – but I think you should speed em up a bit. The long ease-out period makes it tough to concentrate on small changes. Will most definitely use this!
- andrew_ 8y agoYMMV - I'd like to see highlighting of what's changed, as it's difficult to track multiple changes with the animations. The old stand-by red and green for diffs could work, with the old content eventually fading out or some such - probably a more elegant want to achieve that but hopefully you get the gist.
- Zitrax 8y agoExactly, I don't see this as very useful right now, looks more like fancy animations. To actually see what happened I found myself triggering the same animations again and again.
- mmoez 8y agoPosted several times during the last 72 hours on HN without getting any traction: https://news.ycombinator.com/item?id=19106499 https://news.ycombinator.com/item?id=19106499 https://news.ycombinator.com/item?id=19106328 https://news.ycombinator.com/item?id=19106328 https://news.ycombinator.com/item?id=19102828 https://news.ycombinator.com/item?id=19102828 https://news.ycombinator.com/item?id=19100110 https://news.ycombinator.com/item?id=19100110 https://news.ycombinator.com/item?id=19092802 https://news.ycombinator.com/item?id=19092802
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- sidcool 8y agoPretty neat. Have seen this submitted before I think. But good visualization.
- Davidbrcz 8y agogit-timemachine does it for emacs for those who don't know.
- dtornabene 8y agothanks! I had no idea this existed, and its awesome
- rcfox 8y agoI like vc-annotate. (Bound to `C-x v g` out of the box for me.) Besides showing blame-type information for each like, you can also press 'p' and 'n' to go to previous or next commits; you can press 'l' to view the commit message for the last commit on the line you're at; you can press 'd' to show the diff for the line you're at.
- dtornabene 8y agothis is very cool, nicely done
- royalghost 8y agoThis is great. Would be even cool if changes are shown at code level and not line.
- chatmasta 8y agoFor a similar visualization, but at the repository level, check out Gource [0] [0] https://github.com/acaudwell/Gource https://github.com/acaudwell/Gource
- cpr 8y agoThis is a helluva fun thing to run on a nearly 30-year-old repo (in our case, started with RCS, eventually ending up in git). Takes you right down memory lane and really gives you a feel for how your codebase has evolved, and the place of each contributor.
- sergiotapia 8y agoNifty, but shouldn't this be an open source app? Who would give you access to their repos?
- btbuildem 8y agoThe slick movement makes it hard to see what the changes were -- a classic diff would be orders of magnitude more effective here.
- elamje 8y agoI don't know if I'll use this much, but that is super cool. Props!
- noufalibrahim 8y agoMy thoughts exactly. It's nice to see and probably very satisfying for the creator. I can also imagine using this in some circumstances especially during presentations or teaching. For my daily work, one obvious problem is that I can't see exactly what changed between revision n and n+1. That's what really makes diffs + commit messages useful. With the slick animation, I know where it changed but the information on what exactly was modified is lost and with it, most of the reasons why I use git diff at all.
- dkarp 8y agoWhat are people's opinions of this type of diff? Are there certain cases where it's more useful to see it like this than the usual green/red above and below style? Would be great if there were studies on this. What is the easiest to interpret: in-line, above/below, side-by-side, other options I don't know exist
- xori 8y agoIt's not really a diff, it's a snapshot. If we had the past on the left, and the future on the right, then I'd call it a diff.
- dkarp 8y agoYou're right, it's snapshots with the diff animated between them. A lot of people complaining here about it being difficult to see the diff haven't understood what this is for then. But then, what is it for? Just to look pretty? Is it to easily find the state of a file at a particular date or commit? But then it'd be hard to do if there were a lot of commits. Would be nice to know what use case the creator had.
- confounded 8y agoWish there was something like this for magit!
- nikofeyn 8y agocoming to github from perforce due to a job change, i have never gotten back to the point i was at with perforce in terms of expertise, flexibility, and custom scripting. some of it is because of size of team changes, but most of it is github missing features and git being, in my opinion, overly complicated. for example, perforce has a very nice file tracking ui that helps navigate changes, braches, renames, etc.
- nullandvoid 8y agoThis looks amazing thanks! Is there any chance of a vs code port happening? Turns out I thought my current solution was nice but is actually a janky experience compared to this
- beefman 8y agoI was always flabbergasted github doesn't provide this. Also basic info that every other file browser in the universe shows, like file size.
- pizza 8y agoBeen wanting file size info in the file explorer in github for years now, it would make it so much easier to find out where to look first when exploring repos for the first time.
- lez 8y agoIt would be even more awesome than it is, if: * A "blame" column could be turned on at the left, showing output from "git blame". * When hovering over a line in the blame column, the main window shows the historical version of the file when the commit was born. Commit message appears on the left (even more left). * When it is clicked, the timeline jumps there. I understand it would be a lot of work, but it would be a super valuable tool for browsing file history in git.
- rectang 8y agoFeature request: Any chance for `--follow` to track the history of files that have moved?
- garfieldnate 8y agoI like this a lot, but every line of text is cut in half in the display for me (Chrome 71).
- edwinyzh 8y agoGranted github access, but always get "GitHub API rate limit exceeded for your IP (60 requests per hour)". This is a free github account, is it normal? Using Chrome Version 72.0.3626.96 (Official Build) (64-bit)