All of lore.kernel.org
 help / color / mirror / Atom feed
* "git pull" doesn't respect --work-tree parameter
@ 2010-12-21 16:04 Alexey Zakhlestin
  2010-12-22 11:20 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Zakhlestin @ 2010-12-21 16:04 UTC (permalink / raw)
  To: git

I am trying to use the following command:

git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull

and get this error:
"git-pull cannot be used without a working tree"

I get the same error, if I try to use corresponding environment variables


looks like a bug, because I can, successfully, use "git status" with
the same --git-dir and --work-tree parameters

-- 
Alexey Zakhlestin, http://twitter.com/jimi_dini
http://www.milkfarmsoft.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-21 16:04 "git pull" doesn't respect --work-tree parameter Alexey Zakhlestin
@ 2010-12-22 11:20 ` Nguyen Thai Ngoc Duy
  2010-12-22 11:40   ` Alexey Zakhlestin
  0 siblings, 1 reply; 7+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-12-22 11:20 UTC (permalink / raw)
  To: Alexey Zakhlestin; +Cc: git

On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
> I am trying to use the following command:
>
> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull
>
> and get this error:
> "git-pull cannot be used without a working tree"

It works fine for me. What's the result of

git '--git-dir=/path/to/repository/.git'
'--work-tree=/path/to/repository' --git-dir
git '--git-dir=/path/to/repository/.git'
'--work-tree=/path/to/repository' --is-inside-work-tree
git '--git-dir=/path/to/repository/.git'
'--work-tree=/path/to/repository' --show-toplevel

?

Also what version of git are you using?
-- 
Duy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-22 11:20 ` Nguyen Thai Ngoc Duy
@ 2010-12-22 11:40   ` Alexey Zakhlestin
  2010-12-22 11:42     ` Andreas Ericsson
  2010-12-22 11:44     ` Nguyen Thai Ngoc Duy
  0 siblings, 2 replies; 7+ messages in thread
From: Alexey Zakhlestin @ 2010-12-22 11:40 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git

On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
>> I am trying to use the following command:
>>
>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull
>>
>> and get this error:
>> "git-pull cannot be used without a working tree"
>
> It works fine for me. What's the result of
>
> git '--git-dir=/path/to/repository/.git'
> '--work-tree=/path/to/repository' --git-dir

No directory given for --git-dir.

> git '--git-dir=/path/to/repository/.git'
> '--work-tree=/path/to/repository' --is-inside-work-tree

Unknown option: --is-inside-work-tree

> git '--git-dir=/path/to/repository/.git'
> '--work-tree=/path/to/repository' --show-toplevel

Unknown option: --show-toplevel


> Also what version of git are you using?

1.7.3.4

-- 
Alexey Zakhlestin, http://twitter.com/jimi_dini
http://www.milkfarmsoft.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-22 11:40   ` Alexey Zakhlestin
@ 2010-12-22 11:42     ` Andreas Ericsson
  2010-12-22 11:44     ` Nguyen Thai Ngoc Duy
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Ericsson @ 2010-12-22 11:42 UTC (permalink / raw)
  To: Alexey Zakhlestin; +Cc: Nguyen Thai Ngoc Duy, git

On 12/22/2010 12:40 PM, Alexey Zakhlestin wrote:
> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy<pclouds@gmail.com>  wrote:
>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin<indeyets@gmail.com>  wrote:
>>> I am trying to use the following command:
>>>
>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull
>>>
>>> and get this error:
>>> "git-pull cannot be used without a working tree"
>>
>> It works fine for me. What's the result of
>>
>> git '--git-dir=/path/to/repository/.git'
>> '--work-tree=/path/to/repository' --git-dir
> 
> No directory given for --git-dir.
> 

You added an extra --git-dir without an argument at the end of
the command. Remove it and try again.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-22 11:40   ` Alexey Zakhlestin
  2010-12-22 11:42     ` Andreas Ericsson
@ 2010-12-22 11:44     ` Nguyen Thai Ngoc Duy
  2010-12-22 11:50       ` Alexey Zakhlestin
  1 sibling, 1 reply; 7+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-12-22 11:44 UTC (permalink / raw)
  To: Alexey Zakhlestin; +Cc: git

