You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug introduced in 6c9e339 which shouldn't have been an issue, but turns out providing a depth discards `--dry-run`
once unshallowed, this undoes the need for the prior rebase workaround from 1deb5b7 which sought to resolve this error on shallow repos, and introduced a bug of `/github/home/.local/share/dorothy/commands/git-helper: line 1211: rebase: unbound variable`
here is what the diverged/shallow bug looked like:
```
┌ Update Dorothy ┐
┌ Ensure required dependencies ┐
└ Ensure required dependencies ┘
┌ Syncing the Dorothy installation at /Users/balupton/.local/share/dorothy ┐
Fetched /Users/balupton/.local/share/dorothy remote = origin
Pulling /Users/balupton/.local/share/dorothy remote = origin branch = master
< git pull origin master >
From github.com:bevry/dorothy
* branch master -> FETCH_HEAD
hint: Diverging branches can't be fast-forwarded, you need to either:
hint:
hint: git merge --no-ff
hint:
hint: or:
hint:
hint: git rebase
hint:
hint: Disable this message with "git config set advice.diverging false"
fatal: Not possible to fast-forward, aborting.
</ git pull origin master >[128]
Failed to pull /Users/balupton/.local/share/dorothy remote = origin branch = master
ERROR: Dorothy was unable to be automatically updated. Update Dorothy manually then try again.
```
if eval-helper --quiet --wrap -- git fetch --dry-run --depth=1 "$remote";then
1114
+
# before this was `--dry-run --depth=1`, however specifying `--depth=<depth>` disregards `--dry-run` which then requires `git fetch --unshallow` to repair the `grafted` and diverged (diverged only in perception) commit history
1115
+
# there is `---negotiate-only` which seems like it would work, but it isn't
1116
+
# however, without any other args, it seems it will just do what was previously configured, however, this is called in `sync` before our initial fetch/pull, so respect the depth if one was provided, and file a bug with git that depth discards dry-run
1117
+
local depth_args=()
1118
+
# if our depth is 0, and if it is shallow
1119
+
if [[ -n$depth ]];then
1120
+
if [[ $depth-ge 1 ]];then
1121
+
# make shallow
1122
+
depth_args+=("--depth=$depth")
1123
+
elif [[ -e .git/shallow ]];then
1124
+
# make unshallow
1125
+
depth_args+=('--unshallow')
1126
+
fi# else already unshallow
1127
+
fi
1128
+
# perform the fetch
1129
+
if eval-helper --quiet --wrap -- git fetch --dry-run "${depth_args[@]}""$remote";then
0 commit comments