Bug? Branch names not getting selected properly

5 views
Skip to first unread message

Karthik Manamcheri

unread,
May 21, 2012, 2:30:14 PM5/21/12
to git-...@googlegroups.com
Let me explain the bug (?) with an example:

I go to "Actions->Pull". In the dialog box which opens, I have my remote branches listed. When I click on one of the branch names in the list, it doesn't update the name correctly in the text box field. For example, I have a remote branch named blah/foo/test. When I click on it, the text field gets updated only with "test". It clips off the "blah/foo". This gets annoying as every time, I push or pull or do any action with remote branches, I have to type in the entire name.

Is this a bug ? Or am i missing something ?

David Aguilar

unread,
May 21, 2012, 3:24:49 PM5/21/12
to Karthik Manamcheri, git-...@googlegroups.com
I think this is a bug. It's probably an over-zealous basename() in there.

It works for simple things like "origin/master" where it gets stripped
down to just "master". This needs to be fixed.
--
David

Karthik Manamcheri

unread,
May 21, 2012, 4:29:05 PM5/21/12
to David Aguilar, git-...@googlegroups.com
I found the bug and fixed it. Should I submit a patch somewhere ? or can I just push the commit to the master branch ?

- Karthik
--
Karthik Manamcheri
Software R&D Instrument Control Products | National Instruments

Karthik Manamcheri

unread,
May 21, 2012, 4:39:57 PM5/21/12
to David Aguilar, git-...@googlegroups.com
Here's the patch.
basename_fix.patch

David Aguilar

unread,
May 21, 2012, 5:42:12 PM5/21/12
to Karthik Manamcheri, git-...@googlegroups.com
On Mon, May 21, 2012 at 1:39 PM, Karthik Manamcheri
<mailkar...@gmail.com> wrote:
> Here's the patch.


Thanks Karthik

I was in meetings so I hadn't seen your email until now. We were
probably both working towards a similar solution.

Take a look at what I pushed out -- it should it. I did it a little
differently then what was in your patch -- I added a new function
instead of changing the behavior of utils.basename(). The reason is
that utils.basename() is used in other places where its behavior
should remain unchanged.
--
David

Karthik Manamcheri

unread,
May 21, 2012, 5:51:04 PM5/21/12
to David Aguilar, git-...@googlegroups.com
With your current function, if the path doesn't have a '/', it can't access the index 1. So you should just return path.split('/',1)[-1] instead of [1].

David Aguilar

unread,
May 21, 2012, 6:03:44 PM5/21/12
to Karthik Manamcheri, git-...@googlegroups.com
On Mon, May 21, 2012 at 2:51 PM, Karthik Manamcheri
<mailkar...@gmail.com> wrote:
> With your current function, if the path doesn't have a '/', it can't access
> the index 1. So you should just return path.split('/',1)[-1] instead of [1].

Correct. Thanks. That's much better.

I applied your fix, added more doctests, and told git that you were the author.
--
David
Reply all
Reply to author
Forward
0 new messages