Guest User

Untitled

a guest
Feb 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. # .bashrc / git
  2.  
  3. function haverev {
  4. if [ "x$1" = "x" ]; then
  5. echo "diff against have revision: which file?"
  6. return 0
  7. fi
  8. left=`git log --raw --abbrev=40 -n 1 --pretty=oneline $1 | tail -n 1 | cut -d ' ' -f 4`
  9. git show $left > /tmp/a
  10. echo "blob $left @ /tmp/a"
  11. diffmerge /tmp/a $1
  12. return 1
  13. }
  14.  
  15. function lastrev {
  16. if [ "x$1" = "x" ]; then
  17. echo "diff against last revision: which file?"
  18. return 0
  19. fi
  20. left=`git log --raw --abbrev=40 -n 1 --pretty=oneline $1 | tail -n 1 | cut -d ' ' -f 3`
  21. right=`git log --raw --abbrev=40 -n 1 --pretty=oneline $1 | tail -n 1 | cut -d ' ' -f 4`
  22. git show $left > /tmp/a
  23. git show $right > /tmp/b
  24. echo "blob $left @ /tmp/a"
  25. echo "blob $right @ /tmp/b"
  26. diffmerge /tmp/a /tmp/b &
  27. return 1
  28. }
  29.  
  30. function nrev {
  31. left=$1
  32. right=$2
  33. git show $left > /tmp/a
  34. git show $right > /tmp/b
  35. echo "blob $left @ /tmp/a"
  36. echo "blob $right @ /tmp/b"
  37. diffmerge /tmp/a /tmp/b &
  38. return 1
  39. }
Add Comment
Please, Sign In to add comment