git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Produce contents of index with existing directory as cache
@ 2017-08-30 14:11 Florian Weimer
  2017-08-30 14:15 ` David Lloyd
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2017-08-30 14:11 UTC (permalink / raw)
  To: git

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

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

* Re: Produce contents of index with existing directory as cache
  2017-08-30 14:11 Produce contents of index with existing directory as cache Florian Weimer
@ 2017-08-30 14:15 ` David Lloyd
  2017-08-30 14:18   ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: David Lloyd @ 2017-08-30 14:15 UTC (permalink / raw)
  To: Florian Weimer; +Cc: git

git reset --hard ?

On Wed, Aug 30, 2017 at 9:11 AM, Florian Weimer <fweimer@redhat.com> 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

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

* Re: Produce contents of index with existing directory as cache
  2017-08-30 14:15 ` David Lloyd
@ 2017-08-30 14:18   ` Florian Weimer
  2017-08-30 14:55     ` David Lloyd
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2017-08-30 14:18 UTC (permalink / raw)
  To: David Lloyd; +Cc: git

On 08/30/2017 04:15 PM, David Lloyd wrote:
> git reset --hard ?

That doesn't remove unstaged files.

Florian

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

* Re: Produce contents of index with existing directory as cache
  2017-08-30 14:18   ` Florian Weimer
@ 2017-08-30 14:55     ` David Lloyd
  2017-08-31  9:58       ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: David Lloyd @ 2017-08-30 14:55 UTC (permalink / raw)
  To: Florian Weimer; +Cc: git

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

On Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 08/30/2017 04:15 PM, David Lloyd wrote:
>> git reset --hard ?
>
> That doesn't remove unstaged files.
>
> Florian



-- 
- DML

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

* Re: Produce contents of index with existing directory as cache
  2017-08-30 14:55     ` David Lloyd
@ 2017-08-31  9:58       ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2017-08-31  9:58 UTC (permalink / raw)
  To: David Lloyd; +Cc: git

On 08/30/2017 04:55 PM, David Lloyd wrote:
> On Wed, Aug 30, 2017 at 9:18 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 08/30/2017 04:15 PM, David Lloyd wrote:
>>> 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

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

end of thread, other threads:[~2017-08-31  9:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 14:11 Produce contents of index with existing directory as cache Florian Weimer
2017-08-30 14:15 ` David Lloyd
2017-08-30 14:18   ` Florian Weimer
2017-08-30 14:55     ` David Lloyd
2017-08-31  9:58       ` Florian Weimer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).