lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [lucy-commits] [Lucy Wiki] Update of "LucyBookClub" by Kurt Starsinic
Date Wed, 12 Feb 2014 19:03:05 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucy Wiki" for change notification.

The "LucyBookClub" page has been changed by Kurt Starsinic:
https://wiki.apache.org/lucy/LucyBookClub?action=diff&rev1=67&rev2=68

Comment:
git alias example

  
  ''[[http://www.amazon.com/Programming-Language-Pragmatics-Third-Edition/dp/0123745144/ref=sr_1_1?ie=UTF8&qid=1342155294&sr=8-1&keywords=programming+language+pragmatics|Programming
Languages Pragmatics]]'', by Michael L Scott
  
+ == Hacks 'n Koans ==
+ 
+ Apropos of our git reading, here's an interesting and useful git alias. Paste it into your
~/.gitconfig in the [alias] section (man git-config if you've never edited your .gitconfig
before):
+ {{{
+   # "blameh" is for doing "git blame" when you want to see information on
+   # *every* commit on the current branch that affected a given range of lines
+   # in a file.  There is a plenitude of git-fu-for-aliases in here.
+   #   Syntax:       git blameh FILE LINESPEC
+   #   Description:  Show historical culpability for $FILE, limited by $LINESPEC
+   #
+   #   For the full syntax of LINESPEC, see git-blame(1) (the "-L" option).
+   #   Basic $LINESPEC:
+   #     1234      show lines 1234 to EOF
+   #     /foo/     show first line matching /foo/ to end (slashes required)
+   #     1234,1240 show lines 1234 to1240
+   #     1234,+3   show 3 lines starting at 1234 (i.e., 1234 to 1236)
+   #     1234,-2   show 2 lines culminating at 1234 (i.e., 1233 to 1234)
+   #   Example:
+   #     # Somebody broke Whoops::borked() a while ago; show who did what when.
+   #     % git blamefl Whoops.pm '/sub borked_to_work/,/^}/'
+   #   Notes:
+   #     Aliases that shell out (i.e., those whose values begin with "!")
+   #       are run from the top-level directory of the repo; "cd $GIT_PREFIX"
+   #       is to put us back in our working directory.
+   #     "git blame ... 2>/dev/null || git show ..." is because there's no way
+   #       to tell "git blame" *not* to barf if $LINESPEC isn't valid for the
+   #       given commit, and that's a common use case for this alias. Plus,
+   #       *I* would like to see any commits that I'm glossing over.
+   #     The arcane choices for single quotes, double quotes, and backslashes
+   #       are intentional.  You can tweak them, but it's not trivial.
+   blameh      = !sh -c "'\
+                 cd \"$GIT_PREFIX\"; \
+                 git rev-list HEAD \"$1\" | while read cmt; do \
+                   git blame \"-L$0\" $cmt -- $1 2>/dev/null || git blameh-show $cmt;
\
+                   echo \"  ---\"; \
+                 done'"
+   # "blameh-show" is broken out as its own alias to show how one alias can
+   #   call another, and also so that you can easily customize that piece.
+   #   E.g., you might want to change "--pretty=oneline" to "--pretty=raw", or
+   #   to 'exit 0' if you don't want to show skipped commits at all.
+   blameh-show = show --quiet --abbrev-commit --pretty=oneline
+ }}}
+ 

Mime
View raw message