threads / patch / 36357

patchgit-p4: explicitly specify that HEAD is a revision

Subject: [PATCH] git-p4: explicitly specify that HEAD is a revision

## tl;dr

3 messages between Apr 7, 2014 and Apr 7, 2014. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Vlad Dogaru· Apr 7, 2014, 13:19 UTC · lore

'git p4 rebase' fails with the following message if there is a file named HEAD in the current directory:

	fatal: ambiguous argument 'HEAD': both revision and filename
	Use '--' to separate paths from revisions, like this:
	'git <command> [<revision>...] -- [<file>...]'

Take the suggestion above and explicitly state that HEAD should be treated as a revision.

Signed-off-by: Vlad Dogaru <vdogaru@ixiacom.com>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to git-p4.py +1 −1
diff --git a/git-p4.py b/git-p4.py
index cdfa2df..8d11b25 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -3086,7 +3086,7 @@ class P4Rebase(Command):
         print "Rebasing the current branch onto %s" % upstream
         oldHead = read_pipe("git rev-parse HEAD").strip()
         system("git rebase %s" % upstream)
-        system("git diff-tree --stat --summary -M %s HEAD" % oldHead)
+        system("git diff-tree --stat --summary -M %s HEAD --" % oldHead)
         return True
 
 class P4Clone(P4Sync):
-- 
1.8.5.2
Pete Wyckoff· Apr 7, 2014, 22:09 UTC · re: Vlad Dogaru · lore

Re: [PATCH] git-p4: explicitly specify that HEAD is a revision

vdogaru@ixiacom.com wrote on Mon, 07 Apr 2014 16:19 +0300:
Show 11 quoted lines
> 'git p4 rebase' fails with the following message if there is a file
> named HEAD in the current directory:
> 
> 	fatal: ambiguous argument 'HEAD': both revision and filename
> 	Use '--' to separate paths from revisions, like this:
> 	'git <command> [<revision>...] -- [<file>...]'
> 
> Take the suggestion above and explicitly state that HEAD should be
> treated as a revision.
> 
> Signed-off-by: Vlad Dogaru <vdogaru@ixiacom.com>
This looks obviously good to me, thanks!

Junio, could you carry it into the next release? As a trivial fixup.

Acked-by: Pete Wyckoff <pw@padd.com>
Show 21 quoted lines
> ---
>  git-p4.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/git-p4.py b/git-p4.py
> index cdfa2df..8d11b25 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -3086,7 +3086,7 @@ class P4Rebase(Command):
>          print "Rebasing the current branch onto %s" % upstream
>          oldHead = read_pipe("git rev-parse HEAD").strip()
>          system("git rebase %s" % upstream)
> -        system("git diff-tree --stat --summary -M %s HEAD" % oldHead)
> +        system("git diff-tree --stat --summary -M %s HEAD --" % oldHead)
>          return True
>  
>  class P4Clone(P4Sync):
> -- 
> 1.8.5.2
> 
> 
Junio C Hamano· Apr 7, 2014, 22:37 UTC · re: Pete Wyckoff · lore

Re: [PATCH] git-p4: explicitly specify that HEAD is a revision

Pete Wyckoff <pw@padd.com> writes:
Show 19 quoted lines
> vdogaru@ixiacom.com wrote on Mon, 07 Apr 2014 16:19 +0300:
>> 'git p4 rebase' fails with the following message if there is a file
>> named HEAD in the current directory:
>> 
>> 	fatal: ambiguous argument 'HEAD': both revision and filename
>> 	Use '--' to separate paths from revisions, like this:
>> 	'git <command> [<revision>...] -- [<file>...]'
>> 
>> Take the suggestion above and explicitly state that HEAD should be
>> treated as a revision.
>> 
>> Signed-off-by: Vlad Dogaru <vdogaru@ixiacom.com>
>
> This looks obviously good to me, thanks!
>
> Junio, could you carry it into the next release?  As a trivial
> fixup.
>
> Acked-by: Pete Wyckoff <pw@padd.com>
Thanks; will apply directly on 'master'.
Show 22 quoted lines
>
>> ---
>>  git-p4.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/git-p4.py b/git-p4.py
>> index cdfa2df..8d11b25 100755
>> --- a/git-p4.py
>> +++ b/git-p4.py
>> @@ -3086,7 +3086,7 @@ class P4Rebase(Command):
>>          print "Rebasing the current branch onto %s" % upstream
>>          oldHead = read_pipe("git rev-parse HEAD").strip()
>>          system("git rebase %s" % upstream)
>> -        system("git diff-tree --stat --summary -M %s HEAD" % oldHead)
>> +        system("git diff-tree --stat --summary -M %s HEAD --" % oldHead)
>>          return True
>>  
>>  class P4Clone(P4Sync):
>> -- 
>> 1.8.5.2
>> 
>> 

← back to recent threads