listCommits returns almost all commits when doing a simple force push
See original GitHub issueImagine this situation:
- Remote master branch:
A<--B<--C<--D<--E<--F<--G<--H<--I<--J
- Local master branch:
A<--B<--C<--D<--E<--F<--G<--H<--I<--J'
Both remote and local share the same history of commits from A
to I
but commit J'
is a rewrite of commit J
. If I try to force push J'
to my remote, the listCommits()
function seems to list all the commits.
- Is it normal?
- In
git push
situations, don’t we need a shorter list of commits? (maybe the list until a common parent) - In
git push
situations, thelistObjects
will get the list all commits as function arg and walk them all. On my project (~1800 commits), it can last more than one minute.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Force Push in Git - Everything You Need to Know | Tower Blog
In this article, we will answer all the most popular questions surrounding the powerful Force Push command.
Read more >Lost all commits when forced push in github - Stack Overflow
This will show you everything including dangling commits because it does not traverse commits by branch/ancestry - it traverses commits by date ...
Read more >git push --force and how to deal with it - Evil Martians
What to do if you have accidentally force pushed to the wrong git branch: a step by step tutorial.
Read more >Git Refs: What You Need to Know | Atlassian Git Tutorial
Git is all about commits: you stage commits, create commits, view old commits, and transfer commits between repositories using many different Git commands....
Read more >git-push Documentation - Git
The refs/tags/* namespace will accept any kind of object (as commits, ... Note that --force applies to all the refs that are pushed,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@wmhilton Sorry for the delay. I just tested and it seems faster that before.
Should we reuse
findMergeBase
?