{"thread":{"id":"40284","subject":"[PATCHv1 0/2] git-p4: work on a detached head","startedAt":"2015-09-05T14:02:16Z","lastAt":"2015-10-28T19:03:03Z","messageCount":12,"participants":["Luke Diamand","Lars Schneider","Junio C Hamano","Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"269490","messageId":"1441461738-25066-1-git-send-email-luke@diamand.org","threadId":"40284","inReplyTo":null,"subject":"[PATCHv1 0/2] git-p4: work on a detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-09-05T14:02:16Z","receivedAt":"2015-09-05T14:02:16Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"git-p4 won't submit from a detached head. If you do, it gives a\ncryptic error message, and instead you have to create an endless\nseries of throw-away branches, which can get very trying.\n\nThe first patch in this series demonstrates the problem, and the\nsecond patch fixes it. I've been using it for the last few days.\n\nLuke Diamand (2):\n  git-p4: add failing test for submit from detached head\n  git-p4: work with a detached head\n\n git-p4.py               | 18 ++++++++++++------\n t/t9800-git-p4-basic.sh | 16 ++++++++++++++++\n 2 files changed, 28 insertions(+), 6 deletions(-)\n\n-- \n2.6.0.rc0.133.ga438a11.dirty\n"},{"id":"269491","messageId":"1441461738-25066-2-git-send-email-luke@diamand.org","threadId":"40284","inReplyTo":"1441461738-25066-1-git-send-email-luke@diamand.org","subject":"[PATCHv1 1/2] git-p4: add failing test for submit from detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-09-05T14:02:17Z","receivedAt":"2015-09-05T14:02:17Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"git-p4 can't submit from a detached head. This test case\ndemonstrates the problem.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n t/t9800-git-p4-basic.sh | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh\nindex 90d41ed..114b19f 100755\n--- a/t/t9800-git-p4-basic.sh\n+++ b/t/t9800-git-p4-basic.sh\n@@ -241,6 +241,22 @@ test_expect_success 'unresolvable host in P4PORT should display error' '\n \t)\n '\n \n+test_expect_failure 'submit from detached head' '\n+\ttest_when_finished cleanup_git &&\n+\tgit p4 clone --dest=\"$git\" //depot &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit checkout p4/master &&\n+\t\t>detached_head_test &&\n+\t\tgit add detached_head_test &&\n+\t\tgit commit -m \"add detached_head\" &&\n+\t\tgit config git-p4.skipSubmitEdit true &&\n+\t\tgit p4 submit &&\n+\t\tgit p4 rebase &&\n+\t\tgit log p4/master | grep detached_head\n+\t)\n+'\n+\n test_expect_success 'kill p4d' '\n \tkill_p4d\n '\n-- \n2.6.0.rc0.133.ga438a11.dirty\n"},{"id":"269492","messageId":"1441461738-25066-3-git-send-email-luke@diamand.org","threadId":"40284","inReplyTo":"1441461738-25066-1-git-send-email-luke@diamand.org","subject":"[PATCHv1 2/2] git-p4: work with a detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-09-05T14:02:18Z","receivedAt":"2015-09-05T14:02:18Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"When submitting, git-p4 finds the current branch in\norder to know if it is allowed to submit (configuration\n\"git-p4.allowSubmit\").\n\nOn a detached head, detecting the branch would fail, and\ngit-p4 would report a cryptic error.\n\nThis change teaches git-p4 to recognise a detached head and\nsubmit successfully.\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n git-p4.py               | 18 ++++++++++++------\n t/t9800-git-p4-basic.sh |  2 +-\n 2 files changed, 13 insertions(+), 7 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 2677c89..a22ae01 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1651,8 +1651,8 @@ class P4Submit(Command, P4UserMap):\n     def run(self, args):\n         if len(args) == 0:\n             self.master = currentGitBranch()\n-            if len(self.master) == 0 or not gitBranchExists(\"refs/heads/%s\" % self.master):\n-                die(\"Detecting current git branch failed!\")\n+            if self.master == \"undefined\":\n+                self.master = None\n         elif len(args) == 1:\n             self.master = args[0]\n             if not branchExists(self.master):\n@@ -1660,9 +1660,10 @@ class P4Submit(Command, P4UserMap):\n         else:\n             return False\n \n-        allowSubmit = gitConfig(\"git-p4.allowSubmit\")\n-        if len(allowSubmit) > 0 and not self.master in allowSubmit.split(\",\"):\n-            die(\"%s is not in git-p4.allowSubmit\" % self.master)\n+        if self.master:\n+            allowSubmit = gitConfig(\"git-p4.allowSubmit\")\n+            if len(allowSubmit) > 0 and not self.master in allowSubmit.split(\",\"):\n+                die(\"%s is not in git-p4.allowSubmit\" % self.master)\n \n         [upstream, settings] = findUpstreamBranchPoint()\n         self.depotPath = settings['depot-paths'][0]\n@@ -1730,7 +1731,12 @@ class P4Submit(Command, P4UserMap):\n         self.check()\n \n         commits = []\n-        for line in read_pipe_lines([\"git\", \"rev-list\", \"--no-merges\", \"%s..%s\" % (self.origin, self.master)]):\n+        if self.master:\n+            commitish = self.master\n+        else:\n+            commitish = 'HEAD'\n+\n+        for line in read_pipe_lines([\"git\", \"rev-list\", \"--no-merges\", \"%s..%s\" % (self.origin, commitish)]):\n             commits.append(line.strip())\n         commits.reverse()\n \ndiff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh\nindex 114b19f..0730f18 100755\n--- a/t/t9800-git-p4-basic.sh\n+++ b/t/t9800-git-p4-basic.sh\n@@ -241,7 +241,7 @@ test_expect_success 'unresolvable host in P4PORT should display error' '\n \t)\n '\n \n-test_expect_failure 'submit from detached head' '\n+test_expect_success 'submit from detached head' '\n \ttest_when_finished cleanup_git &&\n \tgit p4 clone --dest=\"$git\" //depot &&\n \t(\n-- \n2.6.0.rc0.133.ga438a11.dirty\n"},{"id":"269656","messageId":"6B07CAFE-6A10-481A-9D15-0DBFF6AB0B11@gmail.com","threadId":"40284","inReplyTo":"1441461738-25066-1-git-send-email-luke@diamand.org","subject":"Re: [PATCHv1 0/2] git-p4: work on a detached head","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-09-09T12:03:41Z","receivedAt":"2015-09-09T12:03:41Z","isPatch":false,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"I wanted to play with the patch and apply it to my source but the process is really complicated for me. I wonder if you can give me a few recommendations how to work efficiently with email patches. I don’t want to start a flame-war about what email client is “right\", I am just curious how you work and what clients, scripts, or tricks you use :-)\n\nUsually I use Apple Mail. I experimented with mutt but it was not dramatically more convenient.\n\nThanks,\nLars\n\nOn 05 Sep 2015, at 16:02, Luke Diamand <luke@diamand.org> wrote:\n\n> git-p4 won't submit from a detached head. If you do, it gives a\n> cryptic error message, and instead you have to create an endless\n> series of throw-away branches, which can get very trying.\n> \n> The first patch in this series demonstrates the problem, and the\n> second patch fixes it. I've been using it for the last few days.\n> \n> Luke Diamand (2):\n>  git-p4: add failing test for submit from detached head\n>  git-p4: work with a detached head\n> \n> git-p4.py               | 18 ++++++++++++------\n> t/t9800-git-p4-basic.sh | 16 ++++++++++++++++\n> 2 files changed, 28 insertions(+), 6 deletions(-)\n> \n> -- \n> 2.6.0.rc0.133.ga438a11.dirty\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"},{"id":"269670","messageId":"xmqqfv2n5khe.fsf@gitster.mtv.corp.google.com","threadId":"40284","inReplyTo":"1441461738-25066-3-git-send-email-luke@diamand.org","subject":"Re: [PATCHv1 2/2] git-p4: work with a detached head","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-09T21:52:13Z","receivedAt":"2015-09-09T21:52:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n>      def run(self, args):\n>          if len(args) == 0:\n>              self.master = currentGitBranch()\n> -            if len(self.master) == 0 or not gitBranchExists(\"refs/heads/%s\" % self.master):\n> -                die(\"Detecting current git branch failed!\")\n> +            if self.master == \"undefined\":\n> +                self.master = None\n\nThe comparison with textual \"undefined\" smelled fishy and I ended up\nlooking at the implementation of currentGitBranch().\n\n    def currentGitBranch():\n        return read_pipe(\"git name-rev HEAD\").split(\" \")[1].strip()\n\nYuck.  I know it is not entirely the fault of this patch, but\nshouldn't it be reading from\n\n    $ git symbolic-ref HEAD\n\nand catch the error \"fatal: ref HEAD is not a symbolic ref\" and use\nit as a signal to tell that the HEAD is detached?\n"},{"id":"269673","messageId":"CA+P7+xqZ+MOMN6so1AVSbQdHjuWp+48jQw8gp8cxE0CaYc8Ldw@mail.gmail.com","threadId":"40284","inReplyTo":"6B07CAFE-6A10-481A-9D15-0DBFF6AB0B11@gmail.com","subject":"Re: [PATCHv1 0/2] git-p4: work on a detached head","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-09-10T01:57:49Z","receivedAt":"2015-09-10T01:57:49Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Sep 9, 2015 at 5:03 AM, Lars Schneider <larsxschneider@gmail.com> wrote:\n> I wanted to play with the patch and apply it to my source but the process is really complicated for me. I wonder if you can give me a few recommendations how to work efficiently with email patches. I don’t want to start a flame-war about what email client is “right\", I am just curious how you work and what clients, scripts, or tricks you use :-)\n>\n> Usually I use Apple Mail. I experimented with mutt but it was not dramatically more convenient.\n>\n> Thanks,\n> Lars\n\nGenerally, any client which lets you save patches as mbox format. Then\nyou can feed the file via git-am\n\nI don't know what clients make this easy. I normally use Evolution,\nwhich has as \"save as mbox\" option. It's possible Apple Mail does too.\n\nRegards,\nJake\n"},{"id":"269674","messageId":"CA+P7+xqTGR4EfQGmOyvB=hS5YNS1hnhddFRqdjXp+DiTSbMdRQ@mail.gmail.com","threadId":"40284","inReplyTo":"CA+P7+xqZ+MOMN6so1AVSbQdHjuWp+48jQw8gp8cxE0CaYc8Ldw@mail.gmail.com","subject":"Re: [PATCHv1 0/2] git-p4: work on a detached head","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-09-10T01:59:02Z","receivedAt":"2015-09-10T01:59:02Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Sep 9, 2015 at 6:57 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n> On Wed, Sep 9, 2015 at 5:03 AM, Lars Schneider <larsxschneider@gmail.com> wrote:\n>> I wanted to play with the patch and apply it to my source but the process is really complicated for me. I wonder if you can give me a few recommendations how to work efficiently with email patches. I don’t want to start a flame-war about what email client is “right\", I am just curious how you work and what clients, scripts, or tricks you use :-)\n>>\n>> Usually I use Apple Mail. I experimented with mutt but it was not dramatically more convenient.\n>>\n>> Thanks,\n>> Lars\n>\n> Generally, any client which lets you save patches as mbox format. Then\n> you can feed the file via git-am\n>\n> I don't know what clients make this easy. I normally use Evolution,\n> which has as \"save as mbox\" option. It's possible Apple Mail does too.\n>\n> Regards,\n> Jake\n\nFor the record, you can use \"show original\" from GMail, and save that\nfile as well, I believe. I don't know about Apple Mail specifically,\nhowever.\n\nRegards,\nJake\n"},{"id":"269676","messageId":"CAE5ih7-_zhxf_daVxNB-hxFfbakMbJp9rk0vP+k46ErrJ6Qxiw@mail.gmail.com","threadId":"40284","inReplyTo":"xmqqfv2n5khe.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCHv1 2/2] git-p4: work with a detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-09-10T07:29:07Z","receivedAt":"2015-09-10T07:29:07Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 9 September 2015 at 22:52, Junio C Hamano <gitster@pobox.com> wrote:\n> Luke Diamand <luke@diamand.org> writes:\n>\n>>      def run(self, args):\n>>          if len(args) == 0:\n>>              self.master = currentGitBranch()\n>> -            if len(self.master) == 0 or not gitBranchExists(\"refs/heads/%s\" % self.master):\n>> -                die(\"Detecting current git branch failed!\")\n>> +            if self.master == \"undefined\":\n>> +                self.master = None\n>\n> The comparison with textual \"undefined\" smelled fishy and I ended up\n> looking at the implementation of currentGitBranch().\n>\n>     def currentGitBranch():\n>         return read_pipe(\"git name-rev HEAD\").split(\" \")[1].strip()\n>\n> Yuck.  I know it is not entirely the fault of this patch, but\n> shouldn't it be reading from\n>\n>     $ git symbolic-ref HEAD\n>\n> and catch the error \"fatal: ref HEAD is not a symbolic ref\" and use\n> it as a signal to tell that the HEAD is detached?\n\nThat sounds much nicer. I'll redo the patch accordingly.\n\nThanks,\nLuke\n"},{"id":"269681","messageId":"CAE5ih78sVaPQ_=v5ceTZjV+iJCQOy=R_Z_trOHYUPrEMHn5zzQ@mail.gmail.com","threadId":"40284","inReplyTo":"CA+P7+xqTGR4EfQGmOyvB=hS5YNS1hnhddFRqdjXp+DiTSbMdRQ@mail.gmail.com","subject":"Re: [PATCHv1 0/2] git-p4: work on a detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-09-10T12:23:58Z","receivedAt":"2015-09-10T12:23:58Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 10 September 2015 at 02:59, Jacob Keller <jacob.keller@gmail.com> wrote:\n> On Wed, Sep 9, 2015 at 6:57 PM, Jacob Keller <jacob.keller@gmail.com> wrote:\n>> On Wed, Sep 9, 2015 at 5:03 AM, Lars Schneider <larsxschneider@gmail.com> wrote:\n>>> I wanted to play with the patch and apply it to my source but the process is really complicated for me. I wonder if you can give me a few recommendations how to work efficiently with email patches. I don’t want to start a flame-war about what email client is “right\", I am just curious how you work and what clients, scripts, or tricks you use :-)\n>>>\n>>> Usually I use Apple Mail. I experimented with mutt but it was not dramatically more convenient.\n>>>\n>>> Thanks,\n>>> Lars\n>>\n>> Generally, any client which lets you save patches as mbox format. Then\n>> you can feed the file via git-am\n>>\n>> I don't know what clients make this easy. I normally use Evolution,\n>> which has as \"save as mbox\" option. It's possible Apple Mail does too.\n>>\n>> Regards,\n>> Jake\n>\n> For the record, you can use \"show original\" from GMail, and save that\n> file as well, I believe. I don't know about Apple Mail specifically,\n> however.\n\nI also don't use Apple Mail, but it must surely have a way to get the\noriginal email text. Save that and then do:\n\n$ git am /path/to/saved-file\n\n\nAt least, that's what I do.\n\nLuke\n"},{"id":"269698","messageId":"xmqq7fny5jrb.fsf@gitster.mtv.corp.google.com","threadId":"40284","inReplyTo":"CAE5ih7-_zhxf_daVxNB-hxFfbakMbJp9rk0vP+k46ErrJ6Qxiw@mail.gmail.com","subject":"Re: [PATCHv1 2/2] git-p4: work with a detached head","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-09-10T16:20:08Z","receivedAt":"2015-09-10T16:20:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> On 9 September 2015 at 22:52, Junio C Hamano <gitster@pobox.com> wrote:\n>> Luke Diamand <luke@diamand.org> writes:\n>>\n>>>      def run(self, args):\n>>>          if len(args) == 0:\n>>>              self.master = currentGitBranch()\n>>> -            if len(self.master) == 0 or not gitBranchExists(\"refs/heads/%s\" % self.master):\n>>> -                die(\"Detecting current git branch failed!\")\n>>> +            if self.master == \"undefined\":\n>>> +                self.master = None\n>>\n>> The comparison with textual \"undefined\" smelled fishy and I ended up\n>> looking at the implementation of currentGitBranch().\n>>\n>>     def currentGitBranch():\n>>         return read_pipe(\"git name-rev HEAD\").split(\" \")[1].strip()\n>>\n>> Yuck.  I know it is not entirely the fault of this patch, but\n>> shouldn't it be reading from\n>>\n>>     $ git symbolic-ref HEAD\n>>\n>> and catch the error \"fatal: ref HEAD is not a symbolic ref\" and use\n>> it as a signal to tell that the HEAD is detached?\n>\n> That sounds much nicer. I'll redo the patch accordingly.\n\nWhile \"symbolic-ref\" _is_ the right way to learn what the currently\nchecked out branch is, I think you'd need to be a bit careful while\nanalysing the ramifications of that fix.\n\nNotice:\n\n    $ git checkout ld/p4-detached-head\n    $ git symbolic-ref -q HEAD; echo $?\n    refs/heads/ld/p4-detached-head\n    0\n    $ git checkout HEAD^0\n    $ git symbolic-ref -q HEAD; echo $?\n    1\n    $ git name-rev HEAD\n    HEAD ld/p4-detached-head\n\nA few implications of the above observation:\n\n * The fact that the code used to use 'name-rev HEAD' means that it\n   behaved as if you are on some branch when you are in a detached\n   HEAD state, if your current commit happened to be at the tip of\n   some branch.  Users could be relying on this behaviour, i.e. \n   you can detach (perhaps because you do not want to accidentally\n   advance the history of the real branch) at the tip of a branch,\n   and have \"git p4\" still apply the configuration based on the name\n   of the original branch.\n\n * If there were multiple branches that point at your current\n   commit, then what is returned by currentGitBranch based on\n   name-rev is unpredictable.  So in that sense, the workflow that\n   relies on the existing \"use the configuration based on the branch\n   name returned by name-rev\" behaviour is already broken, but not\n   many people have two or more branches pointing at the same commit\n   very often, so they may perceive existing breakage of their\n   workflow a non-issue.  To them, fixing the implementation of\n   currentGitBranch may appear to be a regression.\n\n * Of course, if the user happens to have a branch whose name is\n   \"undefined\", you may have detached the HEAD at a totally\n   unrelated commit, and the existing code in run() would first set\n   self.master to \"undefined\", notices \"refs/heads/undefined\"\n   exists, and without even noticing that these two are not related\n   to each other at all, happily goes ahead and uses \"undefined\"\n   branch.  I don't know what happens in that case---perhaps it is\n   the same as the second case where configuration for an unrelated\n   branch is applied and no other damage is done.  Perhaps the code\n   gets confused and sometimes updates HEAD and sometimes updates\n   the tip of self.master branch.  In either case, the existing\n   behaviour cannot be something the users have sensibly relied on.\n\nA good write-up of the bug in the externally visible behaviour that\nis corrected by fixing currentGitBranch implementation in the\nRelease Notes (when this fix hits a release) should be sufficient, I\nthink.\n\nThanks.\n\n   \n"},{"id":"272422","messageId":"xmqqfv0ulwgj.fsf@gitster.mtv.corp.google.com","threadId":"40284","inReplyTo":"CAE5ih7-_zhxf_daVxNB-hxFfbakMbJp9rk0vP+k46ErrJ6Qxiw@mail.gmail.com","subject":"Re: [PATCHv1 2/2] git-p4: work with a detached head","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-10-28T17:44:12Z","receivedAt":"2015-10-28T17:44:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> On 9 September 2015 at 22:52, Junio C Hamano <gitster@pobox.com> wrote:\n>> Luke Diamand <luke@diamand.org> writes:\n>> ...\n>>     def currentGitBranch():\n>>         return read_pipe(\"git name-rev HEAD\").split(\" \")[1].strip()\n>>\n>> Yuck.  I know it is not entirely the fault of this patch, but\n>> shouldn't it be reading from\n>>\n>>     $ git symbolic-ref HEAD\n>>\n>> and catch the error \"fatal: ref HEAD is not a symbolic ref\" and use\n>> it as a signal to tell that the HEAD is detached?\n>\n> That sounds much nicer. I'll redo the patch accordingly.\n\nNo need to rush, but should I expect a reroll of this sometime, or\nhave things around this topic changed to make this topic no longer\nnecessary?  I am only asking so that I can decide to either keep or\ndrop ld/p4-detached-head topic that is listed in the [Stalled]\nsection for quite some time [*1*].\n\nThanks.\n\n\n[Footnote]\n\n*1* Not that my dropping a topic from 'pu' means very much; a\n    dropped topic can still be submitted and requeued after all.\n"},{"id":"272433","messageId":"56311BE7.6090204@diamand.org","threadId":"40284","inReplyTo":"xmqqfv0ulwgj.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCHv1 2/2] git-p4: work with a detached head","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-10-28T19:03:03Z","receivedAt":"2015-10-28T19:03:03Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 28/10/15 17:44, Junio C Hamano wrote:\n> Luke Diamand <luke@diamand.org> writes:\n>\n>> On 9 September 2015 at 22:52, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Luke Diamand <luke@diamand.org> writes:\n>>> ...\n>>>      def currentGitBranch():\n>>>          return read_pipe(\"git name-rev HEAD\").split(\" \")[1].strip()\n>>>\n>>> Yuck.  I know it is not entirely the fault of this patch, but\n>>> shouldn't it be reading from\n>>>\n>>>      $ git symbolic-ref HEAD\n>>>\n>>> and catch the error \"fatal: ref HEAD is not a symbolic ref\" and use\n>>> it as a signal to tell that the HEAD is detached?\n>>\n>> That sounds much nicer. I'll redo the patch accordingly.\n>\n> No need to rush, but should I expect a reroll of this sometime, or\n> have things around this topic changed to make this topic no longer\n> necessary?  I am only asking so that I can decide to either keep or\n> drop ld/p4-detached-head topic that is listed in the [Stalled]\n> section for quite some time [*1*].\n\nI was waiting for the other git-p4 changes to go through before starting \nthis up again.\n\nIt definitely needs fixing - it was annoying me a lot today, as I kept \non having to invent temporary branch names to needlessly keep git-p4 happy.\n\nAfter getting to \"for-p4-9\", I'm now onto \"xyyyy\". I'll see if I can \nsort something out in the next few days.\n\nLuke\n\n\n>\n> Thanks.\n>\n>\n> [Footnote]\n>\n> *1* Not that my dropping a topic from 'pu' means very much; a\n>      dropped topic can still be submitted and requeued after all.\n>\n"}]}