Review Request 109653: Display long branch names correctly (git plugin)
Andreas Pakulat
apaku at gmx.de
Fri Mar 22 11:45:45 UTC 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109653/#review29699
-----------------------------------------------------------
I think this change is not quite correct. There's a similar error further down. In both cases what Aleix probably wanted is out.left() and not out.right. The change further down seems to try to remove the "* " that denotes the currently active branch by removing the two characters.
This particular one, according to the history, comes from a failed attempt to support branches with slashes. If I understand the original code that was applied to the result of "git branch -a":
- QString out = job->output();
- int slashPos = out.lastIndexOf('/')+1;
- kDebug() << "Getting branch list" << out.mid(slashPos, out.size()-slashPos).trimmed();
- return out.mid(slashPos, out.size()-slashPos).trimmed();
It simply tried to remove the remote name from the output. So even if Aleix would've correctly use left instead of right, cutting an arbitrary number of characters is never going to be correct. The right fix would be to adjust the above original code to fetch the names of all remotes and remove those from the beginning of the branch names.
- Andreas Pakulat
On March 22, 2013, 10:06 a.m., Alexander Mezin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109653/
> -----------------------------------------------------------
>
> (Updated March 22, 2013, 10:06 a.m.)
>
>
> Review request for KDevelop and Aleix Pol Gonzalez.
>
>
> Description
> -------
>
> Git plugin did strange things with current branch name.
> I had a branch with long name, and KDevelop displayed only 2 last chars.
>
>
> Diffs
> -----
>
> plugins/git/gitplugin.cpp c873081
>
> Diff: http://git.reviewboard.kde.org/r/109653/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alexander Mezin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20130322/c613996e/attachment.html>
More information about the KDevelop-devel
mailing list