From: Junio C Hamano <gitster@pobox.com>
To: dturner@twopensource.com
Cc: git@vger.kernel.org, David Turner <dturner@twitter.com>
Subject: Re: [PATCH v4 2/3] sha1_name: get_sha1_with_context learns to follow symlinks
Date: Mon, 11 May 2015 12:42:39 -0700 [thread overview]
Message-ID: <xmqqh9ri3nps.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1431366989-7405-3-git-send-email-dturner@twopensource.com> (dturner@twopensource.com's message of "Mon, 11 May 2015 13:56:28 -0400")
dturner@twopensource.com writes:
> From: David Turner <dturner@twitter.com>
>
> Wire up get_sha1_with_context to call get_tree_entry_follow_symlinks
> when GET_SHA1_FOLLOW_SYMLINKS is passed in flags. G_S_FOLLOW_SYMLINKS
> is incompatible with G_S_ONLY_TO_DIE because the diagnosis
> that ONLY_TO_DIE triggers does not at present consider symlinks, and
> it would be a significant amount of additional code to allow it to
> do so.
>
> Signed-off-by: David Turner <dturner@twitter.com>
> ---
> cache.h | 20 +++++++++++++-------
> sha1_name.c | 20 +++++++++++++++-----
> 2 files changed, 28 insertions(+), 12 deletions(-)
>
> diff --git a/cache.h b/cache.h
> index 3d3244b..65505d1 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -922,15 +922,21 @@ struct object_context {
> unsigned char tree[20];
> char path[PATH_MAX];
> unsigned mode;
> + /*
> + * symlink_path is only used by get_tree_entry_follow_symlinks,
> + * and only for symlinks that point outside the repository.
> + */
> + struct strbuf symlink_path;
> };
>...
> @@ -1469,5 +1477,7 @@ void maybe_die_on_misspelt_object_name(const char *name, const char *prefix)
>
> int get_sha1_with_context(const char *str, unsigned flags, unsigned char *sha1, struct object_context *orc)
> {
> + if (flags & GET_SHA1_FOLLOW_SYMLINKS && flags & GET_SHA1_ONLY_TO_DIE)
> + die("BUG: incompatible flags for get_sha1_with_context");
> return get_sha1_with_context_1(str, flags, NULL, sha1, orc);
> }
Looks good; thanks.
next prev parent reply other threads:[~2015-05-11 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 17:56 (unknown), dturner
2015-05-11 17:56 ` [PATCH v4 1/3] tree-walk: learn get_tree_entry_follow_symlinks dturner
2015-05-11 17:56 ` [PATCH v4 2/3] sha1_name: get_sha1_with_context learns to follow symlinks dturner
2015-05-11 19:42 ` Junio C Hamano [this message]
2015-05-11 17:56 ` [PATCH v4 3/3] cat-file: add --follow-symlinks to --batch dturner
2015-05-11 20:21 ` Junio C Hamano
2015-05-11 22:31 ` David Turner
2015-05-11 22:39 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh9ri3nps.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).