Closed nyanpasu64 closed 3 years ago
hm, yes, i would accept a PR for this. if HEAD is detached and no --base
is provided, we should just mask out all the branches (https://github.com/tummychow/git-absorb/blob/6b7cb2fba3e68527af5072cb8f8561ae773d2d08/src/stack.rs#L52). the limit on max stack size would still apply so it wouldn't do anything too silly
I don't know what "mask out all the branches" means. Should I make a pull request with just this one check removed, or would I have to read more of the code to learn how branch masking works?
I don't know what "mask out all the branches" means.
when i say "mask out all the branches", i mean this https://github.com/tummychow/git-absorb/blob/6b7cb2fba3e68527af5072cb8f8561ae773d2d08/src/stack.rs#L53 we hide all the non-HEAD branches from the revwalk so that we don't accidentally absorb a commit that's shared with some other branch. if HEAD is detached then we should hide all the branches period. (which might already be the existing behavior, i'm not sure what head.name()
will return when it's detached. might just be the literal string HEAD
. if so, then yes you can just remove that check and it'll work)
Sometimes I want to use
git absorb
when HEAD is detached, for example during an interactive rebase, when I've checked out an old commit, or during a bisect. In this case, I want to absorb a feature-branch commit into previous commits, usinggit checkout --soft HEAD~; git absorb
. However, git-absorb refuses to run when HEAD is detached:https://github.com/tummychow/git-absorb/blob/6b7cb2fba3e68527af5072cb8f8561ae773d2d08/src/stack.rs#L27-L29
I ended up building
git absorb
locally with the check removed, installing usingcargo install --path .
, and running it during an interactive rebase. It actually worked fine, though I had to specifygit absorb --base dev
. If I didn't specify the base, I instead got:Is it possible to remove the branch check upstream?