aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-07-02 19:05:28 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-07-02 19:05:59 +0200
commit98a3dc992f26007b6862d1afc4e0aa42f9795307 (patch)
treeb738efeaf153e5ff26eabf5f9d51236f248d1904
parent45b9e67735752578bafe7d220c0175273847a0f0 (diff)
downloaddwim-98a3dc992f26007b6862d1afc4e0aa42f9795307.tar.gz
Add git status handler
-rwxr-xr-xdwim7
1 files changed, 7 insertions, 0 deletions
diff --git a/dwim b/dwim
index 5ace0a6..1b6b443 100755
--- a/dwim
+++ b/dwim
@@ -107,6 +107,13 @@ for ($phrase) {
run @EDITOR, "+$l", $p;
}
+ if (/^ (?:modified: |deleted: )?(\S*)\n/m) {
+ handle 'git status';
+ chdir dir;
+ my @files = m//mg;
+ run @OPENER, '-pwith-git -s', 'git', 'add', @files;
+ }
+
if (/^(\S+)$/) {
handle 'maildir / directory / file';
my $p = path $1;