From: Junio C Hamano <junkio@cox.net>
To: Jeff King <peff@peff.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Szekeres Istvan <szekeres@iii.hu>,
git@vger.kernel.org
Subject: Re: Bug: git-rebase goofs up \n in commit messages
Date: Sat, 26 May 2007 00:47:09 -0700 [thread overview]
Message-ID: <7vps4om3gi.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20070526060748.GA20715@coredump.intra.peff.net> (Jeff King's message of "Sat, 26 May 2007 02:07:48 -0400")
Jeff King <peff@peff.net> writes:
> On Fri, May 25, 2007 at 09:59:43PM -0700, Junio C Hamano wrote:
>
>> * I suspect we would declare either "war on echo" or "harder push
>> for builtins" triggered by these.
>
> Cry havoc! More fixes below (just a diff -- maybe we want to aggregate
> these into a single commit?).
>
> These are the ones I noticed that use commit messages (which are
> probably the most likely to use backslash). There are _tons_ of uses for
> heads and filenames. I think we either should stop with commit messages,
> or go all-out and simply remove all uses of echo (because there are
> literally hundreds otherwise).
At least the ones you did look very sane to me. Will apply with
appropriate log message, credit to you.
Thanks.
I do not think we need to do all the uses of 'echo'. Many of
them are clearly fixed string we know about, object names we
parsed out of plumbing output, refnames and refspecs, all of
which should be safe.
Other worrisome ones are pathnames, but (1) I do not think
anybody is insane enough to have slashed funnies in their
pathname components, (2) half the pathnames we deal with come
from plumbing output which use '/' as path component separator
even on Windows, (3) users can use forward slash as path
component separator in their input even on Windows, and (4) even
though we try to use -z output from plumbing and read it with -0
capable downstream in some of our pipelines, many pure-shell
scripts read non-z output using shell built-in "read" and do not
unquote c-quoted ones, so they do not work correctly if you have
HT or LF in your pathnames anyway (notable exception is that
pipelines between git plumbing, e.g. "ls-files | update-index
--stdin", are safe without -z, as the downstream knows how to
unquote c-quoted paths).
I would expect that by the time we run out of more important
things to worry about and start worrying about truly funny
pathnames, we would have rewritten more of the remaining
Porcelains shell scripts in C, which automatically would make
this problem go away.
prev parent reply other threads:[~2007-05-26 7:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 21:11 Bug: git-rebase goofs up \n in commit messages Szekeres Istvan
2007-05-26 0:40 ` Jeff King
2007-05-26 1:10 ` Herbert Xu
2007-05-26 3:42 ` Jeff King
2007-05-26 3:59 ` Junio C Hamano
2007-05-26 4:59 ` Junio C Hamano
2007-05-26 6:07 ` Jeff King
2007-05-26 6:13 ` Junio C Hamano
2007-05-26 6:19 ` Herbert Xu
2007-05-26 6:27 ` Jeff King
2007-05-26 7:38 ` Herbert Xu
2007-05-26 7:47 ` Jeff King
2007-05-26 7:47 ` Junio C Hamano [this message]
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=7vps4om3gi.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=peff@peff.net \
--cc=szekeres@iii.hu \
/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).