Commit graph

11 commits

Author SHA1 Message Date
spacewander 4b9f1619f6 git-sed: limit paths via pathspec 2020-01-03 18:22:34 +08:00
spacewander 4d5b53aea2 git-sed: escape special characters for tr
Some special patterns like `n-l`, `[:alpha:]` need to be escaped to avoid
confusing tr.
2019-12-16 22:19:30 +08:00
spacewander f7514bebbf git-sed: fix previous bsd sed workaround 2018-05-07 15:18:28 +08:00
spacewander 0ab9b47371 git-sed: detect sed -i support and work around for the BSD sed 2018-05-05 10:57:57 +08:00
Paul Wise 9785199036
git-sed: discover a separator when the / character is used in arguments
Prevents sed from returning an error for arguments containing filenames:

$ git sed src/foo.c src/bar.c
sed: -e expression #1, char 13: unknown option to `s'
2018-04-26 11:07:07 +08:00
Paul Wise c27a3505dc
git-sed: pass the -r option to the xargs command
Prevents running sed when the search pattern does not match any files.

This results in sed printing an unnessecary warning:

$ git sed foo bar
sed: no input files
2018-04-26 11:06:34 +08:00
Paul Wise ee14220f66
git-sed: Allow the flags to be passed as a third argument
This is more in-line with how sed itself works.
2018-04-20 11:29:54 +08:00
Richard Fearn 2292e1cebe git-sed: use "git grep -z" and "xargs -0" to cope with spaces in filenames
Otherwise filenames with spaces result in errors:

    $ cat "file with spaces in name"
    old

    $ git sed old new
    sed: can't read file: No such file or directory
    sed: can't read with: No such file or directory
    sed: can't read spaces: No such file or directory
    sed: can't read in: No such file or directory
    sed: can't read name: No such file or directory
2016-11-19 17:26:17 +00:00
Richard Fearn 009f4fb6d1 git-sed: fix 'unkonwn' typo 2016-11-19 14:03:21 +00:00
spacewander b33f85a5d1 follow common shebang 2016-07-28 22:24:40 +08:00
Antoine Beaupré 4b795fc42f add simple sed command 2015-10-08 16:13:27 -04:00