fboender / multi-git-status

Show uncommitted, untracked and unpushed changes for multiple Git repos
MIT License
470 stars 73 forks source link

Prints `Needs push` while actually needs pull #1

Closed askhat closed 7 years ago

askhat commented 7 years ago

For repositories that need to update with upstream and don't have any changes in working copy, program show status Needs push, while actually it should be Needs pull.

For example:

screen shot 2016-12-09 at 22 48 08

Obviously I'm not that cool to write ruby core, I just keep it for reference and contemplation.

fboender commented 7 years ago

Thanks for the bugreport Askhat!

Can you try the latest master branch? I've committed a change that should fix this.

With kind regards

Ferry

askhat commented 7 years ago

Well, fix did not exactly resolve the issue. Now if repository needs to be pulled, program shows status ok. I assume repos needs fetch before merge-base. Unfortunately, it could take too much time for each repo. So I'd suggest you either refuse this functionality or provide some special option which will preform fetch.

askhat commented 7 years ago

Perhaps I should elaborate: At first, after you introduced changes, I pulled your repository, and program showed status ok for repos which actually needed pull. I manually performed fetch in those directories, then program showed Needs pull as expected.

fboender commented 7 years ago

That was the intended function of the new code I committed. It's unfortunate that there are so many different states a repository can be in, and there are even more ways of trying to figure out which exact state it's in. I also need any inspection of a repo to be fast, since I usually need to get the status of a few dozen repos.

I'm going to keep the changes I made, as I feel they are an improvement, even if they're not perfect ;-)

Thank you for your report and feedback!

fboender commented 7 years ago

I'm currently trying to see if I can get some more 'Needs pull' checks in place.

fboender commented 7 years ago

multi-git-status now also takes in account remote tracking branches when considering pull or pushes are needed. It still doesn't contact the remote repo though.