From: John Keeping <john@keeping.me.uk>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>,
Jens Lehmann <Jens.Lehmann@web.de>, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH v2 2/4] pathspec: strip multiple trailing slashes from submodules
Date: Fri, 13 Sep 2013 09:48:34 +0100 [thread overview]
Message-ID: <20130913084833.GD2582@serenity.lan> (raw)
In-Reply-To: <CACsJy8DX_v9r0QYQMH=697LGeGsCaE80oCo0ppd2LFZk-Os+TA@mail.gmail.com>
On Fri, Sep 13, 2013 at 08:28:24AM +0700, Duy Nguyen wrote:
> On Fri, Sep 13, 2013 at 3:21 AM, John Keeping <john@keeping.me.uk> wrote:
> > On Thu, Sep 12, 2013 at 12:48:10PM -0700, Junio C Hamano wrote:
> >> John Keeping <john@keeping.me.uk> writes:
> >>
> >> > This allows us to replace the submodule path trailing slash removal in
> >> > builtin/rm.c with the PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag to
> >> > parse_pathspec() without changing the behaviour with respect to multiple
> >> > trailing slashes.
> >>
> >> Where does prefix_pathspec()'s input, which could have an unwanted
> >> trailing slash, come from?
> >>
> >> If it is read from some of our internal data structure and known to
> >> have at most one, then this change makes me feel very uneasy to cope
> >> with potentially sloppy end-user input and data generated by ourselves
> >> with the same logic. It will allow our internal to be sloppy without
> >> forcing us notice and fix that sloppiness.
> >>
> >> If it is coming from an end-user input, then I would not object to
> >> the change, though.
> >
> > I added this in response to Duy's comment on v1 [1].
> >
> > [1] http://article.gmane.org/gmane.comp.version-control.git/234548
>
> Looks like I add more noise to this thread than anything valuable.
> Yes, once argv goes through parse_pathspec it's normalized so we do
> not need to strip consecutive slashes any more. I'm not entirely sure
> if it also converts Windows '\\' to '/'..
If it goes through normalize_path_copy_len then it does.
Junio, can you please drop the first two patches in this series? I can
resend the final two unmodified if necessary, but I suspect it's easier
for you to just drop the commits.
> > Looking more closely, this does come from user input (via the argv
> > passed into parse_pathspec) but does (some of the time) go through
> > prefix_path_gently which calls normalize_path_copy_len.
> >
> > It's not immediately clear to me when prefix_pathspec goes through this
> > particular code path, but I think we may be able to drop this (and the
> > previous patch) without affecting the user.
next prev parent reply other threads:[~2013-09-13 8:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 19:13 [PATCH 0/2] reset: handle submodule with trailing slash John Keeping
2013-09-10 19:13 ` [PATCH 1/2] " John Keeping
2013-09-10 19:37 ` Jens Lehmann
2013-09-10 19:46 ` John Keeping
2013-09-11 6:05 ` Johannes Sixt
2013-09-11 8:20 ` John Keeping
2013-09-11 10:54 ` Duy Nguyen
2013-09-11 11:08 ` John Keeping
2013-09-11 11:20 ` Duy Nguyen
2013-09-11 17:08 ` Junio C Hamano
2013-09-11 17:27 ` John Keeping
2013-09-11 18:14 ` Junio C Hamano
2013-09-11 18:22 ` John Keeping
2013-09-11 18:45 ` Junio C Hamano
2013-09-10 19:13 ` [PATCH 2/2] rm: re-use parse_pathspec's trailing-slash removal John Keeping
2013-09-11 7:48 ` Duy Nguyen
2013-09-11 8:24 ` John Keeping
2013-09-12 19:24 ` [PATCH v2 0/4] submodule trailing slash improvements John Keeping
2013-09-12 19:24 ` [PATCH v2 1/4] pathspec: use is_dir_sep() to check for trailing slashes John Keeping
2013-09-12 20:17 ` Johannes Sixt
2013-09-12 19:24 ` [PATCH v2 2/4] pathspec: strip multiple trailing slashes from submodules John Keeping
2013-09-12 19:48 ` Junio C Hamano
2013-09-12 20:21 ` John Keeping
2013-09-13 1:28 ` Duy Nguyen
2013-09-13 8:48 ` John Keeping [this message]
2013-09-12 19:25 ` [PATCH v2 3/4] rm: re-use parse_pathspec's trailing-slash removal John Keeping
2013-09-12 19:25 ` [PATCH v2 4/4] reset: handle submodule with trailing slash John Keeping
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=20130913084833.GD2582@serenity.lan \
--to=john@keeping.me.uk \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=pclouds@gmail.com \
/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.
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).