From b30b38e78057db96a95395dbf6afe8d073cda3be Mon Sep 17 00:00:00 2001 From: Chris Apple <14171107+cjappl@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:25:52 -0700 Subject: [PATCH] Final update with rename workflow --- bin/git-forgit | 4 ++-- file_to_rename.txt | 2 -- test file with spaces.txt | 0 text[file]brackets.txt | 0 4 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 file_to_rename.txt delete mode 100644 test file with spaces.txt delete mode 100644 text[file]brackets.txt diff --git a/bin/git-forgit b/bin/git-forgit index 1e624cd..ca89c0c 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -137,10 +137,10 @@ _forgit_diff() { # oldfile\0 # We have to do a two-step sed -> tr pipe because OSX's sed implementation does # not support the null-character directly. - get_files="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z]\\\\][[:space:]]*//' | tr '\\\n' '\\\0'" + get_files="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z]\\\\][[:space:]]*//' | sed 's/ -> /\\\n/' | tr '\\\n' '\\\0'" # Similar to the line above, but only gets a single file from a single line # Gets the new name of renamed files - get_file="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z]\\\\][[:space:]]*//' | tr '\\\n' '\\\0'" + get_file="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z]\\\\][[:space:]]*//' | sed 's/.*-> //'" # Git stashes are named "stash@{x}", which contains the fzf placeholder "{x}". # In order to support passing stashes as arguments to _forgit_diff, we have to # prevent fzf from interpreting this substring by escaping the opening bracket. diff --git a/file_to_rename.txt b/file_to_rename.txt deleted file mode 100644 index 139597f..0000000 --- a/file_to_rename.txt +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/test file with spaces.txt b/test file with spaces.txt deleted file mode 100644 index e69de29..0000000 diff --git a/text[file]brackets.txt b/text[file]brackets.txt deleted file mode 100644 index e69de29..0000000