question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

listCommits returns almost all commits when doing a simple force push

See original GitHub issue

Imagine 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.

  1. Is it normal?
  2. In git push situations, don’t we need a shorter list of commits? (maybe the list until a common parent)
  3. In git push situations, the listObjects 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:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hsablonnierecommented, Oct 12, 2018

@wmhilton Sorry for the delay. I just tested and it seems faster that before.

1reaction
hsablonnierecommented, Sep 28, 2018

Should we reuse findMergeBase?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found