Created
          May 15, 2025 02:22 
        
      - 
      
- 
        Save ento/83738ba362356650f424b76e39ff93b7 to your computer and use it in GitHub Desktop. 
Revisions
- 
        ento revised this gist May 15, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ [alias] # Alias to get the nearest parent; adapetd from https://stackoverflow.com/a/17843908 parent = "!git show-branch 2>/dev/null | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/[^\\[]*\\[\\([^\\[]*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #" # Print the number of lines changed sicne the parent branch. e.g. branch-name +10 -10 size = "!echo -n \"$(git parent) \"; git diff $(git parent)...HEAD --numstat | awk '{ additions+=$1; deletions+=$2 } END { print \"\\033[32m\" \"+\" additions \"\\033[0m\" \" \" \"\\033[31m\" \"-\" deletions }' #" 
- 
        ento created this gist May 15, 2025 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ [alias] # Alias to get the nearest parent; adapetd from https://stackoverflow.com/a/17843908 parent = "!git show-branch 2>/dev/null | grep '*' | grep -v \"$(git rev-parse --abbrev-ref HEAD)\" | head -n1 | sed 's/[^\\[]*\\[\\([^\\[]*\\)\\].*/\\1/' | sed 's/[\\^~].*//' #" # Print the number of lines changed sicne the parent branch. e.g. branch-name +10 -10 size = "!echo -n \"$(git parent) \"; git diff $(git parent)...HEAD --numstat | awk '{ additions+=$1; deletions+=$2 } END { print \"\\033[32m\" \"+\" additions \"\\033[0m\" \" \" \"\\033[31m\" \"-\" deletions }' #"