18 ms·
Am I missing something? Why is this tool interesting? Or, why is this tool useful? Wasn't this already pretty easy to find if one was so inclined?
by jordanpg 11y ago
Am I missing something?
Why is this tool interesting? Or, why is this tool useful?
Wasn't this already pretty easy to find if one was so inclined?
- lol768 11y agoFrom what I can see following a quick cursory glance at the commit history page for quite a large project (https://github.com/twbs/bootstrap/commits/master https://github.com/twbs/bootstrap/commits/master) it's somewhat difficult to jump to the last page (earliest in terms of when hey were made) of commits. That is unless I'm missing something obvious, of course. Sure, you can click older a bunch of times but it doesn't seem like there's a button to jump to the last page of commits. I guess you could clone the repo and look yourself using git log but this can be something of a hassle and probably wouldn't always be possible depending on the device (I'm thinking mobile devices, tablets etc). You could probably guess a large page number, use it in the commit history URL and chop it in half repeatedly until you don't get a 404 and then repeat from there to try and find the last page of commits. Ultimately this is an issue with how GitHub's commit history is designed though.
- JasperBall 11y ago? Just do something like: git rev-list --max-parents=0 HEAD
- baby 11y agoThis command doesn't make any sense to me. That's why I hate using git...
- parennoob 11y agoLet me attempt an explanation. 'git rev-list' will give you the SHA-1 hashes of all the commits reachable from a given commit. So 'git rev-list HEAD' is going to give you all commits reachable from HEAD, i.e. your latest one all the way to your first commit. After that, there's a bunch of ways you could filter that. For example, you could run 'git rev-list HEAD | tail -1' to get the hash of the first commit, and now all you need to do to show the whole diff is pipe it to 'xargs git show' (xargs reads from stdin and uses that as the argument to whatever comes after it. The grandparent comment uses a slightly interesting trick – he/she used the built-in '--max-parents' filter. '--max-parents' limits the number of parent commits. For example, a merge has 2 or more parent commits, so the '--max-parents=1' option will exclude all merge commits. What commit has no parents? Why, the first commit of the repo, of course. Hence, the command 'git rev-list --max-parents=0 HEAD | xargs git show'.
- yawaramin 11y agoIt's a query of the git commit history. List all commits which are direct or indirect ancestors of the `HEAD` (currently checked-out) commit, and which themselves don't have any ancestors (parents). Personally, I would have used `master` instead of `HEAD` because any commit in git can be checked out, but `master` is highly likely to be the main line of development and thus be descended from the true first commit of the repository.
- sdesol 11y agoCommits browsing/discovery on GitHub and on every other Git hosting site have always been rudimentary and I hope to change this with my chrome extension. With this extension, you should be able to find what you need faster on GitHub's commit page. Here is an example of how you can quickly identify the first commits http://imgur.com/oLveNGc http://imgur.com/oLveNGc You basically scroll the chart to the furthest left.