* [PATCH] Makefile: detect when PYTHON_PATH changes
From: Christian Couder @ 2012-12-15 14:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
When make is run the python script are created from *.py files that
are changed to use the python given by PYTHON_PATH. And PYTHON_PATH
is set by default to /usr/bin/python on Linux.
This is nice except when you run make another time setting a
different PYTHON_PATH, because, as the python scripts have already
been created, make finds nothing to do.
The goal of this patch is to detect when the PYTHON_PATH changes and
to create the python scripts again when this happens. To do that we
use the same trick that is done to track prefix, flags and tcl/tk
path. We update a GIT-PYTHON-VARS file with the PYTHON_PATH and check
if it changed.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Makefile | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 4ad6fbd..bd86063 100644
--- a/Makefile
+++ b/Makefile
@@ -2245,7 +2245,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
endif # NO_PERL
ifndef NO_PYTHON
-$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX
+$(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS
$(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
$(QUIET_GEN)$(RM) $@ $@+ && \
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
@@ -2636,6 +2636,18 @@ GIT-GUI-VARS: FORCE
fi
endif
+### Detect Python interpreter path changes
+ifndef NO_PYTHON
+TRACK_VARS = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')
+
+GIT-PYTHON-VARS: FORCE
+ @VARS='$(TRACK_VARS)'; \
+ if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
+ echo 1>&2 " * new Python interpreter location"; \
+ echo "$$VARS" >$@; \
+ fi
+endif
+
test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
--
1.8.1.rc1.1.g9537e17
^ permalink raw reply related
* [PATCH] Documentation: don't link to example mail addresses
From: John Keeping @ 2012-12-15 15:03 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King
Mail addresses in documentation are converted into mailto: hyperlinks in
the HTML output and footnotes in man pages. This isn't desirable for
cases where the address is used as an example and is not valid.
Particularly annoying is the example "jane@laptop.(none)" which appears
in git-shortlog(1) as "jane@laptop[1].(none)", with note 1 saying:
1. jane@laptop
mailto:jane@laptop
Fix this by quoting example mail addresses with "$$", preventing
Asciidoc from processing them.
In the case of mailmap.txt, render the address monospaced so that it
matches the block examples surrounding that paragraph.
Signed-off-by: John Keeping <john@keeping.me.uk>
---
I can't see any other uses of the "$$" quote in the documentation, so
it's probably worth noting that I've tested this with Asciidoc 8.6.8,
although I can't see anything in the changelog to indicate that
Asciidoc's treatment of it has changed recently.
Documentation/git-fast-import.txt | 2 +-
Documentation/git-tag.txt | 2 +-
Documentation/mailmap.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index d1844ea..05913cc 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -427,7 +427,7 @@ they made it.
Here `<name>` is the person's display name (for example
``Com M Itter'') and `<email>` is the person's email address
-(``cm@example.com''). `LT` and `GT` are the literal less-than (\x3c)
+(``$$cm@example.com$$''). `LT` and `GT` are the literal less-than (\x3c)
and greater-than (\x3e) symbols. These are required to delimit
the email address from the other fields in the line. Note that
`<name>` and `<email>` are free-form and may contain any sequence
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 247534e..ed63edb 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -129,7 +129,7 @@ This option is only applicable when listing tags without annotation lines.
CONFIGURATION
-------------
By default, 'git tag' in sign-with-default mode (-s) will use your
-committer identity (of the form "Your Name <your@email.address>") to
+committer identity (of the form "Your Name $$<your@email.address>$$") to
find a key. If you want to use a different default key, you can specify
it in the repository configuration as follows:
diff --git a/Documentation/mailmap.txt b/Documentation/mailmap.txt
index 288f04e..dd89fca 100644
--- a/Documentation/mailmap.txt
+++ b/Documentation/mailmap.txt
@@ -46,7 +46,7 @@ Jane Doe <jane@desktop.(none)>
Joe R. Developer <joe@example.com>
------------
-Note how there is no need for an entry for <jane@laptop.(none)>, because the
+Note how there is no need for an entry for `<jane@laptop.(none)>`, because the
real name of that author is already correct.
Example 2: Your repository contains commits from the following
--
1.8.0
^ permalink raw reply related
* Re: [PATCH] Documentation: don't link to example mail addresses
From: Jeff King @ 2012-12-15 17:20 UTC (permalink / raw)
To: John Keeping; +Cc: git, Junio C Hamano
In-Reply-To: <20121215150314.GC2725@river.lan>
On Sat, Dec 15, 2012 at 03:03:15PM +0000, John Keeping wrote:
> Mail addresses in documentation are converted into mailto: hyperlinks in
> the HTML output and footnotes in man pages. This isn't desirable for
> cases where the address is used as an example and is not valid.
>
> Particularly annoying is the example "jane@laptop.(none)" which appears
> in git-shortlog(1) as "jane@laptop[1].(none)", with note 1 saying:
>
> 1. jane@laptop
> mailto:jane@laptop
Thanks, this is definitely worth fixing.
> Fix this by quoting example mail addresses with "$$", preventing
> Asciidoc from processing them.
>
> In the case of mailmap.txt, render the address monospaced so that it
> matches the block examples surrounding that paragraph.
I think I'd just render them monospace everywhere. We are very
inconsistent about which form of quotes we use in the documentation (I
think because most of the developers read the source directly and not
the rendered asciidoc). And then we don't have to worry about the "$$"
construct (and IMHO it makes the source much more readable, and marking
the address as a literal looks good in the output, too).
-Peff
^ permalink raw reply
* Re: [PATCH] Makefile: detect when PYTHON_PATH changes
From: Junio C Hamano @ 2012-12-15 17:29 UTC (permalink / raw)
To: Christian Couder; +Cc: git
In-Reply-To: <20121215140719.2409.27365.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
> @@ -2636,6 +2636,18 @@ GIT-GUI-VARS: FORCE
> fi
> endif
>
> +### Detect Python interpreter path changes
> +ifndef NO_PYTHON
> +TRACK_VARS = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')
> +
> +GIT-PYTHON-VARS: FORCE
> + @VARS='$(TRACK_VARS)'; \
> + if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
> + echo 1>&2 " * new Python interpreter location"; \
> + echo "$$VARS" >$@; \
> + fi
> +endif
Do we have the same issue when you decide to use /usr/local/bin/sh
after building with /bin/sh set to SHELL_PATH?
- If yes, I presume that there will be follow-up patches to this
one, for SHELL_PATH, PERL_PATH, and TCLTK_PATH (there may be
other languages but I didn't bother to check). How would the use
of language agnostic looking TRACK_VARS variable in this patch
affect such follow-up patches?
- If no (in other words, if we rebuild shell-scripted porcelains
when SHELL_PATH changes), wouldn't it be better to see how it is
done and hook into the same mechanism?
- If no, and if the approach taken in this patch is better than the
one used to rebuild shell scripts (it may limit the scope of
rebuilding when path changes, or something, but again, I didn't
bother to check), then again follow-up patches to this one to
describe dependencies to build scripts in other languages in a
similar way to this patch would come in the future. The same
question regarding TRACK_VARS applies in this case.
By the way, "1>&2" is easier to read if written as just ">&2", I
think.
Thanks.
^ permalink raw reply
* [PATCH/RFCv2 0/2] compiling git with gcc -O3 -Wuninitialized
From: Jeff King @ 2012-12-15 17:36 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In-Reply-To: <20121215110930.GA23727@sigill.intra.peff.net>
On Sat, Dec 15, 2012 at 06:09:30AM -0500, Jeff King wrote:
> > Does
> >
> > #define error(fmt, ...) (error_impl(fmt, __VA_ARGS__), -1)
> >
> > cause problems when not used in a return statement?
>
> Thanks, that was the cleverness I was missing.
Here it is as patches. One problem with this method is that if the
function implementation ever changes to _not_ return -1, then we get no
warning that our macro and the function implementation have diverged in
meaning.
[1/2]: make error()'s constant return value more visible
[2/2]: silence some -Wuninitialized false positives
These would go on top of 1/3 from the original series to make -Wall -O3
clean (I'll repost the series as a whole when it is more obvious what we
want to do).
-Peff
^ permalink raw reply
* [PATCH 1/2] make error()'s constant return value more visible
From: Jeff King @ 2012-12-15 17:37 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In-Reply-To: <20121215173621.GA21011@sigill.intra.peff.net>
When git is compiled with "gcc -Wuninitialized -O3", some
inlined calls provide an additional opportunity for the
compiler to do static analysis on variable initialization.
For example, with two functions like this:
int get_foo(int *foo)
{
if (something_that_might_fail() < 0)
return error("unable to get foo");
*foo = 0;
return 0;
}
void some_fun(void)
{
int foo;
if (get_foo(&foo) < 0)
return -1;
printf("foo is %d\n", foo);
}
If get_foo() is not inlined, then when compiling some_fun,
gcc sees only that a pointer to the local variable is
passed, and must assume that it is an out parameter that
is initialized after get_foo returns.
However, when get_foo() is inlined, the compiler may look at
all of the code together and see that some code paths in
get_foo() do not initialize the variable. As a result, it
prints a warning. But what the compiler can't see is that
error() always returns -1, and therefore we know that either
we return early from some_fun, or foo ends up initialized,
and the code is safe. The warning is a false positive.
If we can make the compiler aware that error() will always
return -1, it can do a better job of analysis. The simplest
method would be to inline the error() function. However,
this doesn't work, because gcc will not inline a variadc
function. We can work around this by defining a macro. This
relies on two gcc extensions:
1. Variadic macros (these are present in C99, but we do
not rely on that).
2. Gcc treats the "##" paste operator specially between a
comma and __VA_ARGS__, which lets our variadic macro
work even if no format parameters are passed to
error().
Since we are using these extra features, we hide the macro
behind an #ifdef. This is OK, though, because our goal was
just to help gcc.
Signed-off-by: Jeff King <peff@peff.net>
---
git-compat-util.h | 11 +++++++++++
usage.c | 1 +
2 files changed, 12 insertions(+)
diff --git a/git-compat-util.h b/git-compat-util.h
index 2e79b8a..9002bca 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -288,6 +288,17 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)))
extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
+/*
+ * Let callers be aware of the constant return value; this can help
+ * gcc with -Wuninitialized analysis. We have to restrict this trick to
+ * gcc, though, because of the variadic macro and the magic ## comma pasting
+ * behavior. But since we're only trying to help gcc, anyway, it's OK; other
+ * compilers will fall back to using the function as usual.
+ */
+#ifdef __GNUC__
+#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1)
+#endif
+
extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
extern void set_error_routine(void (*routine)(const char *err, va_list params));
diff --git a/usage.c b/usage.c
index 8eab281..40b3de5 100644
--- a/usage.c
+++ b/usage.c
@@ -130,6 +130,7 @@ void NORETURN die_errno(const char *fmt, ...)
va_end(params);
}
+#undef error
int error(const char *err, ...)
{
va_list params;
--
1.8.0.2.4.g59402aa
^ permalink raw reply related
* [PATCH 2/2] silence some -Wuninitialized false positives
From: Jeff King @ 2012-12-15 17:42 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In-Reply-To: <20121215173621.GA21011@sigill.intra.peff.net>
There are a few error functions that simply wrap error() and
provide a standardized message text. Like error(), they
always return -1; knowing that can help the compiler silence
some false positive -Wuninitialized warnings.
One strategy would be to just declare these as inline in the
header file so that the compiler can see that they always
return -1. However, gcc does not always inline them (e.g.,
it will not inline opterror, even with -O3), which renders
our change pointless.
Instead, let's follow the same route we did with error() in
the last patch, and define a macro that makes the constant
return value obvious to the compiler.
Signed-off-by: Jeff King <peff@peff.net>
---
Another option would be to force inlining with
__attribute(always_inline)__. But I don't like that, as we are
affecting the generated code in that case (and any time we are
overriding gcc's decision, I have to assume that it is smarter about
when to inline than we are).
Other variants include:
1. Inline functions, but keep them as one-liners. E.g.:
int opterror(...)
{
real_opterror(...);
return -1;
}
2. Using these macros even when __GNUC__ isn't set. Unlike the
variadic error() macro, these do not use any special features.
If we used them everywhere, the functions themselves could be
converted to a void return. That would make it less likely that
somebody modifying the function in the future would fail to realize
that the error return must always be -1.
I dunno. All the solutions are a bit ugly. I really do like being -Wall
clean, but I wonder if this is spending too much effort to work around
the compiler (we could also just mark these few cases as "int foo =
foo" to say we have manually verified that they're OK).
cache.h | 3 +++
config.c | 1 +
parse-options.c | 18 +++++++++---------
parse-options.h | 4 ++++
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/cache.h b/cache.h
index 18fdd18..0e8e5d8 100644
--- a/cache.h
+++ b/cache.h
@@ -1136,6 +1136,9 @@ extern int config_error_nonbool(const char *);
extern int git_env_bool(const char *, int);
extern int git_config_system(void);
extern int config_error_nonbool(const char *);
+#ifdef __GNUC__
+#define config_error_nonbool(s) (config_error_nonbool(s), -1)
+#endif
extern const char *get_log_output_encoding(void);
extern const char *get_commit_output_encoding(void);
diff --git a/config.c b/config.c
index fb3f868..526f682 100644
--- a/config.c
+++ b/config.c
@@ -1660,6 +1660,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)
* Call this to report error for your variable that should not
* get a boolean value (i.e. "[my] var" means "true").
*/
+#undef config_error_nonbool
int config_error_nonbool(const char *var)
{
return error("Missing value for '%s'", var);
diff --git a/parse-options.c b/parse-options.c
index c1c66bd..67e98a6 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -18,15 +18,6 @@ int optbug(const struct option *opt, const char *reason)
return error("BUG: switch '%c' %s", opt->short_name, reason);
}
-int opterror(const struct option *opt, const char *reason, int flags)
-{
- if (flags & OPT_SHORT)
- return error("switch `%c' %s", opt->short_name, reason);
- if (flags & OPT_UNSET)
- return error("option `no-%s' %s", opt->long_name, reason);
- return error("option `%s' %s", opt->long_name, reason);
-}
-
static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt,
int flags, const char **arg)
{
@@ -594,3 +585,12 @@ static int parse_options_usage(struct parse_opt_ctx_t *ctx,
return usage_with_options_internal(ctx, usagestr, opts, 0, err);
}
+#undef opterror
+int opterror(const struct option *opt, const char *reason, int flags)
+{
+ if (flags & OPT_SHORT)
+ return error("switch `%c' %s", opt->short_name, reason);
+ if (flags & OPT_UNSET)
+ return error("option `no-%s' %s", opt->long_name, reason);
+ return error("option `%s' %s", opt->long_name, reason);
+}
diff --git a/parse-options.h b/parse-options.h
index 71a39c6..e703853 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -177,6 +177,10 @@ extern int opterror(const struct option *opt, const char *reason, int flags);
extern int optbug(const struct option *opt, const char *reason);
extern int opterror(const struct option *opt, const char *reason, int flags);
+#ifdef __GNUC__
+#define opterror(o,r,f) (opterror((o),(r),(f)), -1)
+#endif
+
/*----- incremental advanced APIs -----*/
enum {
--
1.8.0.2.4.g59402aa
^ permalink raw reply related
* [PATCH] completion: complete refs for "git commit -c"
From: Jeff King @ 2012-12-15 17:46 UTC (permalink / raw)
To: git
The "-c" and "-C" options take an existing commit, so let's
complete refs, just as we would for --squash or --fixup.
Signed-off-by: Jeff King <peff@peff.net>
---
I notice that the existing code just handles the "--foo=bar" form of most
options. By checking $prev, we can also handle "--foo bar" form (which
we have to do for short options like "-c"). But it would mean
duplicating all of the existing logic. I don't know if it's worth it or
not, given that nobody has complained.
contrib/completion/git-completion.bash | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0b77eb1..a4c48e1 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -971,6 +971,13 @@ _git_commit ()
{
__git_has_doubledash && return
+ case "$prev" in
+ -c|-C)
+ __gitcomp_nl "$(__git_refs)" "" "${cur}"
+ return
+ ;;
+ esac
+
case "$cur" in
--cleanup=*)
__gitcomp "default strip verbatim whitespace
--
1.8.0.2.4.g59402aa
^ permalink raw reply related
* Re: [PATCH 1/4] Support builds when sys/param.h is missing
From: Junio C Hamano @ 2012-12-15 17:53 UTC (permalink / raw)
To: David Michael; +Cc: git@vger.kernel.org
In-Reply-To: <CAEvUa7kZE-p0oVV+JpXY4y-=ieB-=THTrO4hxzZsFYhLvgvbFw@mail.gmail.com>
David Michael <fedora.dm0@gmail.com> writes:
> On Fri, Dec 14, 2012 at 6:41 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> I have this suspicion that nobody would notice if we simply stopped
>> including the header.
>
> While I'm not aware of any subtleties it could be causing on other
> platforms, it does seem fine to drop sys/param.h on my test GNU/Linux
> systems.
>
> I can resend the series and just remove the include, if preferred.
I am sure the patch as posted is much safer, but I was hoping that
folks on non-Linux platforms may say "I tried to compile with the
include removed, and I get identical binaries from before". Until
that happens, I would prefer queuing your patch as-is.
Thanks.
^ permalink raw reply
* Re: [PATCH] git.c: add --index-file command-line option.
From: Junio C Hamano @ 2012-12-15 18:02 UTC (permalink / raw)
To: Manlio Perillo; +Cc: git
In-Reply-To: <1355484219-7517-1-git-send-email-manlio.perillo@gmail.com>
Manlio Perillo <manlio.perillo@gmail.com> writes:
> Unlike other environment variables (e.g. GIT_WORK_TREE,
> GIT_NAMESPACE), it was not possible to set the GIT_INDEX_FILE
> environment variable using the command line.
Is this necessary? I'd prefer to see a better reason than "just
because others have it".
^ permalink raw reply
* Re: [PATCH] Documentation: don't link to example mail addresses
From: Junio C Hamano @ 2012-12-15 18:00 UTC (permalink / raw)
To: Jeff King; +Cc: John Keeping, git
In-Reply-To: <20121215172018.GA18696@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I think I'd just render them monospace everywhere. We are very
> inconsistent about which form of quotes we use in the documentation (I
> think because most of the developers read the source directly and not
> the rendered asciidoc). And then we don't have to worry about the "$$"
> construct (and IMHO it makes the source much more readable, and marking
> the address as a literal looks good in the output, too).
Agreed---thanks for spotting, John, and thanks for showing the
overall direction, Peff.
^ permalink raw reply
* [PATCH v2 1/7] Use split_ident_line to parse author and committer
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
Currently blame.c::get_acline, pretty.c::pp_user_info() and
shortlog.c::insert_one_record are parsing author name, email, time and
tz themselves.
Use ident.c::split_ident_line for better code reuse.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
builtin/blame.c | 59 +++++++++++++++++++---------------------------------
builtin/shortlog.c | 36 +++++++++-----------------------
pretty.c | 35 ++++++++++++++++++-------------
3 files changed, 52 insertions(+), 78 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index cfae569..dd4aff9 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1343,8 +1343,9 @@ static void get_ac_line(const char *inbuf, const char *what,
int mail_len, char *mail,
unsigned long *time, const char **tz)
{
- int len, tzlen, maillen;
- char *tmp, *endp, *timepos, *mailpos;
+ struct ident_split ident;
+ int len, tzlen, maillen, namelen;
+ char *tmp, *endp, *mailpos;
tmp = strstr(inbuf, what);
if (!tmp)
@@ -1355,7 +1356,10 @@ static void get_ac_line(const char *inbuf, const char *what,
len = strlen(tmp);
else
len = endp - tmp;
- if (person_len <= len) {
+ if (person_len <= len)
+ goto error_out;
+
+ if (split_ident_line(&ident, tmp, len)) {
error_out:
/* Ugh */
*tz = "(unknown)";
@@ -1364,47 +1368,26 @@ static void get_ac_line(const char *inbuf, const char *what,
*time = 0;
return;
}
- memcpy(person, tmp, len);
- tmp = person;
- tmp += len;
- *tmp = 0;
- while (person < tmp && *tmp != ' ')
- tmp--;
- if (tmp <= person)
- goto error_out;
- *tz = tmp+1;
- tzlen = (person+len)-(tmp+1);
+ namelen = ident.name_end - ident.name_begin;
+ memcpy(person, ident.name_begin, namelen);
+ person[namelen] = 0;
- *tmp = 0;
- while (person < tmp && *tmp != ' ')
- tmp--;
- if (tmp <= person)
- goto error_out;
- *time = strtoul(tmp, NULL, 10);
- timepos = tmp;
+ maillen = ident.mail_end - ident.mail_begin + 2;
+ memcpy(mail, ident.mail_begin - 1, maillen);
+ mail[maillen] = 0;
- *tmp = 0;
- while (person < tmp && !(*tmp == ' ' && tmp[1] == '<'))
- tmp--;
- if (tmp <= person)
- return;
- mailpos = tmp + 1;
- *tmp = 0;
- maillen = timepos - tmp;
- memcpy(mail, mailpos, maillen);
+ *time = strtoul(ident.date_begin, NULL, 10);
- if (!mailmap.nr)
- return;
+ tzlen = ident.tz_end - ident.tz_begin;
- /*
- * mailmap expansion may make the name longer.
- * make room by pushing stuff down.
- */
- tmp = person + person_len - (tzlen + 1);
- memmove(tmp, *tz, tzlen);
+ /* Place tz at the end of person */
+ *tz = tmp = person + person_len - (tzlen + 1);
+ memcpy(tmp, ident.tz_begin, tzlen);
tmp[tzlen] = 0;
- *tz = tmp;
+
+ if (!mailmap.nr)
+ return;
/*
* Now, convert both name and e-mail using mailmap
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index b316cf3..03c6cd7 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -40,40 +40,24 @@ static void insert_one_record(struct shortlog *log,
char emailbuf[1024];
size_t len;
const char *eol;
- const char *boemail, *eoemail;
struct strbuf subject = STRBUF_INIT;
+ struct ident_split ident;
- boemail = strchr(author, '<');
- if (!boemail)
- return;
- eoemail = strchr(boemail, '>');
- if (!eoemail)
+ if (split_ident_line(&ident, author, strlen(author)))
return;
/* copy author name to namebuf, to support matching on both name and email */
- memcpy(namebuf, author, boemail - author);
- len = boemail - author;
- while (len > 0 && isspace(namebuf[len-1]))
- len--;
+ len = ident.name_end - ident.name_begin;
+ memcpy(namebuf, ident.name_begin, len);
namebuf[len] = 0;
/* copy email name to emailbuf, to allow email replacement as well */
- memcpy(emailbuf, boemail+1, eoemail - boemail);
- emailbuf[eoemail - boemail - 1] = 0;
-
- if (!map_user(&log->mailmap, emailbuf, sizeof(emailbuf), namebuf, sizeof(namebuf))) {
- while (author < boemail && isspace(*author))
- author++;
- for (len = 0;
- len < sizeof(namebuf) - 1 && author + len < boemail;
- len++)
- namebuf[len] = author[len];
- while (0 < len && isspace(namebuf[len-1]))
- len--;
- namebuf[len] = '\0';
- }
- else
- len = strlen(namebuf);
+ len = ident.mail_end - ident.mail_begin;
+ memcpy(emailbuf, ident.mail_begin, len);
+ emailbuf[len] = 0;
+
+ map_user(&log->mailmap, emailbuf, sizeof(emailbuf), namebuf, sizeof(namebuf));
+ len = strlen(namebuf);
if (log->email) {
size_t room = sizeof(namebuf) - len - 1;
diff --git a/pretty.c b/pretty.c
index 5bdc2e7..350d1df 100644
--- a/pretty.c
+++ b/pretty.c
@@ -387,29 +387,36 @@ void pp_user_info(const struct pretty_print_context *pp,
const char *what, struct strbuf *sb,
const char *line, const char *encoding)
{
+ struct ident_split ident;
+ int linelen, namelen;
+ char *line_end, *date;
int max_length = 78; /* per rfc2822 */
- char *date;
- int namelen;
unsigned long time;
int tz;
if (pp->fmt == CMIT_FMT_ONELINE)
return;
- date = strchr(line, '>');
- if (!date)
+
+ line_end = strchr(line, '\n');
+ if (!line_end) {
+ line_end = strchr(line, '\0');
+ if (!line_end)
+ return;
+ }
+
+ linelen = ++line_end - line;
+ if (split_ident_line(&ident, line, linelen))
return;
- namelen = ++date - line;
- time = strtoul(date, &date, 10);
+
+ namelen = ident.mail_end - ident.name_begin + 1;
+ time = strtoul(ident.date_begin, &date, 10);
tz = strtol(date, NULL, 10);
if (pp->fmt == CMIT_FMT_EMAIL) {
- char *name_tail = strchr(line, '<');
int display_name_length;
- if (!name_tail)
- return;
- while (line < name_tail && isspace(name_tail[-1]))
- name_tail--;
- display_name_length = name_tail - line;
+
+ display_name_length = ident.name_end - ident.name_begin;
+
strbuf_addstr(sb, "From: ");
if (needs_rfc2047_encoding(line, display_name_length, RFC2047_ADDRESS)) {
add_rfc2047(sb, line, display_name_length,
@@ -427,10 +434,10 @@ void pp_user_info(const struct pretty_print_context *pp,
}
if (namelen - display_name_length + last_line_length(sb) > max_length) {
strbuf_addch(sb, '\n');
- if (!isspace(name_tail[0]))
+ if (!isspace(ident.name_end[0]))
strbuf_addch(sb, ' ');
}
- strbuf_add(sb, name_tail, namelen - display_name_length);
+ strbuf_add(sb, ident.name_end, namelen - display_name_length);
strbuf_addch(sb, '\n');
} else {
strbuf_addf(sb, "%s: %.*s%.*s\n", what,
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 2/7] mailmap: Remove buffer length limit in map_user
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
Remove the hard limit set by mail buffer in map_user and
use the strbuf API to replace it.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
mailmap.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/mailmap.c b/mailmap.c
index ea4b471..3bc6491 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -193,7 +193,7 @@ int map_user(struct string_list *map,
char *end_of_email;
struct string_list_item *item;
struct mailmap_entry *me;
- char buf[1024], *mailbuf;
+ struct strbuf mailbuf = STRBUF_INIT;
int i;
/* figure out space requirement for email */
@@ -204,18 +204,14 @@ int map_user(struct string_list *map,
if (!end_of_email)
return 0;
}
- if (end_of_email - email + 1 < sizeof(buf))
- mailbuf = buf;
- else
- mailbuf = xmalloc(end_of_email - email + 1);
/* downcase the email address */
+ strbuf_grow(&mailbuf, end_of_email - email);
for (i = 0; i < end_of_email - email; i++)
- mailbuf[i] = tolower(email[i]);
- mailbuf[i] = 0;
+ strbuf_addch(&mailbuf, tolower(email[i]));
- debug_mm("map_user: map '%s' <%s>\n", name, mailbuf);
- item = string_list_lookup(map, mailbuf);
+ debug_mm("map_user: map '%s' <%s>\n", name, mailbuf.buf);
+ item = string_list_lookup(map, mailbuf.buf);
if (item != NULL) {
me = (struct mailmap_entry *)item->util;
if (me->namemap.nr) {
@@ -226,8 +222,7 @@ int map_user(struct string_list *map,
item = subitem;
}
}
- if (mailbuf != buf)
- free(mailbuf);
+ strbuf_release(&mailbuf);
if (item != NULL) {
struct mailmap_info *mi = (struct mailmap_info *)item->util;
if (mi->name == NULL && (mi->email == NULL || maxlen_email == 0)) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 0/7] Allow git log to use mailmap file
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
Implement the feature suggested by Rich Mindwinter and Junio C Hamano
(and following his advices)
Allows git show/log commands to map author and committer
names and emails using the mailmap file.
Updates related to this second series:
- All tests are successful after each patch
- Use split_ident_line in shortlog.c
- Documentation has been added to git-log.txt
- Test has been added to check that we use the file
- Lots of improvements in the way strbufs are used
- New interface to map_user()
- Bunch of other fixes
git glog --committer/--author is still not looking for mailmap user
names.
Antoine Pelisse (7):
Use split_ident_line to parse author and committer
mailmap: Remove buffer length limit in map_user
mailmap: Simplify map_user() interface
mailmap: Add mailmap structure to rev_info and pp
pretty: Use mailmap to display username and email
log: Add --use-mailmap option
test: Add test for --use-mailmap option
Documentation/git-log.txt | 5 ++
builtin/blame.c | 189 +++++++++++++++++++++------------------------
builtin/log.c | 9 ++-
builtin/shortlog.c | 53 ++++---------
commit.h | 1 +
log-tree.c | 1 +
mailmap.c | 56 ++++++--------
mailmap.h | 4 +-
pretty.c | 111 ++++++++++++++------------
revision.h | 1 +
t/t4203-mailmap.sh | 14 ++++
11 files changed, 219 insertions(+), 225 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH v2 3/7] mailmap: Simplify map_user() interface
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
mailmap.c::map_user() is simplified to take two strbuf parameters
instead of statically allocated buffers.
The buffers are still modified in-place, when mapping is required.
It actually makes things easier for callers:
- Caller must prepare the call by copying author name and email in
strbuf (instead of copying in static buffer)
- Caller can easily manipulate the buffer afterward.
- Caller doesn't have to call strlen() to calculate the size of the
new string.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
builtin/blame.c | 164 +++++++++++++++++++++++++++-------------------------
builtin/shortlog.c | 31 ++++------
mailmap.c | 51 ++++++++--------
mailmap.h | 4 +-
pretty.c | 40 ++++++-------
5 files changed, 139 insertions(+), 151 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index dd4aff9..8586850 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1321,31 +1321,30 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
* Information on commits, used for output.
*/
struct commit_info {
- const char *author;
- const char *author_mail;
+ struct strbuf author;
+ struct strbuf author_mail;
unsigned long author_time;
- const char *author_tz;
+ struct strbuf author_tz;
/* filled only when asked for details */
- const char *committer;
- const char *committer_mail;
+ struct strbuf committer;
+ struct strbuf committer_mail;
unsigned long committer_time;
- const char *committer_tz;
+ struct strbuf committer_tz;
- const char *summary;
+ struct strbuf summary;
};
/*
* Parse author/committer line in the commit object buffer
*/
static void get_ac_line(const char *inbuf, const char *what,
- int person_len, char *person,
- int mail_len, char *mail,
- unsigned long *time, const char **tz)
+ struct strbuf *name, struct strbuf *mail,
+ unsigned long *time, struct strbuf *tz)
{
struct ident_split ident;
- int len, tzlen, maillen, namelen;
- char *tmp, *endp, *mailpos;
+ int len;
+ char *tmp, *endp;
tmp = strstr(inbuf, what);
if (!tmp)
@@ -1356,51 +1355,61 @@ static void get_ac_line(const char *inbuf, const char *what,
len = strlen(tmp);
else
len = endp - tmp;
- if (person_len <= len)
- goto error_out;
if (split_ident_line(&ident, tmp, len)) {
error_out:
/* Ugh */
- *tz = "(unknown)";
- strcpy(person, *tz);
- strcpy(mail, *tz);
+ tmp = "(unknown)";
+ strbuf_addstr(name, tmp);
+ strbuf_addstr(mail, tmp);
+ strbuf_addstr(tz, tmp);
*time = 0;
return;
}
- namelen = ident.name_end - ident.name_begin;
- memcpy(person, ident.name_begin, namelen);
- person[namelen] = 0;
+ len = ident.name_end - ident.name_begin;
+ strbuf_add(name, ident.name_begin, len);
- maillen = ident.mail_end - ident.mail_begin + 2;
- memcpy(mail, ident.mail_begin - 1, maillen);
- mail[maillen] = 0;
+ len = ident.mail_end - ident.mail_begin;
+ strbuf_add(mail, ident.mail_begin, len);
*time = strtoul(ident.date_begin, NULL, 10);
- tzlen = ident.tz_end - ident.tz_begin;
+ len = ident.tz_end - ident.tz_begin;
+ strbuf_add(tz, ident.tz_begin, len);
- /* Place tz at the end of person */
- *tz = tmp = person + person_len - (tzlen + 1);
- memcpy(tmp, ident.tz_begin, tzlen);
- tmp[tzlen] = 0;
-
- if (!mailmap.nr)
- return;
-
- /*
+ /*
* Now, convert both name and e-mail using mailmap
*/
- if (map_user(&mailmap, mail+1, mail_len-1, person, tmp-person-1)) {
- /* Add a trailing '>' to email, since map_user returns plain emails
- Note: It already has '<', since we replace from mail+1 */
- mailpos = memchr(mail, '\0', mail_len);
- if (mailpos && mailpos-mail < mail_len - 1) {
- *mailpos = '>';
- *(mailpos+1) = '\0';
- }
- }
+ if (mailmap.nr)
+ map_user(&mailmap, mail, name);
+
+ strbuf_insert(mail, 0, "<", 1);
+ strbuf_addch(mail, '>');
+}
+
+static void commit_info_init(struct commit_info *ci)
+{
+
+ strbuf_init(&ci->author, 0);
+ strbuf_init(&ci->author_mail, 0);
+ strbuf_init(&ci->author_tz, 0);
+ strbuf_init(&ci->committer, 0);
+ strbuf_init(&ci->committer_mail, 0);
+ strbuf_init(&ci->committer_tz, 0);
+ strbuf_init(&ci->summary, 0);
+}
+
+static void commit_info_destroy(struct commit_info *ci)
+{
+
+ strbuf_release(&ci->author);
+ strbuf_release(&ci->author_mail);
+ strbuf_release(&ci->author_tz);
+ strbuf_release(&ci->committer);
+ strbuf_release(&ci->committer_mail);
+ strbuf_release(&ci->committer_tz);
+ strbuf_release(&ci->summary);
}
static void get_commit_info(struct commit *commit,
@@ -1410,11 +1419,8 @@ static void get_commit_info(struct commit *commit,
int len;
const char *subject, *encoding;
char *reencoded, *message;
- static char author_name[1024];
- static char author_mail[1024];
- static char committer_name[1024];
- static char committer_mail[1024];
- static char summary_buf[1024];
+
+ commit_info_init(ret);
/*
* We've operated without save_commit_buffer, so
@@ -1432,11 +1438,7 @@ static void get_commit_info(struct commit *commit,
encoding = get_log_output_encoding();
reencoded = logmsg_reencode(commit, encoding);
message = reencoded ? reencoded : commit->buffer;
- ret->author = author_name;
- ret->author_mail = author_mail;
- get_ac_line(message, "\nauthor ",
- sizeof(author_name), author_name,
- sizeof(author_mail), author_mail,
+ get_ac_line(message, "\nauthor ", &ret->author, &ret->author_mail,
&ret->author_time, &ret->author_tz);
if (!detailed) {
@@ -1444,21 +1446,16 @@ static void get_commit_info(struct commit *commit,
return;
}
- ret->committer = committer_name;
- ret->committer_mail = committer_mail;
- get_ac_line(message, "\ncommitter ",
- sizeof(committer_name), committer_name,
- sizeof(committer_mail), committer_mail,
- &ret->committer_time, &ret->committer_tz);
+ get_ac_line(message, "\ncommitter ", &ret->committer,
+ &ret->committer_mail, &ret->committer_time,
+ &ret->committer_tz);
- ret->summary = summary_buf;
len = find_commit_subject(message, &subject);
- if (len && len < sizeof(summary_buf)) {
- memcpy(summary_buf, subject, len);
- summary_buf[len] = 0;
- } else {
- sprintf(summary_buf, "(%s)", sha1_to_hex(commit->object.sha1));
- }
+ if (len)
+ strbuf_add(&ret->summary, subject, len);
+ else
+ strbuf_addf(&ret->summary, "(%s)", sha1_to_hex(commit->object.sha1));
+
free(reencoded);
}
@@ -1487,15 +1484,15 @@ static int emit_one_suspect_detail(struct origin *suspect, int repeat)
suspect->commit->object.flags |= METAINFO_SHOWN;
get_commit_info(suspect->commit, &ci, 1);
- printf("author %s\n", ci.author);
- printf("author-mail %s\n", ci.author_mail);
+ printf("author %s\n", ci.author.buf);
+ printf("author-mail %s\n", ci.author_mail.buf);
printf("author-time %lu\n", ci.author_time);
- printf("author-tz %s\n", ci.author_tz);
- printf("committer %s\n", ci.committer);
- printf("committer-mail %s\n", ci.committer_mail);
+ printf("author-tz %s\n", ci.author_tz.buf);
+ printf("committer %s\n", ci.committer.buf);
+ printf("committer-mail %s\n", ci.committer_mail.buf);
printf("committer-time %lu\n", ci.committer_time);
- printf("committer-tz %s\n", ci.committer_tz);
- printf("summary %s\n", ci.summary);
+ printf("committer-tz %s\n", ci.committer_tz.buf);
+ printf("summary %s\n", ci.summary.buf);
if (suspect->commit->object.flags & UNINTERESTING)
printf("boundary\n");
if (suspect->previous) {
@@ -1503,6 +1500,9 @@ static int emit_one_suspect_detail(struct origin *suspect, int repeat)
printf("previous %s ", sha1_to_hex(prev->commit->object.sha1));
write_name_quoted(prev->path, stdout, '\n');
}
+
+ commit_info_destroy(&ci);
+
return 1;
}
@@ -1689,11 +1689,11 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
if (opt & OUTPUT_ANNOTATE_COMPAT) {
const char *name;
if (opt & OUTPUT_SHOW_EMAIL)
- name = ci.author_mail;
+ name = ci.author_mail.buf;
else
- name = ci.author;
+ name = ci.author.buf;
printf("\t(%10s\t%10s\t%d)", name,
- format_time(ci.author_time, ci.author_tz,
+ format_time(ci.author_time, ci.author_tz.buf,
show_raw_time),
ent->lno + 1 + cnt);
} else {
@@ -1712,14 +1712,14 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
const char *name;
int pad;
if (opt & OUTPUT_SHOW_EMAIL)
- name = ci.author_mail;
+ name = ci.author_mail.buf;
else
- name = ci.author;
+ name = ci.author.buf;
pad = longest_author - utf8_strwidth(name);
printf(" (%s%*s %10s",
name, pad, "",
format_time(ci.author_time,
- ci.author_tz,
+ ci.author_tz.buf,
show_raw_time));
}
printf(" %*d) ",
@@ -1734,6 +1734,8 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
if (sb->final_buf_size && cp[-1] != '\n')
putchar('\n');
+
+ commit_info_destroy(&ci);
}
static void output(struct scoreboard *sb, int option)
@@ -1858,9 +1860,9 @@ static void find_alignment(struct scoreboard *sb, int *option)
suspect->commit->object.flags |= METAINFO_SHOWN;
get_commit_info(suspect->commit, &ci, 1);
if (*option & OUTPUT_SHOW_EMAIL)
- num = utf8_strwidth(ci.author_mail);
+ num = utf8_strwidth(ci.author_mail.buf);
else
- num = utf8_strwidth(ci.author);
+ num = utf8_strwidth(ci.author.buf);
if (longest_author < num)
longest_author = num;
}
@@ -1872,6 +1874,8 @@ static void find_alignment(struct scoreboard *sb, int *option)
longest_dst_lines = num;
if (largest_score < ent_score(sb, e))
largest_score = ent_score(sb, e);
+
+ commit_info_destroy(&ci);
}
max_orig_digits = decimal_width(longest_src_lines);
max_digits = decimal_width(longest_dst_lines);
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 03c6cd7..20e8599 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -36,39 +36,30 @@ static void insert_one_record(struct shortlog *log,
const char *dot3 = log->common_repo_prefix;
char *buffer, *p;
struct string_list_item *item;
- char namebuf[1024];
- char emailbuf[1024];
- size_t len;
const char *eol;
struct strbuf subject = STRBUF_INIT;
+ struct strbuf name = STRBUF_INIT;
+ struct strbuf mail = STRBUF_INIT;
struct ident_split ident;
if (split_ident_line(&ident, author, strlen(author)))
return;
- /* copy author name to namebuf, to support matching on both name and email */
- len = ident.name_end - ident.name_begin;
- memcpy(namebuf, ident.name_begin, len);
- namebuf[len] = 0;
+ strbuf_add(&mail, ident.mail_begin, ident.mail_end - ident.mail_begin);
+ strbuf_add(&name, ident.name_begin, ident.name_end - ident.name_begin);
- /* copy email name to emailbuf, to allow email replacement as well */
- len = ident.mail_end - ident.mail_begin;
- memcpy(emailbuf, ident.mail_begin, len);
- emailbuf[len] = 0;
+ map_user(&log->mailmap, &mail, &name);
- map_user(&log->mailmap, emailbuf, sizeof(emailbuf), namebuf, sizeof(namebuf));
- len = strlen(namebuf);
+ if (log->email)
+ strbuf_addf(&name, " <%s>", mail.buf);
- if (log->email) {
- size_t room = sizeof(namebuf) - len - 1;
- int maillen = strlen(emailbuf);
- snprintf(namebuf + len, room, " <%.*s>", maillen, emailbuf);
- }
-
- item = string_list_insert(&log->list, namebuf);
+ item = string_list_insert(&log->list, name.buf);
if (item->util == NULL)
item->util = xcalloc(1, sizeof(struct string_list));
+ strbuf_release(&name);
+ strbuf_release(&mail);
+
/* Skip any leading whitespace, including any blank lines. */
while (*oneline && isspace(*oneline))
oneline++;
diff --git a/mailmap.c b/mailmap.c
index 3bc6491..d5bffc6 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -187,57 +187,52 @@ void clear_mailmap(struct string_list *map)
debug_mm("mailmap: cleared\n");
}
-int map_user(struct string_list *map,
- char *email, int maxlen_email, char *name, int maxlen_name)
+int map_user(struct string_list *map, struct strbuf *mail, struct strbuf *name)
{
- char *end_of_email;
+
struct string_list_item *item;
struct mailmap_entry *me;
- struct strbuf mailbuf = STRBUF_INIT;
+ struct strbuf lowermail = STRBUF_INIT;
int i;
- /* figure out space requirement for email */
- end_of_email = strchr(email, '>');
- if (!end_of_email) {
- /* email passed in might not be wrapped in <>, but end with a \0 */
- end_of_email = memchr(email, '\0', maxlen_email);
- if (!end_of_email)
- return 0;
- }
-
/* downcase the email address */
- strbuf_grow(&mailbuf, end_of_email - email);
- for (i = 0; i < end_of_email - email; i++)
- strbuf_addch(&mailbuf, tolower(email[i]));
+ strbuf_grow(&lowermail, mail->len);
+ for (i = 0; i < mail->len; i++)
+ strbuf_addch(&lowermail, tolower(mail->buf[i]));
- debug_mm("map_user: map '%s' <%s>\n", name, mailbuf.buf);
- item = string_list_lookup(map, mailbuf.buf);
+ debug_mm("map_user: map '%s' <%s>\n", name->buf, lowermail.buf);
+ item = string_list_lookup(map, lowermail.buf);
if (item != NULL) {
me = (struct mailmap_entry *)item->util;
if (me->namemap.nr) {
/* The item has multiple items, so we'll look up on name too */
/* If the name is not found, we choose the simple entry */
- struct string_list_item *subitem = string_list_lookup(&me->namemap, name);
+ struct string_list_item *subitem = string_list_lookup(&me->namemap, name->buf);
if (subitem)
item = subitem;
}
}
- strbuf_release(&mailbuf);
+ strbuf_release(&lowermail);
if (item != NULL) {
struct mailmap_info *mi = (struct mailmap_info *)item->util;
- if (mi->name == NULL && (mi->email == NULL || maxlen_email == 0)) {
+ if (mi->name == NULL && mi->email == NULL) {
debug_mm("map_user: -- (no simple mapping)\n");
return 0;
}
- if (maxlen_email && mi->email)
- strlcpy(email, mi->email, maxlen_email);
- else
- *end_of_email = '\0';
- if (maxlen_name && mi->name)
- strlcpy(name, mi->name, maxlen_name);
- debug_mm("map_user: to '%s' <%s>\n", name, mi->email ? mi->email : "");
+ if (mi->email) {
+ strbuf_reset(mail);
+ strbuf_addstr(mail, mi->email);
+ }
+
+ if (mi->name) {
+ strbuf_reset(name);
+ strbuf_addstr(name, mi->name);
+ }
+
+ debug_mm("map_user: to '%s' <%s>\n", name->buf, mi->email ? mi->email : "");
return 1;
}
+
debug_mm("map_user: --\n");
return 0;
}
diff --git a/mailmap.h b/mailmap.h
index d5c3664..88dca51 100644
--- a/mailmap.h
+++ b/mailmap.h
@@ -4,7 +4,5 @@
int read_mailmap(struct string_list *map, char **repo_abbrev);
void clear_mailmap(struct string_list *map);
-int map_user(struct string_list *mailmap,
- char *email, int maxlen_email, char *name, int maxlen_name);
-
+int map_user(struct string_list *map, struct strbuf *name, struct strbuf *mail);
#endif
diff --git a/pretty.c b/pretty.c
index 350d1df..d05c675 100644
--- a/pretty.c
+++ b/pretty.c
@@ -593,14 +593,14 @@ char *logmsg_reencode(const struct commit *commit,
return out;
}
-static int mailmap_name(char *email, int email_len, char *name, int name_len)
+static int mailmap_name(struct strbuf *mail, struct strbuf *name)
{
static struct string_list *mail_map;
if (!mail_map) {
mail_map = xcalloc(1, sizeof(*mail_map));
read_mailmap(mail_map, NULL);
}
- return mail_map->nr && map_user(mail_map, email, email_len, name, name_len);
+ return mail_map->nr && map_user(mail_map, mail, name);
}
static size_t format_person_part(struct strbuf *sb, char part,
@@ -610,39 +610,39 @@ static size_t format_person_part(struct strbuf *sb, char part,
const int placeholder_len = 2;
int tz;
unsigned long date = 0;
- char person_name[1024];
- char person_mail[1024];
+ struct strbuf person_name = STRBUF_INIT;
+ struct strbuf person_mail = STRBUF_INIT;
struct ident_split s;
- const char *name_start, *name_end, *mail_start, *mail_end;
if (split_ident_line(&s, msg, len) < 0)
goto skip;
- name_start = s.name_begin;
- name_end = s.name_end;
- mail_start = s.mail_begin;
- mail_end = s.mail_end;
+ strbuf_add(&person_name, s.name_begin, (int)(s.name_end - s.name_begin));
+ strbuf_add(&person_mail, s.mail_begin, (int)(s.mail_end - s.mail_begin));
if (part == 'N' || part == 'E') { /* mailmap lookup */
- snprintf(person_name, sizeof(person_name), "%.*s",
- (int)(name_end - name_start), name_start);
- snprintf(person_mail, sizeof(person_mail), "%.*s",
- (int)(mail_end - mail_start), mail_start);
- mailmap_name(person_mail, sizeof(person_mail), person_name, sizeof(person_name));
- name_start = person_name;
- name_end = name_start + strlen(person_name);
- mail_start = person_mail;
- mail_end = mail_start + strlen(person_mail);
+ mailmap_name(&person_mail, &person_name);
}
if (part == 'n' || part == 'N') { /* name */
- strbuf_add(sb, name_start, name_end-name_start);
+ strbuf_addbuf(sb, &person_name);
+
+ strbuf_release(&person_name);
+ strbuf_release(&person_mail);
+
return placeholder_len;
}
if (part == 'e' || part == 'E') { /* email */
- strbuf_add(sb, mail_start, mail_end-mail_start);
+ strbuf_addbuf(sb, &person_mail);
+
+ strbuf_release(&person_name);
+ strbuf_release(&person_mail);
+
return placeholder_len;
}
+ strbuf_release(&person_name);
+ strbuf_release(&person_mail);
+
if (!s.date_begin)
goto skip;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 4/7] mailmap: Add mailmap structure to rev_info and pp
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
the mailmap string_list structure filled with mailmap
information is passed along from rev_info to pretty_print_context
to provide mailmap information to pretty print each commits
with the correct username and email.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
commit.h | 1 +
log-tree.c | 1 +
revision.h | 1 +
3 files changed, 3 insertions(+)
diff --git a/commit.h b/commit.h
index b6ad8f3..7f8f987 100644
--- a/commit.h
+++ b/commit.h
@@ -89,6 +89,7 @@ struct pretty_print_context {
char *notes_message;
struct reflog_walk_info *reflog_info;
const char *output_encoding;
+ struct string_list *mailmap;
};
struct userformat_want {
diff --git a/log-tree.c b/log-tree.c
index 4f86def..92254fd 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -671,6 +671,7 @@ void show_log(struct rev_info *opt)
ctx.preserve_subject = opt->preserve_subject;
ctx.reflog_info = opt->reflog_info;
ctx.fmt = opt->commit_format;
+ ctx.mailmap = opt->mailmap;
pretty_print_commit(&ctx, commit, &msgbuf);
if (opt->add_signoff)
diff --git a/revision.h b/revision.h
index 059bfff..83a79f5 100644
--- a/revision.h
+++ b/revision.h
@@ -143,6 +143,7 @@ struct rev_info {
const char *subject_prefix;
int no_inline;
int show_log_size;
+ struct string_list *mailmap;
/* Filter by commit log message */
struct grep_opt grep_filter;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 7/7] test: Add test for --use-mailmap option
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
The new option '--use-mailmap' can be used to make
sure that mailmap file is used to convert name
when running log commands.
The test is simple and checks that the Author line
is correctly replaced when running log.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
t/t4203-mailmap.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 1f182f6..db043dc 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -239,6 +239,20 @@ test_expect_success 'Log output (complex mapping)' '
test_cmp expect actual
'
+cat >expect <<\EOF
+Author: CTO <cto@company.xx>
+Author: Santa Claus <santa.claus@northpole.xx>
+Author: Santa Claus <santa.claus@northpole.xx>
+Author: Other Author <other@author.xx>
+Author: Other Author <other@author.xx>
+Author: Some Dude <some@dude.xx>
+Author: A U Thor <author@example.com>
+EOF
+test_expect_success 'Log output with --use-mailmap' '
+ git log --use-mailmap | grep Author >actual &&
+ test_cmp expect actual
+'
+
# git blame
cat >expect <<\EOF
^OBJI (A U Thor DATE 1) one
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 5/7] pretty: Use mailmap to display username and email
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
Use the mailmap information to display the correct
username and email address in all log commands.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
pretty.c | 48 ++++++++++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 20 deletions(-)
diff --git a/pretty.c b/pretty.c
index d05c675..fbf87b7 100644
--- a/pretty.c
+++ b/pretty.c
@@ -387,6 +387,8 @@ void pp_user_info(const struct pretty_print_context *pp,
const char *what, struct strbuf *sb,
const char *line, const char *encoding)
{
+ struct strbuf name;
+ struct strbuf mail;
struct ident_split ident;
int linelen, namelen;
char *line_end, *date;
@@ -408,42 +410,48 @@ void pp_user_info(const struct pretty_print_context *pp,
if (split_ident_line(&ident, line, linelen))
return;
- namelen = ident.mail_end - ident.name_begin + 1;
+ strbuf_init(&mail, 0);
+ strbuf_init(&name, 0);
+
+ strbuf_add(&mail, ident.mail_begin, ident.mail_end - ident.mail_begin);
+ strbuf_add(&name, ident.name_begin, ident.name_end - ident.name_begin);
+
+ if (pp->mailmap)
+ map_user(pp->mailmap, &mail, &name);
+
+ namelen = name.len + mail.len + 3; /* ' ' + '<' + '>' */
time = strtoul(ident.date_begin, &date, 10);
tz = strtol(date, NULL, 10);
if (pp->fmt == CMIT_FMT_EMAIL) {
- int display_name_length;
-
- display_name_length = ident.name_end - ident.name_begin;
-
strbuf_addstr(sb, "From: ");
- if (needs_rfc2047_encoding(line, display_name_length, RFC2047_ADDRESS)) {
- add_rfc2047(sb, line, display_name_length,
- encoding, RFC2047_ADDRESS);
+ if (needs_rfc2047_encoding(name.buf, name.len, RFC2047_ADDRESS)) {
+ add_rfc2047(sb, name.buf, name.len,
+ encoding, RFC2047_ADDRESS);
max_length = 76; /* per rfc2047 */
- } else if (needs_rfc822_quoting(line, display_name_length)) {
+ } else if (needs_rfc822_quoting(name.buf, name.len)) {
struct strbuf quoted = STRBUF_INIT;
- add_rfc822_quoted("ed, line, display_name_length);
+ add_rfc822_quoted("ed, name.buf, name.len);
strbuf_add_wrapped_bytes(sb, quoted.buf, quoted.len,
-6, 1, max_length);
strbuf_release("ed);
} else {
- strbuf_add_wrapped_bytes(sb, line, display_name_length,
- -6, 1, max_length);
+ strbuf_add_wrapped_bytes(sb, name.buf, name.len,
+ -6, 1, max_length);
}
- if (namelen - display_name_length + last_line_length(sb) > max_length) {
+ if (namelen - name.len + last_line_length(sb) > max_length)
strbuf_addch(sb, '\n');
- if (!isspace(ident.name_end[0]))
- strbuf_addch(sb, ' ');
- }
- strbuf_add(sb, ident.name_end, namelen - display_name_length);
- strbuf_addch(sb, '\n');
+
+ strbuf_addf(sb, " <%s>\n", mail.buf);
} else {
- strbuf_addf(sb, "%s: %.*s%.*s\n", what,
+ strbuf_addf(sb, "%s: %.*s%s <%s>\n", what,
(pp->fmt == CMIT_FMT_FULLER) ? 4 : 0,
- " ", namelen, line);
+ " ", name.buf, mail.buf);
}
+
+ strbuf_release(&mail);
+ strbuf_release(&name);
+
switch (pp->fmt) {
case CMIT_FMT_MEDIUM:
strbuf_addf(sb, "Date: %s\n", show_date(time, tz, pp->date_mode));
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 6/7] log: Add --use-mailmap option
From: Antoine Pelisse @ 2012-12-15 18:05 UTC (permalink / raw)
To: git; +Cc: Antoine Pelisse
In-Reply-To: <1355594754-27589-1-git-send-email-apelisse@gmail.com>
Add the --use-mailmap option to log commands. It allows
to display names from mailmap file when displaying logs,
whatever the format used.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
Documentation/git-log.txt | 5 +++++
builtin/log.c | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 585dac4..a99be97 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -47,6 +47,11 @@ OPTIONS
Print out the ref name given on the command line by which each
commit was reached.
+--use-mailmap::
+ Use mailmap file to map author and committer names and email
+ to canonical real names and email addresses. See
+ linkgit:git-shortlog[1].
+
--full-diff::
Without this flag, "git log -p <path>..." shows commits that
touch the specified paths, and diffs about the same specified
diff --git a/builtin/log.c b/builtin/log.c
index e7b7db1..d2bd8ce 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -22,6 +22,7 @@
#include "branch.h"
#include "streaming.h"
#include "version.h"
+#include "mailmap.h"
/* Set a default date-time format for git log ("log.date" config variable) */
static const char *default_date_mode = NULL;
@@ -94,11 +95,12 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
struct rev_info *rev, struct setup_revision_opt *opt)
{
struct userformat_want w;
- int quiet = 0, source = 0;
+ int quiet = 0, source = 0, mailmap = 0;
const struct option builtin_log_options[] = {
OPT_BOOLEAN(0, "quiet", &quiet, N_("suppress diff output")),
OPT_BOOLEAN(0, "source", &source, N_("show source")),
+ OPT_BOOLEAN(0, "use-mailmap", &mailmap, N_("Use mail map file")),
{ OPTION_CALLBACK, 0, "decorate", NULL, NULL, N_("decorate options"),
PARSE_OPT_OPTARG, decorate_callback},
OPT_END()
@@ -136,6 +138,11 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
if (source)
rev->show_source = 1;
+ if (mailmap) {
+ rev->mailmap = xcalloc(1, sizeof(struct string_list));
+ read_mailmap(rev->mailmap, NULL);
+ }
+
if (rev->pretty_given && rev->commit_format == CMIT_FMT_RAW) {
/*
* "log --pretty=raw" is special; ignore UI oriented
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] For git-subtree, when installing docs (make install-doc), create man1 folder first.
From: Junio C Hamano @ 2012-12-15 18:07 UTC (permalink / raw)
To: Jesper L. Nielsen; +Cc: git, David A. Greene
In-Reply-To: <1355429376-4192-1-git-send-email-lyager@gmail.com>
"Jesper L. Nielsen" <lyager@gmail.com> writes:
> From: "Jesper L. Nielsen" <lyager@gmail.com>
>
> Hi..
>
> I installed Git subtree and discovered that the if the man1dir doesn't exist the man-page for Git Subtree is just called man1.
>
> So, small patch to create the folder first in the Makefile. Hope everything is right with the patch and submitting of the patch.
>
> Best Regards
> Jesper
>
> Signed-off-by: Jesper L. Nielsen <lyager@gmail.com>
> ---
> contrib/subtree/Makefile | 1 +
> 1 file changed, 1 insertion(+)
This is a good first step in the right direction, I think.
Shouldn't the install targets take DESTDIR into account like the
main Makefile does, though?
As to the patch submission, everything below "---" line looks sane,
but please check how others write commit log messages by browsing a
handful of entries in "git log --no-merges" output and notice the
difference (the details are found in Documentation/SubmittingPatches).
Thanks.
> diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
> index 05cdd5c..a341cf4 100644
> --- a/contrib/subtree/Makefile
> +++ b/contrib/subtree/Makefile
> @@ -35,6 +35,7 @@ install: $(GIT_SUBTREE)
> install-doc: install-man
>
> install-man: $(GIT_SUBTREE_DOC)
> + mkdir -p $(man1dir)
> $(INSTALL) -m 644 $^ $(man1dir)
>
> $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
^ permalink raw reply
* Re: [PATCH] README: Git is released under the GPLv2, not just "the GPL"
From: Junio C Hamano @ 2012-12-15 18:07 UTC (permalink / raw)
To: Stefano Lattarini; +Cc: git
In-Reply-To: <966a27bab02e7deb41ad2268800bfd4a53279a8f.1355499408.git.stefano.lattarini@gmail.com>
Stefano Lattarini <stefano.lattarini@gmail.com> writes:
> And this is clearly stressed by Linus in the COPYING file. So make it
> clear in the README as well, to avoid possible misunderstandings.
>
> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
> ---
I have nothing against this patch, but I am curious if you saw any
misunderstandings in the real world, or if you are merely trying to
avoid "possible" ones.
> README | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/README b/README
> index d2690ec..c50e6f4 100644
> --- a/README
> +++ b/README
> @@ -19,9 +19,10 @@ Git is a fast, scalable, distributed revision control system with an
> unusually rich command set that provides both high-level operations
> and full access to internals.
>
> -Git is an Open Source project covered by the GNU General Public License.
> -It was originally written by Linus Torvalds with help of a group of
> -hackers around the net. It is currently maintained by Junio C Hamano.
> +Git is an Open Source project covered by the GNU General Public License
> +(version 2). It was originally written by Linus Torvalds with help
> +of a group of hackers around the net. It is currently maintained by
> +Junio C Hamano.
>
> Please read the file INSTALL for installation instructions.
^ permalink raw reply
* Re: [PATCH] Documentation: don't link to example mail addresses
From: John Keeping @ 2012-12-15 18:24 UTC (permalink / raw)
To: Jeff King; +Cc: git, Junio C Hamano
In-Reply-To: <20121215172018.GA18696@sigill.intra.peff.net>
On Sat, Dec 15, 2012 at 12:20:18PM -0500, Jeff King wrote:
> On Sat, Dec 15, 2012 at 03:03:15PM +0000, John Keeping wrote:
>> Mail addresses in documentation are converted into mailto: hyperlinks in
>> the HTML output and footnotes in man pages. This isn't desirable for
>> cases where the address is used as an example and is not valid.
>>
>> Particularly annoying is the example "jane@laptop.(none)" which appears
>> in git-shortlog(1) as "jane@laptop[1].(none)", with note 1 saying:
>>
>> 1. jane@laptop
>> mailto:jane@laptop
>
> Thanks, this is definitely worth fixing.
>
>> Fix this by quoting example mail addresses with "$$", preventing
>> Asciidoc from processing them.
>>
>> In the case of mailmap.txt, render the address monospaced so that it
>> matches the block examples surrounding that paragraph.
>
> I think I'd just render them monospace everywhere. We are very
> inconsistent about which form of quotes we use in the documentation (I
> think because most of the developers read the source directly and not
> the rendered asciidoc). And then we don't have to worry about the "$$"
> construct (and IMHO it makes the source much more readable, and marking
> the address as a literal looks good in the output, too).
I agree that the source is more readable as monospaced, but I think we
need to keep the quotes around the text in git-tag(1) and probably
git-fast-import(1) so that it is differentiated from the surrounding
text in the man page output.
I just tried this and got strange results. Taking the example in
git-tag(1):
...of the form ``Your Name <your@email.address>''
I tried this to preserve the quotes and make the entire quoted text
monospaced (I don't think we want to have just the email address
monospaced):
...of the form ```Your Name <your@email.address>`''
which had the desired effect - smart quotes and everything inside
rendered monospaced - BUT the email address is hyperlinked!
Switching the smart Asciidoc double quotes (``...'') for "normal" double
quotes ("...") produces the desired result, but IMHO doesn't look quite
as good (on the other hand it looks like there are many more use of
"..." than ``...'' in the Git documentation).
[While searching, the only other example I could find is in
git-commit(1) where `A U Thor <author@example.com>` is rendered
monospaced without quotes, but I think this hurts readability in the man
page output - expect a follow-up patch if we resolve this in the
direction of having quotes and monospaced text.]
At this point I've exhausted my Asciidoc knowledge and I'm not entirely
happy with any of these options. Suggestions?
John
^ permalink raw reply
* Re: FW: Git log --graph doesn't output color when redirected
From: Junio C Hamano @ 2012-12-15 18:30 UTC (permalink / raw)
To: Jeff King; +Cc: Nguyen Thai Ngoc Duy, Srb, Michal, git@vger.kernel.org
In-Reply-To: <20121215101659.GB21577@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Sat, Dec 15, 2012 at 10:23:10AM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> On Thu, Dec 13, 2012 at 8:13 PM, Jeff King <peff@peff.net> wrote:
>> > If you are using --format="%C(red)" or similar placeholders,
>> > they are the odd duck by not respecting the auto-color mode.
>>
>> But they should, shouldn't they? Just asking. I may do it to when I
>> revive nd/pretty-placeholder-with-color-option.
>
> If I were designing --format today, I would certainly say so. The only
> thing holding me back would be backwards compatibility. We could get
> around that by introducing a new placeholder like %c(color) that behaves
> like %C(color), except respects the --color flag.
I think the %c(color) thing is a good way to go if we want to pursue
this.
Another possibility without wasting one more special letter would be
to allow %C(auto,red), perhaps like this (untested):
pretty.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git i/pretty.c w/pretty.c
index dba6828..77cf826 100644
--- i/pretty.c
+++ w/pretty.c
@@ -960,12 +960,19 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,
switch (placeholder[0]) {
case 'C':
if (placeholder[1] == '(') {
- const char *end = strchr(placeholder + 2, ')');
+ const char *begin = placeholder + 2;
+ const char *end = strchr(begin, ')');
char color[COLOR_MAXLEN];
+
if (!end)
return 0;
- color_parse_mem(placeholder + 2,
- end - (placeholder + 2),
+ if (!memcmp(begin, "auto,", 5)) {
+ if (!want_color(GIT_COLOR_AUTO))
+ return 0;
+ begin += 5;
+ }
+ color_parse_mem(begin,
+ end - begin,
"--pretty format", color);
strbuf_addstr(sb, color);
return end - placeholder + 1;
^ permalink raw reply related
* Re: [PATCH] README: Git is released under the GPLv2, not just "the GPL"
From: Junio C Hamano @ 2012-12-15 18:35 UTC (permalink / raw)
To: Stefano Lattarini; +Cc: git
In-Reply-To: <7vhanntchw.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Stefano Lattarini <stefano.lattarini@gmail.com> writes:
>
>> And this is clearly stressed by Linus in the COPYING file. So make it
>> clear in the README as well, to avoid possible misunderstandings.
>>
>> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
>> ---
>
> I have nothing against this patch, but I am curious if you saw any
> misunderstandings in the real world, or if you are merely trying to
> avoid "possible" ones.
>
>> README | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/README b/README
>> index d2690ec..c50e6f4 100644
>> --- a/README
>> +++ b/README
>> @@ -19,9 +19,10 @@ Git is a fast, scalable, distributed revision control system with an
>> unusually rich command set that provides both high-level operations
>> and full access to internals.
>>
>> -Git is an Open Source project covered by the GNU General Public License.
>> -It was originally written by Linus Torvalds with help of a group of
>> -hackers around the net. It is currently maintained by Junio C Hamano.
>> +Git is an Open Source project covered by the GNU General Public License
>> +(version 2). It was originally written by Linus Torvalds with help
>> +of a group of hackers around the net. It is currently maintained by
>> +Junio C Hamano.
>>
>> Please read the file INSTALL for installation instructions.
The project as a whole is GPLv2, and inclusion of pieces licensed
under different but compatible terms does not change it, but we may
want to do this instead.
I am just one of the "group of hackers around the net" in the
context of this overview, so I think it is OK to drop that
"currently maintained by" bit. The audience of this document does
not have to find out and interact with the maintainer.
diff --git a/README b/README
index d2690ec..c365e3c 100644
--- a/README
+++ b/README
@@ -19,9 +19,10 @@ Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.
-Git is an Open Source project covered by the GNU General Public License.
+Git is an Open Source project covered by the GNU General Public
+License version 2 (some parts of it are under different licenses).
It was originally written by Linus Torvalds with help of a group of
-hackers around the net. It is currently maintained by Junio C Hamano.
+hackers around the net.
Please read the file INSTALL for installation instructions.
--
1.8.1.rc1.148.gfac1be9
^ permalink raw reply related
* Re: [PATCH 0/2] Port to QNX
From: Junio C Hamano @ 2012-12-15 18:38 UTC (permalink / raw)
To: Matt Kraai; +Cc: git
In-Reply-To: <1355510300-31541-1-git-send-email-kraai@ftbfs.org>
Matt Kraai <kraai@ftbfs.org> writes:
> This series ports Git to QNX. It builds on both QNX 6.3.2 and QNX
> 6.5.0. The test suite does not pass. Unless the corresponding
> software is installed, the following arguments must be passed to Make:
>
> NO_CURL=1 NO_GETTEXT=1 NO_OPENSSL=1 NO_PERL=1 NO_PYTHON=1 NO_TCLTK=1
>
> [1/2]: Make lock local to fetch_pack
>
> QNX 6.3.2's unistd.h declares a function named lock, which causes
> fetch-pack.c to fail to compile if lock has file-scope. Since it's
> only used in a single function, move it therein.
>
> [2/2]: Port to QNX
I do not mind queuing this on 'pu' but do you want to see your
ftbfs.org address in the commit objects, or the other one that you
are not using to interact with us?
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox