git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Arjen Laarhoven <arjen@yaph.org>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Have tests and programs understand paths containing spaces
Date: Wed, 23 Apr 2008 03:07:38 +0400	[thread overview]
Message-ID: <20080422230738.GD26950@dpotapov.dyndns.org> (raw)
In-Reply-To: <20080422212801.GB20417@regex.yaph.org>

On Tue, Apr 22, 2008 at 11:28:01PM +0200, Arjen Laarhoven wrote:
> 
> diff --git a/builtin-tag.c b/builtin-tag.c
> index 129ff57..2d04d4f 100644
> --- a/builtin-tag.c
> +++ b/builtin-tag.c
> @@ -55,7 +55,7 @@ void launch_editor(const char *path, struct strbuf *buffer, const char *const *e
>  		strbuf_init(&arg0, 0);
>  		if (strcspn(editor, "$ \t'") != len) {
>  			/* there are specials */
> -			strbuf_addf(&arg0, "%s \"$@\"", editor);
> +			strbuf_addf(&arg0, "'%s' \"$@\"", editor);

This change has been already discussed on the mail, and I believe it
was ultimately rejected, because it will break things for people using
something like that: GIT_EDITOR='emacs -nw'. If you have spaces in the
path to your editor, you should quote in the definition of the editor:

git config core.editor '"c:/Program Files/What/Ever.exe"'

Thus, by putting extra quotes will break things for people who uses some
their favorite editor with extra options and for those who already use an
editor from c:/Program Files on Windows.

> diff --git a/git-send-email.perl b/git-send-email.perl
> index 9e568bf..40a521a 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -512,7 +512,7 @@ EOT
>  	close(C);
>  
>  	my $editor = $ENV{GIT_EDITOR} || Git::config(@repo, "core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
> -	system('sh', '-c', '$0 $@', $editor, $compose_filename);
> +	system('sh', '-c', '"$0" $@', $editor, $compose_filename);

See above.

>  
>  	open(C2,">",$compose_filename . ".final")
>  		or die "Failed to open $compose_filename.final : " . $!;
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index a44b1c7..a8a024b 100755
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -73,7 +73,7 @@ git_editor() {
>  		exit 1
>  		;;
>  	esac
> -	eval "${GIT_EDITOR:=vi}" '"$@"'
> +	eval '"${GIT_EDITOR:=vi}"' '"$@"'

See above.


Dmitry

  reply	other threads:[~2008-04-22 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 21:28 [PATCH] Have tests and programs understand paths containing spaces Arjen Laarhoven
2008-04-22 23:07 ` Dmitry Potapov [this message]
2008-04-23  7:13 ` Johannes Sixt

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=20080422230738.GD26950@dpotapov.dyndns.org \
    --to=dpotapov@gmail.com \
    --cc=arjen@yaph.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).