From a3a2184070bacb3a0c4453fbae91d2f02e0a3a73 Mon Sep 17 00:00:00 2001 From: psxvoid Date: Tue, 31 Dec 2024 12:36:02 +0000 Subject: [PATCH] Added a comment: Update: rename in separate commits --- ..._d47c6056d1db2f78d89aab036dc9b6b3._comment | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 doc/forum/What_is_the_best_way_to___34__git_annex_mv__34___file__63__/comment_6_d47c6056d1db2f78d89aab036dc9b6b3._comment diff --git a/doc/forum/What_is_the_best_way_to___34__git_annex_mv__34___file__63__/comment_6_d47c6056d1db2f78d89aab036dc9b6b3._comment b/doc/forum/What_is_the_best_way_to___34__git_annex_mv__34___file__63__/comment_6_d47c6056d1db2f78d89aab036dc9b6b3._comment new file mode 100644 index 0000000000..f456be9c99 --- /dev/null +++ b/doc/forum/What_is_the_best_way_to___34__git_annex_mv__34___file__63__/comment_6_d47c6056d1db2f78d89aab036dc9b6b3._comment @@ -0,0 +1,34 @@ +[[!comment format=mdwn + username="psxvoid" + avatar="http://cdn.libravatar.org/avatar/fde068fbdeabeea31e3be7aa9c55d84b" + subject="Update: rename in separate commits" + date="2024-12-31T12:36:02Z" + content=""" +Managed to find a semi-satisfactory approach to solve this rename problem: + +1. rename files with `git mv` +2. commit with `--no-verify` (e.g. `git commit --no-verify`) + +Now, renamed symlinks should be broken, because we skip `git annex` hooks with `--no-verify`. + +To fix it for the last commit, run: + +```shell +git show --name-status --oneline HEAD | grep R100 | cut -f3 | xargs -L 1 git annex fsck --fast -q +``` + +And then do a commit again with whatever message you like (mine is `git commit -m \"Fix git-annex symlinks\"`). + +There are a couple of inconveniences here: + +1. There are more commands to run instead of just `git commit` +2. In the git log now additional \"plumming\" commits + +Hoverer, #2 is pretty easy to solve by running: + +```shell +git log --invert-grep --grep=\"Fix git[- ]annex symlinks\" -i +``` + +Though, not sure yet how to deal with #1 - probably there is a way to automate it. +"""]]