git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] GIT_INDEX environment variable ignored?
@ 2015-10-08  4:48 McAuley, Ben
  2015-10-08  7:28 ` Matthieu Moy
  2015-10-08  7:56 ` Michael J Gruber
  0 siblings, 2 replies; 3+ messages in thread
From: McAuley, Ben @ 2015-10-08  4:48 UTC (permalink / raw)
  To: git@vger.kernel.org

Hello,

I was trying to use multiple indexes earlier, and ran into an issue which I've summarised into a test case:

$ git init
$ touch file1 && git add file1 && git commit -m "file1"
$ git branch release 
$ touch file2 && git add file2 && git commit -m "file2"
$ cp .git/index .git/indexMaster
$ git checkout release
$ touch file3 && git add file3 && git commit -m "file3"

I then ran ls-files with the --stage option to look at what the index contains.
As expected file1 and file3 are present, we're on the 'release' branch still.

$ git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file1
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file3

However when I run the same command again, this time using the 
GIT_INDEX env variable to provide the index I previously saved on master,
I don't see file2 like I'd expect...

$ GIT_INDEX=.git/indexMaster git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file1
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file3

Is this something going wrong, or am I misunderstanding the role of the index/GIT_INDEX variable?

Replicated on 2.5.0.windows.1 and 2.6.1 (Linux).

Thanks,
Ben

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

* Re: [BUG] GIT_INDEX environment variable ignored?
  2015-10-08  4:48 [BUG] GIT_INDEX environment variable ignored? McAuley, Ben
@ 2015-10-08  7:28 ` Matthieu Moy
  2015-10-08  7:56 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2015-10-08  7:28 UTC (permalink / raw)
  To: McAuley, Ben; +Cc: git@vger.kernel.org

"McAuley, Ben" <Ben.McAuley@sungard.com> writes:

> However when I run the same command again, this time using the 
> GIT_INDEX env variable to provide the index I previously saved on master,
> I don't see file2 like I'd expect...

The variable name is GIT_INDEX_FILE (read 'man git' for details) ...

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: [BUG] GIT_INDEX environment variable ignored?
  2015-10-08  4:48 [BUG] GIT_INDEX environment variable ignored? McAuley, Ben
  2015-10-08  7:28 ` Matthieu Moy
@ 2015-10-08  7:56 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Michael J Gruber @ 2015-10-08  7:56 UTC (permalink / raw)
  To: McAuley, Ben, git@vger.kernel.org

McAuley, Ben venit, vidit, dixit 08.10.2015 06:48:
> Hello,
> 
> I was trying to use multiple indexes earlier, and ran into an issue which I've summarised into a test case:
> 
> $ git init
> $ touch file1 && git add file1 && git commit -m "file1"
> $ git branch release 
> $ touch file2 && git add file2 && git commit -m "file2"
> $ cp .git/index .git/indexMaster
> $ git checkout release
> $ touch file3 && git add file3 && git commit -m "file3"
> 
> I then ran ls-files with the --stage option to look at what the index contains.
> As expected file1 and file3 are present, we're on the 'release' branch still.
> 
> $ git ls-files --stage
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file1
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file3
> 
> However when I run the same command again, this time using the 
> GIT_INDEX env variable to provide the index I previously saved on master,
> I don't see file2 like I'd expect...
> 
> $ GIT_INDEX=.git/indexMaster git ls-files --stage
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file1
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       file3
> 
> Is this something going wrong, or am I misunderstanding the role of the index/GIT_INDEX variable?
> 
> Replicated on 2.5.0.windows.1 and 2.6.1 (Linux).

Maybe try GIT_INDEX_FILE instead of GIT_INDEX? ;)

Michael

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

end of thread, other threads:[~2015-10-08  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08  4:48 [BUG] GIT_INDEX environment variable ignored? McAuley, Ben
2015-10-08  7:28 ` Matthieu Moy
2015-10-08  7:56 ` Michael J Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).