git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Change double quotes to single quotes in message
@ 2009-03-21  9:08 Jari Aalto
  2009-03-21 21:07 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Jari Aalto @ 2009-03-21  9:08 UTC (permalink / raw)
  To: git


>From 6daec692a39a1ecf0452f1ad1eb7ba6fbf5661c9 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Sat, 21 Mar 2009 11:00:54 +0200
Subject: [PATCH] Change double quotes to single quotes in message

This helps selecting the text inside quotes by using mouse double-click
action (e.g. in Putty). Functions affected: update_refs_for_switch(),
update_refs_for_switch() and cmd_checkout().
---
 builtin-checkout.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin-checkout.c b/builtin-checkout.c
index 9fdfc58..49daade 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -503,10 +503,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 		create_symref("HEAD", new->path, msg.buf);
 		if (!opts->quiet) {
 			if (old->path && !strcmp(new->path, old->path))
-				fprintf(stderr, "Already on \"%s\"\n",
+				fprintf(stderr, "Already on '%s'\n",
 					new->name);
 			else
-				fprintf(stderr, "Switched to%s branch \"%s\"\n",
+				fprintf(stderr, "Switched to%s branch '%s'\n",
 					opts->new_branch ? " a new" : "",
 					new->name);
 		}
@@ -515,7 +515,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
 			   REF_NODEREF, DIE_ON_ERR);
 		if (!opts->quiet) {
 			if (old->path)
-				fprintf(stderr, "Note: moving to \"%s\" which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\n", new->name);
+				fprintf(stderr, "Note: moving to '%s' which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\n", new->name);
 			describe_detached_head("HEAD is now at", new->commit);
 		}
 	}
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Change double quotes to single quotes in message
  2009-03-21  9:08 [PATCH] Change double quotes to single quotes in message Jari Aalto
@ 2009-03-21 21:07 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-03-21 21:07 UTC (permalink / raw)
  To: Jari Aalto; +Cc: git

Jari Aalto <jari.aalto@cante.net> writes:

> From 6daec692a39a1ecf0452f1ad1eb7ba6fbf5661c9 Mon Sep 17 00:00:00 2001
> From: Jari Aalto <jari.aalto@cante.net>
> Date: Sat, 21 Mar 2009 11:00:54 +0200
> Subject: [PATCH] Change double quotes to single quotes in message
>
> This helps selecting the text inside quotes by using mouse double-click
> action (e.g. in Putty). Functions affected: update_refs_for_switch(),
> update_refs_for_switch() and cmd_checkout().
> ---

The patch is good.

Lacks sign-off, has extra header lines in body, and the justification can
be a lot stronger.  The three you identified are the only ones among 30
hits from:

    $ git grep -n -e "printf(.*\".*['\"]%s" -- '*.c'

that use dq around the path-like things, while all others use sq.  There
also are a few similar constructs using strbuf_addf all of which use sq.
Consistency is good.

>  builtin-checkout.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/builtin-checkout.c b/builtin-checkout.c
> index 9fdfc58..49daade 100644
> --- a/builtin-checkout.c
> +++ b/builtin-checkout.c
> @@ -503,10 +503,10 @@ static void update_refs_for_switch(struct checkout_opts *opts,
>  		create_symref("HEAD", new->path, msg.buf);
>  		if (!opts->quiet) {
>  			if (old->path && !strcmp(new->path, old->path))
> -				fprintf(stderr, "Already on \"%s\"\n",
> +				fprintf(stderr, "Already on '%s'\n",
>  					new->name);
>  			else
> -				fprintf(stderr, "Switched to%s branch \"%s\"\n",
> +				fprintf(stderr, "Switched to%s branch '%s'\n",
>  					opts->new_branch ? " a new" : "",
>  					new->name);
>  		}
> @@ -515,7 +515,7 @@ static void update_refs_for_switch(struct checkout_opts *opts,
>  			   REF_NODEREF, DIE_ON_ERR);
>  		if (!opts->quiet) {
>  			if (old->path)
> -				fprintf(stderr, "Note: moving to \"%s\" which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\n", new->name);
> +				fprintf(stderr, "Note: moving to '%s' which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\n", new->name);
>  			describe_detached_head("HEAD is now at", new->commit);
>  		}
>  	}
> -- 
> 1.6.1.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-21 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-21  9:08 [PATCH] Change double quotes to single quotes in message Jari Aalto
2009-03-21 21:07 ` Junio C Hamano

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).