public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: tboegi@web•de
Cc: git@vger•kernel.org
Subject: Re: [PATCH v2 1/2] read-cache: factor out get_sha1_from_index() helper
Date: Thu, 27 Oct 2016 12:57:40 -0700	[thread overview]
Message-ID: <xmqqinsd5zuz.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161012134726.28326-1-tboegi@web.de> (tboegi@web.de's message of "Wed, 12 Oct 2016 15:47:26 +0200")

tboegi@web•de writes:

> From: Torsten Bögershausen <tboegi@web•de>
>
> Factor out the retrieval of the sha1 for a given path in
> read_blob_data_from_index() into the function get_sha1_from_index().
>
> This will be used in the next commit, when convert.c can do the
> analyze for "text=auto" without slurping the whole blob into memory
> at once.
>
> Add a wrapper definition get_sha1_from_cache().
>
> Signed-off-by: Torsten Bögershausen <tboegi@web•de>
> ---
>  cache.h      |  3 +++
>  read-cache.c | 29 ++++++++++++++++++-----------
>  2 files changed, 21 insertions(+), 11 deletions(-)
>
> diff --git a/cache.h b/cache.h
> index 1604e29..04de209 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -380,6 +380,7 @@ extern void free_name_hash(struct index_state *istate);
>  #define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)
>  #define unmerge_cache(pathspec) unmerge_index(&the_index, pathspec)
>  #define read_blob_data_from_cache(path, sz) read_blob_data_from_index(&the_index, (path), (sz))
> +#define get_sha1_from_cache(path)  get_sha1_from_index (&the_index, (path))

Should have caught this earlier, but there is an extra SP after "from_index"
which I'll remove (the topic is not in 'next' yet, lucky us).

I re-read this to ensure that it does not break read_blob_data_from_index()
the new function borrows the logic from.

Thanks.

  reply	other threads:[~2016-10-27 19:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  9:56 [PATCH v1 0/2] convert: stream and early out tboegi
2016-10-10 20:19 ` Junio C Hamano
2016-10-12 13:47 ` [PATCH v2 0/2] Stream and fast search tboegi
2016-10-27 17:02   ` Junio C Hamano
2016-10-12 13:47 ` [PATCH v2 1/2] read-cache: factor out get_sha1_from_index() helper tboegi
2016-10-27 19:57   ` Junio C Hamano [this message]
2016-10-29 12:22   ` Duy Nguyen
2016-10-12 13:47 ` [PATCH v2 2/2] convert.c: stream and fast search for binary tboegi
2016-10-27 21:18   ` Junio C Hamano
2016-11-01  9:36     ` Torsten Bögershausen
2016-10-29 12:13   ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqinsd5zuz.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=tboegi@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox