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

preview prints debug info & poorly formatted branch details #20

Closed bedge closed 10 years ago

bedge commented 10 years ago

%> git-sweep preview Fetching from the remote len(["4897cbaf0adce62d5867b1d3ed81056d67298efe\t\tbranch 'develop' of git:client/iOS\n", "88b834aa286fe83b58aadaeabb5dbf6668a05de7\tnot-for-merge\tbranch 'katana' of git:client/iOS\n", "f11733b73ef6eb4a0186f9ed78df8877b7cf0eaf\tnot-for-merge\tbranch 'master' of git:client/iOS\n"]) != len(['X11 forwarding request failed on channel 0', '', ' = [up to date] develop -> origin/develop', ' = [up to date] katana -> origin/katana', ' = [up to date] master -> origin/master'])

This is using a git-flow configured repo.

Not sure what's relevant here, but here's my pip details

%> pip freeze Fabric==1.5.3 GitPython==0.3.2.RC1 PyYAML==3.10 argcomplete==0.6.3 async==0.6.1 beautifulscraper==1.0.2 beautifulsoup4==4.1.3 boto==2.9.7 cram==0.6 demjson==1.6 docbook2epub==1.0.1dev docutils==0.10 dumptruck==0.1.0 epubtools==1.0.0dev git-sweep==0.1.1 gitdb==0.5.4 httplib2==0.7.7 ipython==0.13.1 kaptan==0.5.7 logilab-astng==0.24.1 logilab-common==0.59.0 lxml==2.3 mercurial==2.9 paramiko==1.9.0 pycrypto==2.6 pygraphviz==1.1 pylint==0.26.0 pysqlite==2.6.3 python-qt==0.50 readline==6.2.0 scraperwiki==0.2.0 simplejson==3.3.0 smmap==0.8.2 ssh==1.8.0 swampy==2.1.1 tmuxp==0.0.44 urlnorm==1.1.2 vboxapi==1.0 wsgiref==0.1.2

robmadole commented 10 years ago

I reformatted this so it was a little easier to see what is going on:

len([
  "4897cbaf0adce62d5867b1d3ed81056d67298efe\t\tbranch 'develop' of git:client/iOS\n",
  "88b834aa286fe83b58aadaeabb5dbf6668a05de7\tnot-for-merge\tbranch 'katana' of git:client/iOS\n",
  "f11733b73ef6eb4a0186f9ed78df8877b7cf0eaf\tnot-for-merge\tbranch 'master' of git:client/iOS\n"])
!=
len([
  'X11 forwarding request failed on channel 0',
  '',
  ' = [up to date] develop -> origin/develop',
  ' = [up to date] katana -> origin/katana',
  ' = [up to date] master -> origin/master']
)

I think this may be related to SSH and X11 forwarding. git-sweep uses a Python library that basically calls the main git command. It's expecting to get back answers for just those three branches but instead gets the extra information about X11 not forwarding.

Would you be willing to try the voted solution here and tell me if that makes any difference?

http://stackoverflow.com/questions/6316978/git-push-whines-about-untrusted-x11-forwarding-setup-failed

bedge commented 10 years ago

I tried re-installing to check this and today pip is failing:

%> pip install gitsweep Downloading/unpacking gitsweep Could not find any downloads that satisfy the requirement gitsweep Cleaning up... No distributions at all found for gitsweep Storing complete log in /Users/bedge/.pip/pip.log

From the log: Getting page https://pypi.python.org/simple/gitsweep/ Could not fetch URL https://pypi.python.org/simple/gitsweep/: HTTP Error 404: Not Found

robmadole commented 10 years ago

@bedge try pip install git-sweep

bedge commented 10 years ago

Doh!, that's what I get for reading emails before coffee.

Works now. All I did was 'unset DISPLAY'

thanks the the ptr on the X11 interference.

-Bruce

On Mon, Feb 10, 2014 at 8:25 AM, Rob Madole notifications@github.comwrote:

@bedge https://github.com/bedge try pip install git-sweep

Reply to this email directly or view it on GitHubhttps://github.com/arc90/git-sweep/issues/20#issuecomment-34650619 .

bedge commented 10 years ago

Here's proof of the DISPLAY env issue above:

%> git-sweep preview Fetching from the remote len(["4897cbaf0adce62d5867b1d3ed81056d67298efe\t\tbranch 'develop' of git:client/iOS\n", "88b834aa286fe83b58aadaeabb5dbf6668a05de7\tnot-for-merge\tbranch 'katana' of git:client/iOS\n", "f11733b73ef6eb4a0186f9ed78df8877b7cf0eaf\tnot-for-merge\tbranch 'master' of git:client/iOS\n"]) != len(['X11 forwarding request failed on channel 0', '', ' = [up to date] develop -> origin/develop', ' = [up to date] katana -> origin/katana', ' = [up to date] master -> origin/master'])

%> unset DISPLAY

%> git-sweep preview Fetching from the remote These branches have been merged into master:

katana

To delete them, run again with git-sweep cleanup

robmadole commented 10 years ago

Ah very interesting. Cool, thanks @bedge for sharing the solution back!