Last active
October 22, 2015 02:42
Revisions
-
jeebak revised this gist
Oct 22, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This 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 @@ -2,6 +2,9 @@ # # https://gist.github.com/jeebak/f9088cede18d31f2d3a0 # # Added to: https://github.com/unixorn/git-extra-commands # Further updates will be there. # [[ $# -ne 2 ]] && echo "Usage: git pie-ify pattern replacement" 1>&2 && exit 1 -
jeebak revised this gist
Oct 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This 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 @@ -3,7 +3,7 @@ # https://gist.github.com/jeebak/f9088cede18d31f2d3a0 # [[ $# -ne 2 ]] && echo "Usage: git pie-ify pattern replacement" 1>&2 && exit 1 pattern="$(sed 's;/;\\/;g' <<< "$1")" replacement="$(sed 's;/;\\/;g' <<< "$2")" -
jeebak revised this gist
Oct 21, 2015 . No changes.There are no files selected for viewing
-
jeebak revised this gist
Oct 21, 2015 . No changes.There are no files selected for viewing
-
jeebak revised this gist
Oct 21, 2015 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This 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 @@ -3,16 +3,16 @@ # https://gist.github.com/jeebak/f9088cede18d31f2d3a0 # [[ $# -ne 2 ]] && echo "Usage: git pie-fiy pattern replacement" && exit 1 pattern="$(sed 's;/;\\/;g' <<< "$1")" replacement="$(sed 's;/;\\/;g' <<< "$2")" while read -r file; do if [[ -f "$file" ]]; then echo "Processing: '$file'" # TODO: fall back to sed, if perl's not available, accounting for different # (osx/linux) versions. perl -p -i -e 's/'"$pattern"'/'"$replacement"'/g' "$file" fi done <<< "$(git grep --name-only "$pattern")" -
jeebak revised this gist
Oct 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This 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 @@ -15,4 +15,4 @@ while read -r file; do # (osx/linux) versions. perl -p -i -e 's/'"$from"'/'"$to"'/g' "$file" fi done <<< "$(git grep --name-only "$from")" -
jeebak revised this gist
Oct 21, 2015 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This 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,4 +1,7 @@ #!/usr/bin/env bash # # https://gist.github.com/jeebak/f9088cede18d31f2d3a0 # [[ $# -ne 2 ]] && echo "Usage: git pie-fiy from to" && exit @@ -8,8 +11,8 @@ to="$(sed 's;/;\\/;g' <<< "$2")" while read -r file; do if [[ -f "$file" ]]; then echo "Processing: '$file'" # TODO: fall back to sed, if perl's not available, accounting for different # (osx/linux) versions. perl -p -i -e 's/'"$from"'/'"$to"'/g' "$file" fi done <<< "$(git grep "$from" | sed 's/:.*$//' | sort -u)" -
jeebak revised this gist
Oct 20, 2015 . No changes.There are no files selected for viewing
-
jeebak created this gist
Oct 20, 2015 .There are no files selected for viewing
This 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,15 @@ #!/usr/bin/env bash [[ $# -ne 2 ]] && echo "Usage: git pie-fiy from to" && exit from="$(sed 's;/;\\/;g' <<< "$1")" to="$(sed 's;/;\\/;g' <<< "$2")" while read -r file; do if [[ -f "$file" ]]; then echo "Processing: '$file'" # TODO: fall back on sed, if perl's not available, accounting for different # (max/linux versions of sed.) perl -p -i -e 's/'"$from"'/'"$to"'/g' "$file" fi done <<< "$(git grep "$from" | sed 's/:.*$//' | sort -u)"