Advertisement
Guest User

./run

a guest
Nov 22nd, 2017
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # -*- mode: sh; coding: us-ascii-unix -*-
  3. set -e -E -u
  4.  
  5. REPO="demodir"
  6. rm -rf "$REPO"
  7. mkdir -p "$REPO"
  8. cd "$REPO"
  9.  
  10. git init
  11. git config user.email "me@me.org"
  12. git config user.name "me"
  13.  
  14. git commit --allow-empty -m "Empty initial state."
  15. git commit --allow-empty -m $'We start from here.\nBla bla bla.'
  16.  
  17. echo hello > hello.txt
  18. echo world > world.txt
  19. git add .
  20. git commit -m $'First commit.'
  21.  
  22. echo foo.bar > hello.txt
  23. git add .
  24. git commit -m $'Second commit\nWith more details in the body.'
  25.  
  26. delim() {
  27.     echo
  28.     echo ------------------------------------------------------------------------------
  29.     echo
  30. }
  31.  
  32. run(){
  33.     printf ">> "
  34.     printf "%q " "$@"
  35.     printf "\n"
  36.     "$@"
  37. }
  38.  
  39. indent(){
  40.     while IFS= read -r LINE; do
  41.         echo "    $LINE"
  42.     done
  43. }
  44.  
  45. delim
  46. run git log -3 --graph --name-status | indent
  47. delim
  48. run git log -3 --graph --name-status --format="%h:%s" | indent
  49. delim
  50. run git log -3 --graph --name-status --format="%n%h:%s" | indent
  51. delim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement