From: Stephan Beyer <s-beyer@gmx.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] alias.c: use git_config_string() to get alias_val
Date: Sun, 6 Apr 2008 13:02:32 +0200 [thread overview]
Message-ID: <20080406110232.GA6965@leksak.fem-net> (raw)
In-Reply-To: <200804060749.34109.chriscool@tuxfamily.org>
[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]
Hi,
> So you should say in the commit message that you decided to cast to "const
> char **" despite what is on the Janitor page, and most importantly explain
> why in the commit message.
Ah, ok.
Didn't knew that such reasoning goes into the commit message,
but, yes, it makes sense.
> > But instead of doing that, the original should be kept, because it is
> > better in code beauty, performance and memory usage. ;-)
>
> Yes, so perhaps it's not a good idea to convert the original file to
> git_config_string.
Or to use the cast. ;-)
[...]
> But I don't think it's worth the trouble.
I agree ;-)
So what to do?
Keep it?
And there are still some easy `Janitor tasks', like in builtin-apply.c:
--
diff --git a/builtin-apply.c b/builtin-apply.c
index b5f78ac..ce0a0c3 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2978,12 +2978,8 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof)
static int git_apply_config(const char *var, const char *value)
{
- if (!strcmp(var, "apply.whitespace")) {
- if (!value)
- return config_error_nonbool(var);
- apply_default_whitespace = xstrdup(value);
- return 0;
- }
+ if (!strcmp(var, "apply.whitespace"))
+ return git_config_string(&apply_default_whitespace, var, value);
return git_default_config(var, value);
}
--
(Test case: git-apply a patch with trailing whitespaces and check with
apply.whitespace = nowarn / fix / error)
I have attached the patch because I do not want to drop another
mail for it.
And now there is nothing to argue about, I hope, because it is as simple as
http://git.kernel.org/?p=git/git.git;a=commitdiff;h=9886ea417b7da9722c95630b5980ac174e04c71c
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
[-- Attachment #2: 0001-builtin-apply.c-use-git_config_string-to-get-appl.patch --]
[-- Type: text/x-diff, Size: 996 bytes --]
>From 78d1ac0fd19b274853d3c8439d45922c1a0fe82d Mon Sep 17 00:00:00 2001
From: Stephan Beyer <s-beyer@gmx.net>
Date: Sun, 6 Apr 2008 12:37:31 +0200
Subject: [PATCH] builtin-apply.c: use git_config_string() to get apply_default_whitespace
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
builtin-apply.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index b5f78ac..ce0a0c3 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2978,12 +2978,8 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof)
static int git_apply_config(const char *var, const char *value)
{
- if (!strcmp(var, "apply.whitespace")) {
- if (!value)
- return config_error_nonbool(var);
- apply_default_whitespace = xstrdup(value);
- return 0;
- }
+ if (!strcmp(var, "apply.whitespace"))
+ return git_config_string(&apply_default_whitespace, var, value);
return git_default_config(var, value);
}
--
1.5.5.rc3.8.g78d1a
next prev parent reply other threads:[~2008-04-06 11:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-05 12:18 [PATCH] alias.c: use git_config_string() to get alias_val Stephan Beyer
2008-04-05 16:19 ` Christian Couder
2008-04-05 17:39 ` Stephan Beyer
2008-04-06 5:49 ` Christian Couder
2008-04-06 11:02 ` Stephan Beyer [this message]
2008-04-06 13:29 ` Christian Couder
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=20080406110232.GA6965@leksak.fem-net \
--to=s-beyer@gmx.net \
--cc=chriscool@tuxfamily.org \
--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.
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).