Hacker News new | ask | show | jobs
by syncerr 4460 days ago
Testing it out:

  > git commit -F message
  Try 0/4000000 to get a 1337 commit = 3650e08c9e1ecbbeec83daf7a959e3edcf15bd4f
  Try 100000/4000000 to get a 1337 commit = 3952f7d5035f5e88f66aa5c70e5cc11fdd734852
  Try 200000/4000000 to get a 1337 commit = 51c910f5d535c515a04796eb7c7a70cbd2325599
  Try 300000/4000000 to get a 1337 commit = d70c3e64b1d963461a6ee2f518c613483b979d68
  ...
  commit id = 313378458f8c4fb53c808f4b0bae5bf71ba5e23b
  [master 3133784] 1337 Test Commit
   1 file changed, 60 insertions(+), 35 deletions(-)
https://github.com/spence/git/commit/313378458f8c4fb53c808f4...
1 comments

Right, and now you can use "git show --pretty=raw" to see the commit header:

    $ git show --pretty=raw 313378458f8c4fb53c808f4b0bae5bf71ba5e23b | head -n 10
    commit 313378458f8c4fb53c808f4b0bae5bf71ba5e23b
    tree 7e93df01bfc9c187d58a0b96e756dd8ac0031c82
    parent e4eef26d985177e4bdd32bf58b6ae40e7ae67289
    author Spencer Creasey <screasey@monetate.com> 1396872901 -0400
    committer Spencer Creasey <screasey@monetate.com> 1396872901 -0400
    lulz 843475
    
        1337 Test Commit
        
        http://lists-archives.com/git/756394-choosing-the-sha1-prefix-of-your-commits.html
There's replies in that thread where the naïve technique I was using was improved a lot.