bin/git-bre

Sat, 25 Jun 2016 00:03:23 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Sat, 25 Jun 2016 00:03:23 -0400
changeset 343
6cfbfc24ebd6
parent 342
41f152d6ab1b
permissions
-rwxr-xr-x

replace lang plugins with vim-polyglot

338
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/bin/sh
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 set -eu
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 # git-bre: "branch edit", run $EDITOR with a list of all files touched in this
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 # branch compared to upstream. Any args are passed to the editor, before the
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 # file list.
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 CHANGED=$(
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 git diff --name-only @{u}.. | while read file
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 do
342
41f152d6ab1b fix newlines in CHANGED
Meredith Howard <mhoward@roomag.org>
parents: 338
diff changeset
11 printf "\'$file\' "
338
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 done
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 )
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14
296f4b036ae3 move git-bre into a real command with better filename safety
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 eval "exec $EDITOR $@ ${CHANGED:?[No files to edit]}"

mercurial