Produce contents of index with existing directory as cache

5 messages, 2 authors, 2017-08-31 · open the first message on its own page

Produce contents of index with existing directory as cache

From: Florian Weimer <hidden>
Date: 2017-08-30 14:11:13

Is there a variant of “git checkout-index” which will produce the
existing index contents, like “git checkout-index” would do with an
empty directory, but can reuse an existing directory tree, to avoid
writing all files from scratch?

I'm writing some analysis scripts which need to change a checked-out
working tree.  Right now I'm throwing away the tree after making the
changes and create the next tree (which is expected to be quite similar
in contents) from scratch, starting with an empty directory.  This is
quite slow.

Thanks,
Florian

Re: Produce contents of index with existing directory as cache

From: David Lloyd <hidden>
Date: 2017-08-30 14:16:06

git reset --hard ?

On Wed, Aug 30, 2017 at 9:11 AM, Florian Weimer [off-list ref] wrote:
Is there a variant of “git checkout-index” which will produce the
existing index contents, like “git checkout-index” would do with an
empty directory, but can reuse an existing directory tree, to avoid
writing all files from scratch?

I'm writing some analysis scripts which need to change a checked-out
working tree.  Right now I'm throwing away the tree after making the
changes and create the next tree (which is expected to be quite similar
in contents) from scratch, starting with an empty directory.  This is
quite slow.

Thanks,
Florian


-- 
- DML

Re: Produce contents of index with existing directory as cache

From: Florian Weimer <hidden>
Date: 2017-08-30 14:18:32

On 08/30/2017 04:15 PM, David Lloyd wrote:
git reset --hard ?
That doesn't remove unstaged files.

Florian

Re: Produce contents of index with existing directory as cache

From: David Lloyd <hidden>
Date: 2017-08-30 14:56:29

Ah, does it not?  Perhaps add a "git clean -d -f" as well.

On Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer [off-list ref] wrote:
On 08/30/2017 04:15 PM, David Lloyd wrote:
quoted
git reset --hard ?
That doesn't remove unstaged files.

Florian


-- 
- DML

Re: Produce contents of index with existing directory as cache

From: Florian Weimer <hidden>
Date: 2017-08-31 09:58:52

On 08/30/2017 04:55 PM, David Lloyd wrote:
On Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer [off-list ref] wrote:
quoted
On 08/30/2017 04:15 PM, David Lloyd wrote:
quoted
git reset --hard ?
That doesn't remove unstaged files.
Ah, does it not?  Perhaps add a "git clean -d -f" as well.
It would have to be “git clean -d -f -f -x” (not the two “-f”) to be on
the safe side.  I wonder what else I'm missing, though, and if this is
completely reliable and has the same effect as removing the tree before
“git checkout-index”.

Thanks,
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help