arc90 / git-sweep

A command-line tool that helps you clean up Git branches that have been merged into master.
MIT License
2.55k stars 125 forks source link

Unclear Failure #8

Open loe opened 12 years ago

loe commented 12 years ago

I have tried git-sweep on a few of my larger repositories and I get an error but I'm not sure how to progress.

I see: $ git sweep preview Fetching from remote len([huge array of stuff]) != len([another huge array])

and exit status is 1.

robmadole commented 12 years ago

If you run git-sweep preview --nofetch do you still get an error?

Also, what about just running git fetch? Does that do anything strange?

Is your remote called "origin" or something else?

loe commented 12 years ago

Running git sweep preview --nofetch seems to just spin my fan. Its been running for a few minutes now with no output.

git fetch doesn't output anything exits 0.

loe commented 12 years ago

Traceback (most recent call last): File "/usr/local/share/python/git-sweep", line 9, in <module> load_entry_point('git-sweep==0.1.1', 'console_scripts', 'git-sweep')() File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitsweep/entrypoints.py", line 9, in main CommandLine(sys.argv).run() File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitsweep/cli.py", line 89, in run self._sweep() File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitsweep/cli.py", line 126, in _sweep ok_to_delete = inspector.merged_refs(skip=skips) File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gitsweep/inspector.py", line 37, in merged_refs with_extended_output=True, with_exceptions=False) File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/git/cmd.py", line 346, in execute stdout_value, stderr_value = proc.communicate() File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 751, in communicate return self._communicate(input) File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1291, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1345, in _communicate_with_poll ready = poller.poll() File "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/async/__init__.py", line 21, in thread_interrupt_handler prev_handler(signum, frame) KeyboardInterrupt

Thats the output on Ctrl+C

robmadole commented 12 years ago

Looks like the Git library we use is just spinning on the commands to find the merge branches. How many branches do you have? Is it an un-holy amount?

loe commented 12 years ago

991, 649, 364 on the different applications (on remote) I have fewer locally because I haven't touched every bug.

robmadole commented 12 years ago

So that's 3 repositories? repo1 has 991, repo2 has 649, and repo3 has 364?

That's quite a few. It will launch a sub-process for each remote branch and run a git command (so it's doing that 991 times for repo1). I think we are just seeing the compound effects of that. I'm sorry to say that I don't have a quick fix for this, but I'll give it some thought. Maybe run in batches or to at least have a progress bar to let you know it's working on something.

Since it was spinning up your fan, do you think it was pegging your CPU? (no need to check it again, just curious)

loe commented 12 years ago

Git did go to 100% CPU then die and I think python was hung in I/O wait.

taybin commented 12 years ago

I have this issue too. We have 450 branches. --nofetch prevents the len() != len() problem.

It still takes awhile, but that's fine.

loe commented 12 years ago

--nofetch is working for us now, just cleaned out a couple hundred!

robmadole commented 12 years ago

Cool, sounds like this is less urgent but still a problem. Thanks for letting me know. It's on the list for the next release.

mwarkentin commented 12 years ago

This happened for one of our repos as well.. trying it with --nofetch now.