Re: [PATCHv1 2/2] git-p4: work with a detached head

2015-10-28 Thread Luke Diamand
On 28/10/15 17:44, Junio C Hamano wrote: Luke Diamand writes: On 9 September 2015 at 22:52, Junio C Hamano wrote: Luke Diamand writes: ... def currentGitBranch(): return read_pipe("git name-rev HEAD").split(" ")[1].strip() Yuck. I know it is not entirely the fault of this pa

Re: [PATCHv1 2/2] git-p4: work with a detached head

2015-10-28 Thread Junio C Hamano
Luke Diamand writes: > On 9 September 2015 at 22:52, Junio C Hamano wrote: >> Luke Diamand writes: >> ... >> def currentGitBranch(): >> return read_pipe("git name-rev HEAD").split(" ")[1].strip() >> >> Yuck. I know it is not entirely the fault of this patch, but >> shouldn't it be

Re: [PATCHv1 2/2] git-p4: work with a detached head

2015-09-10 Thread Junio C Hamano
Luke Diamand writes: > On 9 September 2015 at 22:52, Junio C Hamano wrote: >> Luke Diamand writes: >> >>> def run(self, args): >>> if len(args) == 0: >>> self.master = currentGitBranch() >>> -if len(self.master) == 0 or not >>> gitBranchExists("refs/heads

Re: [PATCHv1 2/2] git-p4: work with a detached head

2015-09-10 Thread Luke Diamand
On 9 September 2015 at 22:52, Junio C Hamano wrote: > Luke Diamand writes: > >> def run(self, args): >> if len(args) == 0: >> self.master = currentGitBranch() >> -if len(self.master) == 0 or not gitBranchExists("refs/heads/%s" >> % self.master): >> -

Re: [PATCHv1 2/2] git-p4: work with a detached head

2015-09-09 Thread Junio C Hamano
Luke Diamand writes: > def run(self, args): > if len(args) == 0: > self.master = currentGitBranch() > -if len(self.master) == 0 or not gitBranchExists("refs/heads/%s" > % self.master): > -die("Detecting current git branch failed!") > +

[PATCHv1 2/2] git-p4: work with a detached head

2015-09-05 Thread Luke Diamand
When submitting, git-p4 finds the current branch in order to know if it is allowed to submit (configuration "git-p4.allowSubmit"). On a detached head, detecting the branch would fail, and git-p4 would report a cryptic error. This change teaches git-p4 to recognise a detached head and submit succe