On Thu, Apr 14, 2016 at 12:31:41AM +0530, Karthik Nayak wrote: > On Wed, Apr 13, 2016 at 8:42 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > >>> Having said that, doesn't this need to be further adjusted for > >>> 95c38fb0 (branch: fix shortening of non-remote symrefs, 2016-04-03)? > >>> > >>> http://thread.gmane.org/gmane.comp.version-control.git/290622/focus=290624 > >>> > >> > >> That was one of the changes made in this version of the patch series :) > > > > But with this patch applied, it seems that the tests in Peff's fix > > does not seem to pass. > > If I understand correctly, "fix shortening" stops doing your > > symref:short (which is to > > shorten the usual "drop refs/heads, refs/remotes, etc.") and makes the > > shortening > > conditional. The target of a symref that is found in refs/heads/ gets > > refs/heads and > > nothing else stripped. > > Having a look here, WRT to the patch v4 it seems the problem is that > patch v4 doesn't support v2.6.x behavior, namely that cross-prefix symrefs will > not be shortened at all. As per the format given in the last patch > [16/16] it shortens > the symref irrespective of being cross-prefix symrefs. > > Would it be a good idea to enforce this as in v2.6.x or change it as > to allow shortening > of cross-prefix symrefs. The cross-prefix behavior I put into the test is not something I feel strongly about; it was mostly just restoring the earlier behavior. I do think shortening everything is fine, too, as long as there's some way to get the fully qualified ref. E.g., if `git branch` shows %(symref:short) or %(symref:strip=2), by default, but you can ask for just %(symref) if you want (which I think is how you have it implemented now, though I notice that symrefs don't get nearly as many formatting options as things like %(upstream)). If anyone is machine-parsing git-branch output in the first place, they are Doing It Wrong. And doubly so if they are relying on some obscure shortening rules that I don't think were ever carefully designed. So I think we should be free to change it here to what serves users best. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html