{"thread":{"id":"8087","subject":"[PATCH] Allow fetching references from any namespace","startedAt":"2007-05-11T20:35:22Z","lastAt":"2007-05-13T07:24:09Z","messageCount":6,"participants":["Alex Riesen","Junio C Hamano","Marco Costalba","Jan Hudec"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"41856","messageId":"20070511203522.GA2741@steel.home","threadId":"8087","inReplyTo":null,"subject":"[PATCH] Allow fetching references from any namespace","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-05-11T20:35:22Z","receivedAt":"2007-05-11T20:35:22Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"not only from the three defined: heads, tags and remotes.\n\nNoticed when I tried to fetch the references created by git-p4-import.bat:\nthey are placed into separate namespace (refs/p4import/, to avoid showing\nthem in git-branch output). As canon_refs_list_for_fetch always prepended\nrefs/heads/ it was impossible, and annoying: it worked before. Normally,\nthe p4import references are useless anywhere but in the directory managed\nby perforce, but in this special case the cloned directory was supposed\nto be a backup, including the p4import branch: it keeps information about\nwhere the imported perforce state came from.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n git-parse-remote.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 437b0c3..0506b12 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -143,13 +143,13 @@ canon_refs_list_for_fetch () {\n \t\tfi\n \t\tcase \"$remote\" in\n \t\t'' | HEAD ) remote=HEAD ;;\n-\t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n+\t\trefs/*) ;;\n \t\theads/* | tags/* | remotes/* ) remote=\"refs/$remote\" ;;\n \t\t*) remote=\"refs/heads/$remote\" ;;\n \t\tesac\n \t\tcase \"$local\" in\n \t\t'') local= ;;\n-\t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n+\t\trefs/*) ;;\n \t\theads/* | tags/* | remotes/* ) local=\"refs/$local\" ;;\n \t\t*) local=\"refs/heads/$local\" ;;\n \t\tesac\n-- \n1.5.2.rc3.17.ge713\n"},{"id":"41860","messageId":"7vlkfv9j3c.fsf@assigned-by-dhcp.cox.net","threadId":"8087","inReplyTo":"20070511203522.GA2741@steel.home","subject":"Re: [PATCH] Allow fetching references from any namespace","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-11T20:54:47Z","receivedAt":"2007-05-11T20:54:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> not only from the three defined: heads, tags and remotes.\n>\n> Noticed when I tried to fetch the references created by git-p4-import.bat:\n> they are placed into separate namespace (refs/p4import/, to avoid showing\n> them in git-branch output). As canon_refs_list_for_fetch always prepended\n> refs/heads/ it was impossible, and annoying: it worked before. Normally,\n> the p4import references are useless anywhere but in the directory managed\n> by perforce, but in this special case the cloned directory was supposed\n> to be a backup, including the p4import branch: it keeps information about\n> where the imported perforce state came from.\n\nHave no objection to the patch itself, but mind pointing out\nwhere we broke it (I suspect it is around 1.5.0)?\n"},{"id":"41901","messageId":"20070512074049.GA2410@steel.home","threadId":"8087","inReplyTo":"7vlkfv9j3c.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Allow fetching references from any namespace","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-05-12T07:40:49Z","receivedAt":"2007-05-12T07:40:49Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Junio C Hamano, Fri, May 11, 2007 22:54:47 +0200:\n> Alex Riesen <raa.lkml@gmail.com> writes:\n> \n> > not only from the three defined: heads, tags and remotes.\n> >\n> > Noticed when I tried to fetch the references created by git-p4-import.bat:\n> > they are placed into separate namespace (refs/p4import/, to avoid showing\n> > them in git-branch output). As canon_refs_list_for_fetch always prepended\n> > refs/heads/ it was impossible, and annoying: it worked before. Normally,\n> > the p4import references are useless anywhere but in the directory managed\n> > by perforce, but in this special case the cloned directory was supposed\n> > to be a backup, including the p4import branch: it keeps information about\n> > where the imported perforce state came from.\n> \n> Have no objection to the patch itself, but mind pointing out\n> where we broke it (I suspect it is around 1.5.0)?\n> \n\nMaybe even much earlier. According to\n\n    git log -p --decorate -- git-fetch-script git-parse-remote-script\n\n    commit ac4b0cff00b7629657e61a1d6e1f1a1250d03198\n    Author: Junio C Hamano <junkio@cox.net>\n    Date:   Sat Aug 20 02:52:24 2005 -0700\n\n\t[PATCH] Start adding the $GIT_DIR/remotes/ support.\n\n    +canon_refs_list_for_fetch () {\n    +       for ref\n    +       do\n    +               expr \"$ref\" : '.*:' >/dev/null || ref=\"${ref}:\"\n    +               remote=$(expr \"$ref\" : '\\([^:]*\\):')\n    +               local=$(expr \"$ref\" : '[^:]*:\\(.*\\)')\n    +               case \"$remote\" in\n    +               '') remote=HEAD ;;\n    +               *) remote=\"refs/heads/$remote\" ;;\n    +               esac\n    +               case \"$local\" in\n    +               '') local= ;;\n    +               *) local=\"refs/heads/$local\" ;;\n    +               esac\n    +               echo \"${remote}:${local}\"\n    +       done\n    +}\n\nit was this way since at least Aug 2005.\n"},{"id":"41903","messageId":"7vveey4gt0.fsf@assigned-by-dhcp.cox.net","threadId":"8087","inReplyTo":"20070512074049.GA2410@steel.home","subject":"Re: [PATCH] Allow fetching references from any namespace","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-12T07:55:23Z","receivedAt":"2007-05-12T07:55:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Junio C Hamano, Fri, May 11, 2007 22:54:47 +0200:\n>> Alex Riesen <raa.lkml@gmail.com> writes:\n>> \n>> > not only from the three defined: heads, tags and remotes.\n>> >\n>> > Noticed when I tried to fetch the references created by git-p4-import.bat:\n>> > they are placed into separate namespace (refs/p4import/, to avoid showing\n>> > them in git-branch output). As canon_refs_list_for_fetch always prepended\n>> > refs/heads/ it was impossible, and annoying: it worked before. Normally,\n>> > the p4import references are useless anywhere but in the directory managed\n>> > by perforce, but in this special case the cloned directory was supposed\n>> > to be a backup, including the p4import branch: it keeps information about\n>> > where the imported perforce state came from.\n>> \n>> Have no objection to the patch itself, but mind pointing out\n>> where we broke it (I suspect it is around 1.5.0)?\n>> \n>\n> Maybe even much earlier. According to\n>\n>     git log -p --decorate -- git-fetch-script git-parse-remote-script\n>\n>     commit ac4b0cff00b7629657e61a1d6e1f1a1250d03198\n>     Author: Junio C Hamano <junkio@cox.net>\n>     Date:   Sat Aug 20 02:52:24 2005 -0700\n>\n> \t[PATCH] Start adding the $GIT_DIR/remotes/ support.\n\nSounds like it is not even a regression but just was not\nsupposed to work from the beginning.\n\nNot that I think lifting that restriction is a bad idea,\nthough.\n"},{"id":"41997","messageId":"e5bfff550705122048s6772db3as63f6fb23fe7e1bd7@mail.gmail.com","threadId":"8087","inReplyTo":"7vveey4gt0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Allow fetching references from any namespace","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-05-13T03:48:00Z","receivedAt":"2007-05-13T03:48:00Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On 5/12/07, Junio C Hamano <junkio@cox.net> wrote:\n>\n> Sounds like it is not even a regression but just was not\n> supposed to work from the beginning.\n>\n> Not that I think lifting that restriction is a bad idea,\n> though.\n>\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n\nPlease consider that StGIT put patch names under refs/patches and\nprobably we don't want to see them.\n\nI'm very sorry but I cannot test my-self because I'm leaving now. I\nhave just seen the patch applied in git tree and this thing come to my\nmind.\n\n\n Marco\n"},{"id":"42000","messageId":"20070513072409.GD8983@efreet.light.src","threadId":"8087","inReplyTo":"e5bfff550705122048s6772db3as63f6fb23fe7e1bd7@mail.gmail.com","subject":"Re: [PATCH] Allow fetching references from any namespace","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-05-13T07:24:09Z","receivedAt":"2007-05-13T07:24:09Z","isPatch":true,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Sun, May 13, 2007 at 05:48:00 +0200, Marco Costalba wrote:\n> On 5/12/07, Junio C Hamano <junkio@cox.net> wrote:\n> >\n> >Sounds like it is not even a regression but just was not\n> >supposed to work from the beginning.\n> >\n> >Not that I think lifting that restriction is a bad idea,\n> >though.\n> >\n> >-\n> >To unsubscribe from this list: send the line \"unsubscribe git\" in\n> >the body of a message to majordomo@vger.kernel.org\n> >More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> >\n> \n> Please consider that StGIT put patch names under refs/patches and\n> probably we don't want to see them.\n\nIf you don't add them to the push configuration, you won't see them.\n\n> I'm very sorry but I cannot test my-self because I'm leaving now. I\n> have just seen the patch applied in git tree and this thing come to my\n> mind.\n\nIt does not make them pushed. It just allows pushing them--which is good\nthing sometimes (eg. if you use push to backup the repo).\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}