On Wed, Dec 22, 2010 at 6:40 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
>>> I am trying to use the following command:
>>>
>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull
>>>
>>> and get this error:
>>> "git-pull cannot be used without a working tree"
>>
>> It works fine for me. What's the result of
>>
>> git '--git-dir=/path/to/repository/.git'
>> '--work-tree=/path/to/repository' --git-dir
>
> No directory given for --git-dir.
>
>> git '--git-dir=/path/to/repository/.git'
>> '--work-tree=/path/to/repository' --is-inside-work-tree
>
> Unknown option: --is-inside-work-tree
>
>> git '--git-dir=/path/to/repository/.git'
>> '--work-tree=/path/to/repository' --show-toplevel
>
> Unknown option: --show-toplevel

Sorry I forgot the command name (rev-parse). The full command should
be "git --git-dir=... --work-tree=... rev-parse <option>" where option
is --git-dir, --is-inside-work-tree, --show-toplevel. Can you please
try again?
-- 
Duy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-22 11:44     ` Nguyen Thai Ngoc Duy
@ 2010-12-22 11:50       ` Alexey Zakhlestin
  2010-12-22 11:55         ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Zakhlestin @ 2010-12-22 11:50 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git

On Wed, Dec 22, 2010 at 2:44 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On Wed, Dec 22, 2010 at 6:40 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
>> On Wed, Dec 22, 2010 at 2:20 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>>> On Tue, Dec 21, 2010 at 11:04 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
>>>> I am trying to use the following command:
>>>>
>>>> git '--git-dir=/path/to/repository/.git' '--work-tree=/path/to/repository' pull
>>>>
>>>> and get this error:
>>>> "git-pull cannot be used without a working tree"
>>>
>>> It works fine for me. What's the result of
>>>
>>> git '--git-dir=/path/to/repository/.git'
>>> '--work-tree=/path/to/repository' --git-dir
>>
>> No directory given for --git-dir.
>>
>>> git '--git-dir=/path/to/repository/.git'
>>> '--work-tree=/path/to/repository' --is-inside-work-tree
>>
>> Unknown option: --is-inside-work-tree
>>
>>> git '--git-dir=/path/to/repository/.git'
>>> '--work-tree=/path/to/repository' --show-toplevel
>>
>> Unknown option: --show-toplevel
>
> Sorry I forgot the command name (rev-parse). The full command should
> be "git --git-dir=... --work-tree=... rev-parse <option>" where option
> is --git-dir, --is-inside-work-tree, --show-toplevel. Can you please
> try again?

1) returns correct path:
/Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core/.git
2) false
3) returns correct path, again:
/Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core

just to make myself clear: $PWD is another path, not related to repository path

-- 
Alexey Zakhlestin, http://twitter.com/jimi_dini
http://www.milkfarmsoft.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "git pull" doesn't respect --work-tree parameter
  2010-12-22 11:50       ` Alexey Zakhlestin
@ 2010-12-22 11:55         ` Nguyen Thai Ngoc Duy
  0 siblings, 0 replies; 7+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2010-12-22 11:55 UTC (permalink / raw)
  To: Alexey Zakhlestin; +Cc: git

On Wed, Dec 22, 2010 at 6:50 PM, Alexey Zakhlestin <indeyets@gmail.com> wrote:
> 1) returns correct path:
> /Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core/.git
> 2) false
> 3) returns correct path, again:
> /Users/indy/Documents/Sources/_mine/midgard/mvc/_rdf/midgardmvc_core
>
> just to make myself clear: $PWD is another path, not related to repository path

OK. git-pull does not automatically move to worktree (while git-status
does) and thus won't work when $PWD is outside worktree. I remember
there's a similar report this year. I'll see if I can make a patch for
it.

Thank you for your report.
-- 
Duy

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-22 11:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21 16:04 "git pull" doesn't respect --work-tree parameter Alexey Zakhlestin
2010-12-22 11:20 ` Nguyen Thai Ngoc Duy
2010-12-22 11:40   ` Alexey Zakhlestin
2010-12-22 11:42     ` Andreas Ericsson
2010-12-22 11:44     ` Nguyen Thai Ngoc Duy
2010-12-22 11:50       ` Alexey Zakhlestin
2010-12-22 11:55         ` Nguyen Thai Ngoc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.