-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
having trouble restacking when updating a commit at the bottom of a stack #1391
Comments
|
do you think a precommit script could be causing this? The only thing that makes me doubt that is that this was working before and I still had the same precommit script.
although when I did the commands one by one I noticed it duplicated the commit right when i ran |
how can I do that, is it sufficient to rerun git branchless init
Yes I think so, but it may interfere with other hooks you have installed. I can’t remember how it works, sorry. I can say, though, that looking at the output of your bug report, it looks like you may not have any of the relevant hooks in place. (They all report “not found”.) That would explain this behavior
So yes I would either run init again, or perhaps do so in a new repo and compare them hooks there to what you have in this repo, updating accordingly.
do you think a precommit script could be causing this? The only thing that makes me doubt that is that this was working before and I still had the same precommit script.
Probably not. As I recall, branchless only uses the post commit hook, not pre commit.
|
btw if i use
how can git amend replace also when i try the reparent flag it doesn't do anything:
actually i'm really confused about git amend how come it's not amending the commit that i have checked out as HEAD here? ~/Projects/web-next/services/consumer-web-next NVG-984_finishing_placement_model* 8s
» g s
On branch NVG-984_finishing_placement_model
Your branch is up to date with 'origin/NVG-984_finishing_placement_model'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: src/CxComponentCatalog/AdsAndPromos/USI/PlacementModel/PlacementModel.tsx
~/Projects/web-next/services/consumer-web-next NVG-984_finishing_placement_model*
» g amend
> git rev-parse --show-toplevel
> git log --format=medium --no-color origin/NVG-984_finishing_placement_model..HEAD
No commits to amend
~/Projects/web-next/services/consumer-web-next NVG-984_finishing_placement_model*
» g l
* a81501915d0 2 weeks ago Hakan Alpay (HEAD -> NVG-984_finishing_placement_model, origin/NVG-984_finishing_placement_model) NVG-984_finishing_placement_model
* 0415a0dfdd7 2 days ago Hakan Alpay (origin/NVG-1022_USI_create_terms_and_conditions_modal_catalog_component, NVG-1022_USI_create_terms_and_conditions_modal_catalog_component) NVG-1022 [USI] Create Terms and Conditions Modal Catalog Component
* 8c319f63a43 13 hours ago Danny Fann (tag: dev-console-email-service_3.361.0, origin/release/dev-console-email-service_3.361.x, origin/publish/8c319f63a4367fcc2a4de3ea6817c7e18df989ff, origin/master, origin/invoice2go_v1_main, origin/i18n_-AsyncTrans-1725629407738, origin/HEAD, master) Temporarily disable email send while looking into PR reviews (#22918)
* d8712f8dd39 16 hours ago James Maher (tag: consumer-web-next_2.3638.0, tag: consumer-web-next-e2e_2.1046.0, origin/release/consumer-web-next_2.3638.x, origin/release/consumer-web-next-e2e_2.1046.x, origin/publish/d8712f8dd39de781fccf05fdc0b65e0193107311) patch: temporarily pause CWN merge queue (#22920)
* eeaace48dea 17 hours ago web-next-automation (origin/publish/82c3ee24079341b74dd1a0628ae1104085f44539) Bump versions [skip ci]
* 8a464844641 17 hours ago web-next-automation Update changelogs [skip ci]
* 82c3ee24079 17 hours ago Jon Collette App developer admin parity update (#22852)
* adbc74af42a 17 hours ago web-next-automation (origin/publish/faeeb48c41fdbd70e3b9a9e0fbb9135aa1a84653) Bump versions [skip ci]
* 38ab8ae5656 17 hours ago web-next-automation Update changelogs [skip ci]
* faeeb48c41f 17 hours ago chrisguan Add strings to i18n (#22726) |
Probably not, but it depends on context. Take a look at https://github.com/arxanas/git-branchless/wiki/Command:-git-amend#forcibly-amending-without-changing-children for more info about So, I guess:
For me, this is the killer feature of
Basically, it's
The error message isn't coming from
I suspect that this is the above issue, with |
I'm guessing it's the same issue of not having hooks installed as in #1390. Reopen if not. |
Yeah the issue was that hooks weren't installed but it's weird because I have run git branchless init before
here's me running it again
running this helped for sure cuz now i have:
and now git sync -p --merge works perfectly but i guess the main question is what did i do that caused git branchless init to be undone cuz i dont think ive run git branchless uninstall or anything. so i’ll try to pay attention to when it breaks again and backtrack when that happens |
|
no worktrees i might have figured out whats happening. doordash web-next uses rush for package management, and i think after rush install and/or other rush operations it rewrites the pre-commit and pre-push git hooks with ones that my company wrote for this repo for running prettier precommit and stuff not entirely sure what to do considering i can’t modify the pre-commit or pre-push bash scripts since they are not gitignored or anything and i need to run rush install and rush update and stuff i tried adding git branchless init in the beginning of my macros that use git branchless my super super super messy .gitconfig:
claude suggested a script to monitor and fix hooks that would have to be run periodically somehow
claude also suggested this:
but i would have to find a way to never check this in to version control somehow considering the common/git-hooks/* is all not gitignored |
it also suggested wrapping the rush command with something: Create a post-rush-install hook:
Create an alias for rush commands:
Or create a wrapper script:
curious what do you think the best solution would be here |
ok yeah rush install deletes all of the git branchless hooks |
Perhaps this should be treated as a bug in rush? It seems weird that it would throw away the entire hooks directory on |
they said they set git hooks hermetically i decided to wrap
I put it in my ~/dotfiles/spells which is in my path, and my ~/dotfiles/zsh/.zshrc (which is stowed to ~/.zshrc has alias rush='rush-with-branchless-hooks' |
Description of the bug
https://pastebin.com/Wb3A0P0U
so it looks like removing update-refs fixed git sync, but still when i commit to a commit in the bottom of a stack, it doesn't seem to let me restack
my commit and push command is
g a
aliased toa = "!f() { git add --all && git commit --amend --no-edit && git restack && git submit; }; f"
is there something wrong with this
Expected behavior
the commit to not be duplicated
Actual behavior
the commit gets duplicated and the stack becomes outdated
Version of
rustc
rustc 1.78.0 (9b00956e5 2024-04-29)
Automated bug report
Software version
git-branchless 0.9.0
Operating system
macOS 14.6.1 (Darwin 23.6.0)
Command-line
Environment variables
Git version
Hooks
Show 7 hooks
Hook
post-applypatch
Hook
post-checkout
Hook
post-commit
Hook
post-merge
Hook
post-rewrite
Hook
pre-auto-gc
Hook
reference-transaction
Events
Show 5 events
Event ID: 22790, transaction ID: 11377 (message: prev)
WorkingCopySnapshot { timestamp: 1725472937.510231, event_tx_id: Id(11377), head_oid: 7c8016d6115b7097ce9349e3f966b28aea408eff, commit_oid: NonZeroOid(5f246a113ba8cc676594bc2089c889160bf625ca), ref_name: Some(ReferenceName("refs/heads/redacted-ref-0")) }
Event ID: 22784, transaction ID: 11376 (message: sync)
WorkingCopySnapshot { timestamp: 1725472932.818385, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
WorkingCopySnapshot { timestamp: 1725472933.087694, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
WorkingCopySnapshot { timestamp: 1725472933.314692, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
WorkingCopySnapshot { timestamp: 1725472933.543282, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
WorkingCopySnapshot { timestamp: 1725472933.779001, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
WorkingCopySnapshot { timestamp: 1725472934.013454, event_tx_id: Id(11376), head_oid: 3e882e79b0d79678fa34eb42a22891163e86e944, commit_oid: NonZeroOid(55d460a2fa3699e081e5a0411383bc57e1beccb7), ref_name: None }
Event ID: 22783, transaction ID: 11370 (message: prev)
WorkingCopySnapshot { timestamp: 1725472900.30404, event_tx_id: Id(11370), head_oid: d81fe052e6129b28e7d66e482b39ad2e545fc2ad, commit_oid: NonZeroOid(a792cd0e665f3b823477f8553bc1e134a8541857), ref_name: Some(ReferenceName("refs/heads/redacted-ref-0")) }
Event ID: 22782, transaction ID: 11365 (message: next)
WorkingCopySnapshot { timestamp: 1725465141.043426, event_tx_id: Id(11365), head_oid: a8d9d07e940abe48745cbcad6a8631430e1e85a7, commit_oid: NonZeroOid(7ae90a2819cb02fab3c107e4e7eaafef636533ae), ref_name: Some(ReferenceName("refs/heads/redacted-ref-7")) }
Event ID: 22781, transaction ID: 11364 (message: move)
WorkingCopySnapshot { timestamp: 1725465135.834757, event_tx_id: Id(11364), head_oid: a8d9d07e940abe48745cbcad6a8631430e1e85a7, commit_oid: NonZeroOid(e4055e7b36b6e36f291059b6888cbe65a01f22b9), ref_name: None }
Version of
git-branchless
No response
Version of
git
No response
The text was updated successfully, but these errors were encountered: