* [PATCH 7/7] format-patch: add --reroll-count=$N option
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
The --reroll-count=$N option, when given a positive integer:
- Adds " v$N" to the subject prefix specified. As the default
subject prefix string is "PATCH", --reroll-count=2 makes it
"PATCH v2".
- Prefixes "v$N-" to the names used for output files. The cover
letter, whose name is usually 0000-cover-letter.patch, becomes
v2-0000-cover-letter.patch when given --reroll-count=2.
This allows users to use the same --output-directory for multiple
iterations of the same series, without letting the output for a
newer round overwrite output files from the earlier rounds. The
user can incorporate materials from earlier rounds to update the
newly minted iteration, and use "send-email v2-*.patch" to send out
the patches belonging to the second iteration easily.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 11 +++++++++++
log-tree.c | 2 ++
revision.h | 1 +
3 files changed, 14 insertions(+)
diff --git a/builtin/log.c b/builtin/log.c
index 8cfb4da..e101498 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1061,6 +1061,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
int use_patch_format = 0;
int quiet = 0;
+ int reroll_count = -1;
char *branch_name = NULL;
const struct option builtin_format_patch_options[] = {
{ OPTION_CALLBACK, 'n', "numbered", &numbered, NULL,
@@ -1080,6 +1081,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
N_("use <sfx> instead of '.patch'")),
OPT_INTEGER(0, "start-number", &start_number,
N_("start numbering patches at <n> instead of 1")),
+ OPT_INTEGER(0, "reroll-count", &reroll_count,
+ N_("mark the series as Nth re-roll")),
{ OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"),
N_("Use [<prefix>] instead of [PATCH]"),
PARSE_OPT_NONEG, subject_prefix_callback },
@@ -1152,6 +1155,14 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
PARSE_OPT_KEEP_DASHDASH);
+ if (0 < reroll_count) {
+ struct strbuf sprefix = STRBUF_INIT;
+ strbuf_addf(&sprefix, "%s v%d",
+ rev.subject_prefix, reroll_count);
+ rev.reroll_count = reroll_count;
+ rev.subject_prefix = strbuf_detach(&sprefix, NULL);
+ }
+
if (do_signoff) {
const char *committer;
const char *endpos;
diff --git a/log-tree.c b/log-tree.c
index 670beae..5dc126b 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -308,6 +308,8 @@ void fmt_output_subject(struct strbuf *filename,
int start_len = filename->len;
int max_len = start_len + FORMAT_PATCH_NAME_MAX - (strlen(suffix) + 1);
+ if (0 < info->reroll_count)
+ strbuf_addf(filename, "v%d-", info->reroll_count);
strbuf_addf(filename, "%04d-%s", nr, subject);
if (max_len < filename->len)
diff --git a/revision.h b/revision.h
index a95bd0b..e4a912a 100644
--- a/revision.h
+++ b/revision.h
@@ -134,6 +134,7 @@ struct rev_info {
const char *mime_boundary;
const char *patch_suffix;
int numbered_files;
+ int reroll_count;
char *message_id;
struct string_list *ref_message_ids;
const char *add_signoff;
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 6/7] get_patch_filename(): split into two functions
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
The function switched between two operating modes depending on the
NULL-ness of its two parameters, as a hacky way to share small part
of implementation, sacrificing cleanliness of the API.
Implement "fmt_output_subject()" function that takes a subject
string and gives the name for the output file, and on top of it,
implement "fmt_output_commit()" function that takes a commit and
gives the name for the output file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 4 +++-
log-tree.c | 41 +++++++++++++++++++++++------------------
log-tree.h | 5 ++---
3 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 3c6f20a..8cfb4da 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -686,8 +686,10 @@ static int reopen_stdout(struct commit *commit, const char *subject,
if (rev->numbered_files)
strbuf_addf(&filename, "%d", rev->nr);
+ else if (commit)
+ fmt_output_commit(&filename, commit, rev);
else
- get_patch_filename(&filename, commit, subject, rev);
+ fmt_output_subject(&filename, subject, rev);
if (!quiet)
fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
diff --git a/log-tree.c b/log-tree.c
index d9f86ce..670beae 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -299,26 +299,32 @@ static unsigned int digits_in_number(unsigned int number)
return result;
}
-void get_patch_filename(struct strbuf *buf,
- struct commit *commit, const char *subject,
+void fmt_output_subject(struct strbuf *filename,
+ const char *subject,
struct rev_info *info)
{
const char *suffix = info->patch_suffix;
int nr = info->nr;
- int suffix_len = strlen(suffix) + 1;
- int start_len = buf->len;
- int max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len;
-
- strbuf_addf(buf, "%04d-", nr);
- if (subject)
- strbuf_addstr(buf, subject);
- else if (commit) {
- struct pretty_print_context ctx = {0};
- format_commit_message(commit, "%f", buf, &ctx);
- }
- if (max_len < buf->len)
- strbuf_setlen(buf, max_len);
- strbuf_addstr(buf, suffix);
+ int start_len = filename->len;
+ int max_len = start_len + FORMAT_PATCH_NAME_MAX - (strlen(suffix) + 1);
+
+ strbuf_addf(filename, "%04d-%s", nr, subject);
+
+ if (max_len < filename->len)
+ strbuf_setlen(filename, max_len);
+ strbuf_addstr(filename, suffix);
+}
+
+void fmt_output_commit(struct strbuf *filename,
+ struct commit *commit,
+ struct rev_info *info)
+{
+ struct pretty_print_context ctx = {0};
+ struct strbuf subject = STRBUF_INIT;
+
+ format_commit_message(commit, "%f", &subject, &ctx);
+ fmt_output_subject(filename, subject.buf, info);
+ strbuf_release(&subject);
}
void log_write_email_headers(struct rev_info *opt, struct commit *commit,
@@ -390,8 +396,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
if (opt->numbered_files)
strbuf_addf(&filename, "%d", opt->nr);
else
- get_patch_filename(&filename, commit, NULL,
- opt);
+ fmt_output_commit(&filename, commit, opt);
snprintf(buffer, sizeof(buffer) - 1,
"\n--%s%s\n"
"Content-Type: text/x-patch;"
diff --git a/log-tree.h b/log-tree.h
index c6a944a..9140f48 100644
--- a/log-tree.h
+++ b/log-tree.h
@@ -21,8 +21,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
void load_ref_decorations(int flags);
#define FORMAT_PATCH_NAME_MAX 64
-void get_patch_filename(struct strbuf *buf,
- struct commit *commit, const char *subject,
- struct rev_info *);
+void fmt_output_commit(struct strbuf *, struct commit *, struct rev_info *);
+void fmt_output_subject(struct strbuf *, const char *subject, struct rev_info *);
#endif
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 4/7] get_patch_filename(): simplify function signature
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
Most functions that emit to a strbuf take the strbuf as their first
parameter; make this function follow suit.
The serial number of the patch being emitted (nr) and suffix used
for patch filename (suffix) are both recorded in rev_info; drop
these separate parameters and pass the rev_info directly.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 2 +-
log-tree.c | 12 ++++++++----
log-tree.h | 5 +++--
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 7cf157e..d9946ec 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -684,7 +684,7 @@ static int reopen_stdout(struct commit *commit, const char *subject,
strbuf_addch(&filename, '/');
}
- get_patch_filename(commit, subject, rev->nr, rev->patch_suffix, &filename);
+ get_patch_filename(&filename, commit, subject, rev);
if (!quiet)
fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
diff --git a/log-tree.c b/log-tree.c
index c894930..ceed6b6 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -299,9 +299,12 @@ static unsigned int digits_in_number(unsigned int number)
return result;
}
-void get_patch_filename(struct commit *commit, const char *subject, int nr,
- const char *suffix, struct strbuf *buf)
+void get_patch_filename(struct strbuf *buf,
+ struct commit *commit, const char *subject,
+ struct rev_info *info)
{
+ const char *suffix = info->patch_suffix;
+ int nr = info->nr;
int suffix_len = strlen(suffix) + 1;
int start_len = buf->len;
@@ -387,8 +390,9 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
mime_boundary_leader, opt->mime_boundary);
extra_headers = subject_buffer;
- get_patch_filename(opt->numbered_files ? NULL : commit, NULL,
- opt->nr, opt->patch_suffix, &filename);
+ get_patch_filename(&filename,
+ opt->numbered_files ? NULL : commit, NULL,
+ opt);
snprintf(buffer, sizeof(buffer) - 1,
"\n--%s%s\n"
"Content-Type: text/x-patch;"
diff --git a/log-tree.h b/log-tree.h
index f5ac238..c6a944a 100644
--- a/log-tree.h
+++ b/log-tree.h
@@ -21,7 +21,8 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit,
void load_ref_decorations(int flags);
#define FORMAT_PATCH_NAME_MAX 64
-void get_patch_filename(struct commit *commit, const char *subject, int nr,
- const char *suffix, struct strbuf *buf);
+void get_patch_filename(struct strbuf *buf,
+ struct commit *commit, const char *subject,
+ struct rev_info *);
#endif
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 3/7] builtin/log.c: stop using global patch_suffix
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
The suffix for the output filename is found in rev->patch_suffix; do
not keep using the global that is only used to parse the command
line and configuration.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index f1d086e..7cf157e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -673,7 +673,7 @@ static int reopen_stdout(struct commit *commit, const char *subject,
struct rev_info *rev, int quiet)
{
struct strbuf filename = STRBUF_INIT;
- int suffix_len = strlen(fmt_patch_suffix) + 1;
+ int suffix_len = strlen(rev->patch_suffix) + 1;
if (output_directory) {
strbuf_addstr(&filename, output_directory);
@@ -684,7 +684,7 @@ static int reopen_stdout(struct commit *commit, const char *subject,
strbuf_addch(&filename, '/');
}
- get_patch_filename(commit, subject, rev->nr, fmt_patch_suffix, &filename);
+ get_patch_filename(commit, subject, rev->nr, rev->patch_suffix, &filename);
if (!quiet)
fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 2/7] builtin/log.c: drop redundant "numbered_files" parameter from make_cover_letter()
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 28d9063..f1d086e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -768,7 +768,6 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name)
}
static void make_cover_letter(struct rev_info *rev, int use_stdout,
- int numbered_files,
struct commit *origin,
int nr, struct commit **list, struct commit *head,
const char *branch_name,
@@ -791,7 +790,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
committer = git_committer_info(0);
if (!use_stdout &&
- reopen_stdout(NULL, numbered_files ? NULL : "cover-letter", rev, quiet))
+ reopen_stdout(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet))
return;
log_write_email_headers(rev, head, &pp.subject, &pp.after_subject,
@@ -1045,7 +1044,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
int nr = 0, total, i;
int use_stdout = 0;
int start_number = -1;
- int numbered_files = 0; /* _just_ numbers */
+ int just_numbers = 0;
int ignore_if_in_upstream = 0;
int cover_letter = 0;
int boundary_count = 0;
@@ -1070,7 +1069,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
N_("print patches to standard out")),
OPT_BOOLEAN(0, "cover-letter", &cover_letter,
N_("generate a cover letter")),
- OPT_BOOLEAN(0, "numbered-files", &numbered_files,
+ OPT_BOOLEAN(0, "numbered-files", &just_numbers,
N_("use simple number sequence for output file names")),
OPT_STRING(0, "suffix", &fmt_patch_suffix, N_("sfx"),
N_("use <sfx> instead of '.patch'")),
@@ -1338,12 +1337,12 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
const char *msgid = clean_message_id(in_reply_to);
string_list_append(rev.ref_message_ids, msgid);
}
- rev.numbered_files = numbered_files;
+ rev.numbered_files = just_numbers;
rev.patch_suffix = fmt_patch_suffix;
if (cover_letter) {
if (thread)
gen_message_id(&rev, "cover");
- make_cover_letter(&rev, use_stdout, numbered_files,
+ make_cover_letter(&rev, use_stdout,
origin, nr, list, head, branch_name, quiet);
total++;
start_number--;
@@ -1390,7 +1389,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
}
if (!use_stdout &&
- reopen_stdout(numbered_files ? NULL : commit, NULL, &rev, quiet))
+ reopen_stdout(rev.numbered_files ? NULL : commit, NULL, &rev, quiet))
die(_("Failed to create output files"));
shown = log_tree_commit(&rev, commit);
free(commit->buffer);
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 1/7] builtin/log.c: drop unused "numbered" parameter from make_cover_letter()
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
In-Reply-To: <1356165212-5611-1-git-send-email-gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/log.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 09cf43e..28d9063 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -768,7 +768,7 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name)
}
static void make_cover_letter(struct rev_info *rev, int use_stdout,
- int numbered, int numbered_files,
+ int numbered_files,
struct commit *origin,
int nr, struct commit **list, struct commit *head,
const char *branch_name,
@@ -1343,7 +1343,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (cover_letter) {
if (thread)
gen_message_id(&rev, "cover");
- make_cover_letter(&rev, use_stdout, numbered, numbered_files,
+ make_cover_letter(&rev, use_stdout, numbered_files,
origin, nr, list, head, branch_name, quiet);
total++;
start_number--;
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply related
* [PATCH 0/7] format-patch --reroll-count
From: Junio C Hamano @ 2012-12-22 8:33 UTC (permalink / raw)
To: git
The --reroll-count=$N option, when given a positive integer:
- Adds " v$N" to the subject prefix specified. As the default
subject prefix string is "PATCH", --reroll-count=2 makes it
"PATCH v2".
- Prefixes "v$N-" to the names used for output files. The cover
letter, whose name is usually 0000-cover-letter.patch, becomes
v2-0000-cover-letter.patch when given --reroll-count=2.
This allows users to use the same --output-directory for multiple
iterations of the same series, without letting the output for a
newer round overwrite output files from the earlier rounds. The
user can incorporate materials from earlier rounds to update the
newly minted iteration, and use "send-email v2-*.patch" to send out
the patches belonging to the second iteration easily.
The early patches of this series are all preparatory clean-ups. I
think reopen_stdout() also can be cleaned up, but I'll leave it to
a future reroll.
Junio C Hamano (7):
builtin/log.c: drop unused "numbered" parameter from
make_cover_letter()
builtin/log.c: drop redundant "numbered_files" parameter from
make_cover_letter()
builtin/log.c: stop using global patch_suffix
get_patch_filename(): simplify function signature
get_patch_filename(): drop "just-numbers" hack
get_patch_filename(): split into two functions
format-patch: add --reroll-count=$N option
builtin/log.c | 33 ++++++++++++++++++++++++---------
log-tree.c | 52 +++++++++++++++++++++++++++++++---------------------
log-tree.h | 4 ++--
revision.h | 1 +
4 files changed, 58 insertions(+), 32 deletions(-)
--
1.8.0.6.gd28b5d4.dirty
^ permalink raw reply
* [PATCH 8/8] wildmatch: advance faster in <asterisk> + <literal> patterns
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
compat, '*/*/*' on linux-2.6.git file list 2000 times, before:
wildmatch 7s 985049us
fnmatch 2s 735541us or 34.26% faster
and after:
wildmatch 4s 492549us
fnmatch 0s 888263us or 19.77% slower
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
wildmatch.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/wildmatch.c b/wildmatch.c
index 3794c4d..68b02e4 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -132,6 +132,27 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
while (1) {
if (t_ch == '\0')
break;
+ /*
+ * Try to advance faster when an asterisk is
+ * followed by a literal. We know in this case
+ * that the the string before the literal
+ * must belong to "*".
+ */
+ if (!is_glob_special(*p)) {
+ p_ch = *p;
+ if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
+ p_ch = tolower(p_ch);
+ while ((t_ch = *text) != '\0' &&
+ (!(flags & WM_PATHNAME) || t_ch != '/')) {
+ if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
+ t_ch = tolower(t_ch);
+ if (t_ch == p_ch)
+ break;
+ text++;
+ }
+ if (t_ch != p_ch)
+ return WM_NOMATCH;
+ }
if ((matched = dowild(p, text, flags)) != WM_NOMATCH) {
if (!special || matched != WM_ABORT_TO_STARSTAR)
return matched;
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 7/8] wildmatch: make a special case for "*/" with FNM_PATHNAME
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
Normally we need recursion for "*". In this case we know that it
matches everything until "/" so we can skip the recursion.
glibc, '*/*/*' on linux-2.6.git file list 2000 times
before:
wildmatch 8s 74513us
fnmatch 1s 97042us or 13.59% faster
after:
wildmatch 3s 521862us
fnmatch 3s 488616us or 99.06% slower
Same test with compat/fnmatch:
wildmatch 8s 110763us
fnmatch 2s 980845us or 36.75% faster
wildmatch 3s 522156us
fnmatch 1s 544487us or 43.85% slower
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
wildmatch.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/wildmatch.c b/wildmatch.c
index 4fe1d65..3794c4d 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -116,6 +116,18 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
return WM_NOMATCH;
}
return WM_MATCH;
+ } else if (*p == '/' && (flags & WM_PATHNAME) && !special) {
+ /*
+ * an asterisk followed by a slash
+ * with WM_PATHNAME matches the next
+ * directory
+ */
+ const char *slash = strchr((char*)text, '/');
+ if (!slash)
+ return WM_NOMATCH;
+ text = (const uchar*)slash;
+ /* the slash is consumed by the top-level for loop */
+ break;
}
while (1) {
if (t_ch == '\0')
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 6/8] Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
This is similar to NO_FNMATCH but it uses wildmatch instead of
compat/fnmatch. This is an intermediate step to let wildmatch be used
as fnmatch replacement for wider audience before it replaces fnmatch
completely and compat/fnmatch is removed.
fnmatch in test-wildmatch is not impacted by this and is the only
place that NO_FNMATCH or NO_FNMATCH_CASEFOLD remain active when
USE_WILDMATCH is set.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Makefile | 6 ++++++
git-compat-util.h | 13 +++++++++++++
test-wildmatch.c | 3 +++
3 files changed, 22 insertions(+)
diff --git a/Makefile b/Makefile
index bc868d1..24e2774 100644
--- a/Makefile
+++ b/Makefile
@@ -99,6 +99,9 @@ all::
# Define NO_FNMATCH_CASEFOLD if your fnmatch function doesn't have the
# FNM_CASEFOLD GNU extension.
#
+# Define USE_WILDMATCH if you want to use Git's wildmatch
+# implementation as fnmatch
+#
# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
# in the C library.
#
@@ -1625,6 +1628,9 @@ ifdef NO_FNMATCH_CASEFOLD
COMPAT_OBJS += compat/fnmatch/fnmatch.o
endif
endif
+ifdef USE_WILDMATCH
+ COMPAT_CFLAGS += -DUSE_WILDMATCH
+endif
ifdef NO_SETENV
COMPAT_CFLAGS += -DNO_SETENV
COMPAT_OBJS += compat/setenv.o
diff --git a/git-compat-util.h b/git-compat-util.h
index 02f48f6..b2c7638 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -106,7 +106,9 @@
#include <sys/time.h>
#include <time.h>
#include <signal.h>
+#ifndef USE_WILDMATCH
#include <fnmatch.h>
+#endif
#include <assert.h>
#include <regex.h>
#include <utime.h>
@@ -238,6 +240,17 @@ extern char *gitbasename(char *);
#include "compat/bswap.h"
+#ifdef USE_WILDMATCH
+#include "wildmatch.h"
+#define FNM_PATHNAME WM_PATHNAME
+#define FNM_CASEFOLD WM_CASEFOLD
+#define FNM_NOMATCH WM_NOMATCH
+static inline int fnmatch(const char *pattern, const char *string, int flags)
+{
+ return wildmatch(pattern, string, flags, NULL);
+}
+#endif
+
/* General helper functions */
extern void vreportf(const char *prefix, const char *err, va_list params);
extern void vwritef(int fd, const char *prefix, const char *err, va_list params);
diff --git a/test-wildmatch.c b/test-wildmatch.c
index ac86800..a3e2643 100644
--- a/test-wildmatch.c
+++ b/test-wildmatch.c
@@ -1,3 +1,6 @@
+#ifdef USE_WILDMATCH
+#undef USE_WILDMATCH /* We need real fnmatch implementation here */
+#endif
#include "cache.h"
#include "wildmatch.h"
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 5/8] test-wildmatch: add "perf" command to compare wildmatch and fnmatch
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
It takes a text file, a pattern, a number <n> and pathname flag. Each
line in the text file is matched against the pattern <n> times. If
"pathname" is given, FNM_PATHNAME is used.
test-wildmatch is built with -O2 and tested against glibc 2.14.1 (also
-O2) and compat/fnmatch. The input file is linux-2.6.git file list.
<n> is 2000. The complete command list is at the end.
wildmatch is beaten in the following cases. Apparently it needs some
improvement in FNM_PATHNAME case:
glibc, '*/*/*' with FNM_PATHNAME:
wildmatch 8s 1559us
fnmatch 1s 11877us or 12.65% faster
compat, '*/*/*' with FNM_PATHNAME:
wildmatch 7s 922458us
fnmatch 2s 905111us or 36.67% faster
compat, '*/*/*' without FNM_PATHNAME:
wildmatch 7s 264201us
fnmatch 2s 1897us or 27.56% faster
compat, '[a-z]*/[a-z]*/[a-z]*' with FNM_PATHNAME:
wildmatch 8s 742827us
fnmatch 0s 922943us or 10.56% faster
compat, '[a-z]*/[a-z]*/[a-z]*' without FNM_PATHNAME:
wildmatch 8s 284520us
fnmatch 0s 6936us or 0.08% faster
The rest of glibc numbers
-------------------------
'Documentation/*'
wildmatch 1s 529479us
fnmatch 1s 98263us or 71.81% slower
'drivers/*'
wildmatch 1s 988288us
fnmatch 1s 192049us or 59.95% slower
'Documentation/*' pathname
wildmatch 1s 557507us
fnmatch 1s 93696us or 70.22% slower
'drivers/*' pathname
wildmatch 2s 161626us
fnmatch 1s 230372us or 56.92% slower
'[Dd]ocu[Mn]entation/*'
wildmatch 1s 776581us
fnmatch 1s 471693us or 82.84% slower
'[Dd]o?u[Mn]en?ati?n/*'
wildmatch 1s 770770us
fnmatch 1s 555727us or 87.86% slower
'[Dd]o?u[Mn]en?ati?n/*' pathname
wildmatch 1s 783507us
fnmatch 1s 537029us or 86.18% slower
'[A-Za-z][A-Za-z]??*'
wildmatch 4s 110386us
fnmatch 4s 926306us or 119.85% slower
'[A-Za-z][A-Za-z]??'
wildmatch 3s 918114us
fnmatch 3s 686175us or 94.08% slower
'[A-Za-z][A-Za-z]??*' pathname
wildmatch 4s 453746us
fnmatch 4s 955856us or 111.27% slower
'[A-Za-z][A-Za-z]??' pathname
wildmatch 3s 896646us
fnmatch 3s 733828us or 95.82% slower
'*/*/*'
wildmatch 7s 287985us
fnmatch 1s 74083us or 14.74% slower
'[a-z]*/[a-z]*/[a-z]*' pathname
wildmatch 8s 796659us
fnmatch 1s 568409us or 17.83% slower
'[a-z]*/[a-z]*/[a-z]*'
wildmatch 8s 316559us
fnmatch 3s 430652us or 41.25% slower
The rest of compat numbers
--------------------------
'Documentation/*'
wildmatch 1s 520389us
fnmatch 0s 62579us or 4.12% slower
'drivers/*'
wildmatch 1s 955354us
fnmatch 0s 190109us or 9.72% slower
'Documentation/*' pathname
wildmatch 1s 561675us
fnmatch 0s 55336us or 3.54% slower
'drivers/*' pathname
wildmatch 2s 106100us
fnmatch 0s 219680us or 10.43% slower
'[Dd]ocu[Mn]entation/*'
wildmatch 1s 750810us
fnmatch 0s 542721us or 31.00% slower
'[Dd]o?u[Mn]en?ati?n/*'
wildmatch 1s 724791us
fnmatch 0s 538948us or 31.25% slower
'[Dd]o?u[Mn]en?ati?n/*' pathname
wildmatch 1s 731403us
fnmatch 0s 537474us or 31.04% slower
'[A-Za-z][A-Za-z]??*'
wildmatch 4s 28555us
fnmatch 1s 67297us or 26.49% slower
'[A-Za-z][A-Za-z]??'
wildmatch 3s 838279us
fnmatch 0s 880005us or 22.93% slower
'[A-Za-z][A-Za-z]??*' pathname
wildmatch 4s 379476us
fnmatch 1s 55643us or 24.10% slower
'[A-Za-z][A-Za-z]??' pathname
wildmatch 3s 830910us
fnmatch 0s 849699us or 22.18% slower
The following commands are used:
LANG=C ./test-wildmatch perf /tmp/filelist.txt 'Documentation/*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt 'drivers/*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt 'Documentation/*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt 'drivers/*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]ocu[Mn]entation/*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]o?u[Mn]en?ati?n/*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]o?u[Mn]en?ati?n/*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '*/*/*' 2000
LANG=C ./test-wildmatch perf /tmp/filelist.txt '*/*/*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[a-z]*/[a-z]*/[a-z]*' 2000 pathname
LANG=C ./test-wildmatch perf /tmp/filelist.txt '[a-z]*/[a-z]*/[a-z]*' 2000
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
test-wildmatch.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/test-wildmatch.c b/test-wildmatch.c
index a5f4833..ac86800 100644
--- a/test-wildmatch.c
+++ b/test-wildmatch.c
@@ -1,9 +1,82 @@
#include "cache.h"
#include "wildmatch.h"
+static int perf(int ac, char **av)
+{
+ struct timeval tv1, tv2;
+ struct stat st;
+ int fd, i, n, flags1 = 0, flags2 = 0;
+ char *buffer, *p;
+ uint32_t usec1, usec2;
+ const char *lang;
+ const char *file = av[0];
+ const char *pattern = av[1];
+
+ lang = getenv("LANG");
+ if (lang && strcmp(lang, "C"))
+ die("Please test it on C locale.");
+
+ if ((fd = open(file, O_RDONLY)) == -1 || fstat(fd, &st))
+ die_errno("file open");
+
+ buffer = xmalloc(st.st_size + 2);
+ if (read(fd, buffer, st.st_size) != st.st_size)
+ die_errno("read");
+
+ buffer[st.st_size] = '\0';
+ buffer[st.st_size + 1] = '\0';
+ for (i = 0; i < st.st_size; i++)
+ if (buffer[i] == '\n')
+ buffer[i] = '\0';
+
+ n = atoi(av[2]);
+ if (av[3] && !strcmp(av[3], "pathname")) {
+ flags1 = WM_PATHNAME;
+ flags2 = FNM_PATHNAME;
+ }
+
+ gettimeofday(&tv1, NULL);
+ for (i = 0; i < n; i++) {
+ for (p = buffer; *p; p += strlen(p) + 1)
+ wildmatch(pattern, p, flags1, NULL);
+ }
+ gettimeofday(&tv2, NULL);
+
+ usec1 = (uint32_t)tv2.tv_sec * 1000000 + tv2.tv_usec;
+ usec1 -= (uint32_t)tv1.tv_sec * 1000000 + tv1.tv_usec;
+ printf("wildmatch %ds %dus\n",
+ (int)(usec1 / 1000000),
+ (int)(usec1 % 1000000));
+
+ gettimeofday(&tv1, NULL);
+ for (i = 0; i < n; i++) {
+ for (p = buffer; *p; p += strlen(p) + 1)
+ fnmatch(pattern, p, flags2);
+ }
+ gettimeofday(&tv2, NULL);
+
+ usec2 = (uint32_t)tv2.tv_sec * 1000000 + tv2.tv_usec;
+ usec2 -= (uint32_t)tv1.tv_sec * 1000000 + tv1.tv_usec;
+ if (usec2 > usec1)
+ printf("fnmatch %ds %dus or %.2f%% slower\n",
+ (int)((usec2 - usec1) / 1000000),
+ (int)((usec2 - usec1) % 1000000),
+ (float)(usec2 - usec1) / usec1 * 100);
+ else
+ printf("fnmatch %ds %dus or %.2f%% faster\n",
+ (int)((usec1 - usec2) / 1000000),
+ (int)((usec1 - usec2) % 1000000),
+ (float)(usec1 - usec2) / usec1 * 100);
+ return 0;
+}
+
int main(int argc, char **argv)
{
int i;
+
+ if (!strcmp(argv[1], "perf"))
+ return perf(argc - 2, argv + 2);
+
for (i = 2; i < argc; i++) {
if (argv[i][0] == '/')
die("Forward slash is not allowed at the beginning of the\n"
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 3/8] wildmatch: make dowild() take arbitrary flags
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
wildmatch.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/wildmatch.c b/wildmatch.c
index 6ee1b09..a79f97e 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -52,7 +52,7 @@ typedef unsigned char uchar;
#define ISXDIGIT(c) (ISASCII(c) && isxdigit(c))
/* Match pattern "p" against "text" */
-static int dowild(const uchar *p, const uchar *text, int force_lower_case)
+static int dowild(const uchar *p, const uchar *text, unsigned int flags)
{
uchar p_ch;
@@ -61,9 +61,9 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
uchar t_ch, prev_ch;
if ((t_ch = *text) == '\0' && p_ch != '*')
return WM_ABORT_ALL;
- if (force_lower_case && ISUPPER(t_ch))
+ if ((flags & WM_CASEFOLD) && ISUPPER(t_ch))
t_ch = tolower(t_ch);
- if (force_lower_case && ISUPPER(p_ch))
+ if ((flags & WM_CASEFOLD) && ISUPPER(p_ch))
p_ch = tolower(p_ch);
switch (p_ch) {
case '\\':
@@ -97,7 +97,7 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
* both foo/bar and foo/a/bar.
*/
if (p[0] == '/' &&
- dowild(p + 1, text, force_lower_case) == WM_MATCH)
+ dowild(p + 1, text, flags) == WM_MATCH)
return WM_MATCH;
special = 1;
} else
@@ -116,7 +116,7 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
while (1) {
if (t_ch == '\0')
break;
- if ((matched = dowild(p, text, force_lower_case)) != WM_NOMATCH) {
+ if ((matched = dowild(p, text, flags)) != WM_NOMATCH) {
if (!special || matched != WM_ABORT_TO_STARSTAR)
return matched;
} else if (!special && t_ch == '/')
@@ -227,6 +227,5 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
int wildmatch(const char *pattern, const char *text,
unsigned int flags, struct wildopts *wo)
{
- return dowild((const uchar*)pattern, (const uchar*)text,
- flags & WM_CASEFOLD ? 1 :0);
+ return dowild((const uchar*)pattern, (const uchar*)text, flags);
}
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 2/8] wildmatch: rename constants and update prototype
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
- All exported constants now have a prefix WM_
- Do not rely on FNM_* constants, use the WM_ counterparts
- Remove TRUE and FALSE to follow Git's coding style
- While at it, turn flags type from int to unsigned int
- Add an (unused yet) argument to carry extra information
so that we don't have to change the prototype again later
when we need to pass other stuff to wildmatch
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
dir.c | 3 +-
test-wildmatch.c | 4 +--
wildmatch.c | 86 +++++++++++++++++++++++++++-----------------------------
wildmatch.h | 22 ++++++++++-----
4 files changed, 61 insertions(+), 54 deletions(-)
diff --git a/dir.c b/dir.c
index cb7328b..175a182 100644
--- a/dir.c
+++ b/dir.c
@@ -595,7 +595,8 @@ int match_pathname(const char *pathname, int pathlen,
}
return wildmatch(pattern, name,
- ignore_case ? FNM_CASEFOLD : 0) == 0;
+ ignore_case ? WM_CASEFOLD : 0,
+ NULL) == 0;
}
/* Scan the list and let the last match determine the fate.
diff --git a/test-wildmatch.c b/test-wildmatch.c
index e384c8e..4bb23b4 100644
--- a/test-wildmatch.c
+++ b/test-wildmatch.c
@@ -12,9 +12,9 @@ int main(int argc, char **argv)
argv[i] += 3;
}
if (!strcmp(argv[1], "wildmatch"))
- return !!wildmatch(argv[3], argv[2], 0);
+ return !!wildmatch(argv[3], argv[2], 0, NULL);
else if (!strcmp(argv[1], "iwildmatch"))
- return !!wildmatch(argv[3], argv[2], FNM_CASEFOLD);
+ return !!wildmatch(argv[3], argv[2], WM_CASEFOLD, NULL);
else if (!strcmp(argv[1], "fnmatch"))
return !!fnmatch(argv[3], argv[2], FNM_PATHNAME);
else
diff --git a/wildmatch.c b/wildmatch.c
index 3972e26..6ee1b09 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -18,9 +18,6 @@ typedef unsigned char uchar;
#define NEGATE_CLASS '!'
#define NEGATE_CLASS2 '^'
-#define FALSE 0
-#define TRUE 1
-
#define CC_EQ(class, len, litmatch) ((len) == sizeof (litmatch)-1 \
&& *(class) == *(litmatch) \
&& strncmp((char*)class, litmatch, len) == 0)
@@ -63,7 +60,7 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
int matched, special;
uchar t_ch, prev_ch;
if ((t_ch = *text) == '\0' && p_ch != '*')
- return ABORT_ALL;
+ return WM_ABORT_ALL;
if (force_lower_case && ISUPPER(t_ch))
t_ch = tolower(t_ch);
if (force_lower_case && ISUPPER(p_ch))
@@ -76,12 +73,12 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
/* FALLTHROUGH */
default:
if (t_ch != p_ch)
- return NOMATCH;
+ return WM_NOMATCH;
continue;
case '?':
/* Match anything but '/'. */
if (t_ch == '/')
- return NOMATCH;
+ return WM_NOMATCH;
continue;
case '*':
if (*++p == '*') {
@@ -100,33 +97,33 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
* both foo/bar and foo/a/bar.
*/
if (p[0] == '/' &&
- dowild(p + 1, text, force_lower_case) == MATCH)
- return MATCH;
- special = TRUE;
+ dowild(p + 1, text, force_lower_case) == WM_MATCH)
+ return WM_MATCH;
+ special = 1;
} else
- return ABORT_MALFORMED;
+ return WM_ABORT_MALFORMED;
} else
- special = FALSE;
+ special = 0;
if (*p == '\0') {
/* Trailing "**" matches everything. Trailing "*" matches
* only if there are no more slash characters. */
if (!special) {
if (strchr((char*)text, '/') != NULL)
- return NOMATCH;
+ return WM_NOMATCH;
}
- return MATCH;
+ return WM_MATCH;
}
while (1) {
if (t_ch == '\0')
break;
- if ((matched = dowild(p, text, force_lower_case)) != NOMATCH) {
- if (!special || matched != ABORT_TO_STARSTAR)
+ if ((matched = dowild(p, text, force_lower_case)) != WM_NOMATCH) {
+ if (!special || matched != WM_ABORT_TO_STARSTAR)
return matched;
} else if (!special && t_ch == '/')
- return ABORT_TO_STARSTAR;
+ return WM_ABORT_TO_STARSTAR;
t_ch = *++text;
}
- return ABORT_ALL;
+ return WM_ABORT_ALL;
case '[':
p_ch = *++p;
#ifdef NEGATE_CLASS2
@@ -134,101 +131,102 @@ static int dowild(const uchar *p, const uchar *text, int force_lower_case)
p_ch = NEGATE_CLASS;
#endif
/* Assign literal TRUE/FALSE because of "matched" comparison. */
- special = p_ch == NEGATE_CLASS? TRUE : FALSE;
+ special = p_ch == NEGATE_CLASS;
if (special) {
/* Inverted character class. */
p_ch = *++p;
}
prev_ch = 0;
- matched = FALSE;
+ matched = 0;
do {
if (!p_ch)
- return ABORT_ALL;
+ return WM_ABORT_ALL;
if (p_ch == '\\') {
p_ch = *++p;
if (!p_ch)
- return ABORT_ALL;
+ return WM_ABORT_ALL;
if (t_ch == p_ch)
- matched = TRUE;
+ matched = 1;
} else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
p_ch = *++p;
if (p_ch == '\\') {
p_ch = *++p;
if (!p_ch)
- return ABORT_ALL;
+ return WM_ABORT_ALL;
}
if (t_ch <= p_ch && t_ch >= prev_ch)
- matched = TRUE;
+ matched = 1;
p_ch = 0; /* This makes "prev_ch" get set to 0. */
} else if (p_ch == '[' && p[1] == ':') {
const uchar *s;
int i;
for (s = p += 2; (p_ch = *p) && p_ch != ']'; p++) {} /*SHARED ITERATOR*/
if (!p_ch)
- return ABORT_ALL;
+ return WM_ABORT_ALL;
i = p - s - 1;
if (i < 0 || p[-1] != ':') {
/* Didn't find ":]", so treat like a normal set. */
p = s - 2;
p_ch = '[';
if (t_ch == p_ch)
- matched = TRUE;
+ matched = 1;
continue;
}
if (CC_EQ(s,i, "alnum")) {
if (ISALNUM(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "alpha")) {
if (ISALPHA(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "blank")) {
if (ISBLANK(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "cntrl")) {
if (ISCNTRL(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "digit")) {
if (ISDIGIT(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "graph")) {
if (ISGRAPH(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "lower")) {
if (ISLOWER(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "print")) {
if (ISPRINT(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "punct")) {
if (ISPUNCT(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "space")) {
if (ISSPACE(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "upper")) {
if (ISUPPER(t_ch))
- matched = TRUE;
+ matched = 1;
} else if (CC_EQ(s,i, "xdigit")) {
if (ISXDIGIT(t_ch))
- matched = TRUE;
+ matched = 1;
} else /* malformed [:class:] string */
- return ABORT_ALL;
+ return WM_ABORT_ALL;
p_ch = 0; /* This makes "prev_ch" get set to 0. */
} else if (t_ch == p_ch)
- matched = TRUE;
+ matched = 1;
} while (prev_ch = p_ch, (p_ch = *++p) != ']');
if (matched == special || t_ch == '/')
- return NOMATCH;
+ return WM_NOMATCH;
continue;
}
}
- return *text ? NOMATCH : MATCH;
+ return *text ? WM_NOMATCH : WM_MATCH;
}
/* Match the "pattern" against the "text" string. */
-int wildmatch(const char *pattern, const char *text, int flags)
+int wildmatch(const char *pattern, const char *text,
+ unsigned int flags, struct wildopts *wo)
{
return dowild((const uchar*)pattern, (const uchar*)text,
- flags & FNM_CASEFOLD ? 1 :0);
+ flags & WM_CASEFOLD ? 1 :0);
}
diff --git a/wildmatch.h b/wildmatch.h
index 984a38c..1c814fd 100644
--- a/wildmatch.h
+++ b/wildmatch.h
@@ -1,9 +1,17 @@
-/* wildmatch.h */
+#ifndef WILDMATCH_H
+#define WILDMATCH_H
-#define ABORT_MALFORMED 2
-#define NOMATCH 1
-#define MATCH 0
-#define ABORT_ALL -1
-#define ABORT_TO_STARSTAR -2
+#define WM_CASEFOLD 1
-int wildmatch(const char *pattern, const char *text, int flags);
+#define WM_ABORT_MALFORMED 2
+#define WM_NOMATCH 1
+#define WM_MATCH 0
+#define WM_ABORT_ALL -1
+#define WM_ABORT_TO_STARSTAR -2
+
+struct wildopts;
+
+int wildmatch(const char *pattern, const char *text,
+ unsigned int flags,
+ struct wildopts *wo);
+#endif
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 4/8] wildmatch: support "no FNM_PATHNAME" mode
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
So far, wildmatch() has always honoured directory boundary and there
was no way to turn it off. Make it behave more like fnmatch() by
requiring all callers that want the FNM_PATHNAME behaviour to pass
that in the equivalent flag WM_PATHNAME. Callers that do not specify
WM_PATHNAME will get wildcards like ? and * in their patterns matched
against '/', just like not passing FNM_PATHNAME to fnmatch().
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
dir.c | 2 +-
t/t3070-wildmatch.sh | 27 +++++++++++++++++++++++++++
test-wildmatch.c | 6 ++++--
wildmatch.c | 13 +++++++++----
wildmatch.h | 1 +
5 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/dir.c b/dir.c
index 175a182..6ef0396 100644
--- a/dir.c
+++ b/dir.c
@@ -595,7 +595,7 @@ int match_pathname(const char *pathname, int pathlen,
}
return wildmatch(pattern, name,
- ignore_case ? WM_CASEFOLD : 0,
+ WM_PATHNAME | (ignore_case ? WM_CASEFOLD : 0),
NULL) == 0;
}
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index d5bafef..dbfa903 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -29,6 +29,18 @@ match() {
fi
}
+pathmatch() {
+ if [ $1 = 1 ]; then
+ test_expect_success "pathmatch: match '$2' '$3'" "
+ test-wildmatch pathmatch '$2' '$3'
+ "
+ else
+ test_expect_success "pathmatch: no match '$2' '$3'" "
+ ! test-wildmatch pathmatch '$2' '$3'
+ "
+ fi
+}
+
# Basic wildmat features
match 1 1 foo foo
match 0 0 foo bar
@@ -192,4 +204,19 @@ match 0 0 'XXX/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' 'XXX/*/
match 1 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t'
match 0 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t'
+pathmatch 1 foo foo
+pathmatch 0 foo fo
+pathmatch 1 foo/bar foo/bar
+pathmatch 1 foo/bar 'foo/*'
+pathmatch 1 foo/bba/arr 'foo/*'
+pathmatch 1 foo/bba/arr 'foo/**'
+pathmatch 1 foo/bba/arr 'foo*'
+pathmatch 1 foo/bba/arr 'foo**'
+pathmatch 1 foo/bba/arr 'foo/*arr'
+pathmatch 1 foo/bba/arr 'foo/**arr'
+pathmatch 0 foo/bba/arr 'foo/*z'
+pathmatch 0 foo/bba/arr 'foo/**z'
+pathmatch 1 foo/bar 'foo?bar'
+pathmatch 1 foo/bar 'foo[/]bar'
+
test_done
diff --git a/test-wildmatch.c b/test-wildmatch.c
index 4bb23b4..a5f4833 100644
--- a/test-wildmatch.c
+++ b/test-wildmatch.c
@@ -12,9 +12,11 @@ int main(int argc, char **argv)
argv[i] += 3;
}
if (!strcmp(argv[1], "wildmatch"))
- return !!wildmatch(argv[3], argv[2], 0, NULL);
+ return !!wildmatch(argv[3], argv[2], WM_PATHNAME, NULL);
else if (!strcmp(argv[1], "iwildmatch"))
- return !!wildmatch(argv[3], argv[2], WM_CASEFOLD, NULL);
+ return !!wildmatch(argv[3], argv[2], WM_PATHNAME | WM_CASEFOLD, NULL);
+ else if (!strcmp(argv[1], "pathmatch"))
+ return !!wildmatch(argv[3], argv[2], 0, NULL);
else if (!strcmp(argv[1], "fnmatch"))
return !!fnmatch(argv[3], argv[2], FNM_PATHNAME);
else
diff --git a/wildmatch.c b/wildmatch.c
index a79f97e..4fe1d65 100644
--- a/wildmatch.c
+++ b/wildmatch.c
@@ -77,14 +77,17 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
continue;
case '?':
/* Match anything but '/'. */
- if (t_ch == '/')
+ if ((flags & WM_PATHNAME) && t_ch == '/')
return WM_NOMATCH;
continue;
case '*':
if (*++p == '*') {
const uchar *prev_p = p - 2;
while (*++p == '*') {}
- if ((prev_p == text || *prev_p == '/') ||
+ if (!(flags & WM_PATHNAME))
+ /* without WM_PATHNAME, '*' == '**' */
+ special = 1;
+ else if ((prev_p == text || *prev_p == '/') ||
(*p == '\0' || *p == '/' ||
(p[0] == '\\' && p[1] == '/'))) {
/*
@@ -103,7 +106,8 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
} else
return WM_ABORT_MALFORMED;
} else
- special = 0;
+ /* without WM_PATHNAME, '*' == '**' */
+ special = flags & WM_PATHNAME ? 0 : 1;
if (*p == '\0') {
/* Trailing "**" matches everything. Trailing "*" matches
* only if there are no more slash characters. */
@@ -214,7 +218,8 @@ static int dowild(const uchar *p, const uchar *text, unsigned int flags)
} else if (t_ch == p_ch)
matched = 1;
} while (prev_ch = p_ch, (p_ch = *++p) != ']');
- if (matched == special || t_ch == '/')
+ if (matched == special ||
+ ((flags & WM_PATHNAME) && t_ch == '/'))
return WM_NOMATCH;
continue;
}
diff --git a/wildmatch.h b/wildmatch.h
index 1c814fd..4090c8f 100644
--- a/wildmatch.h
+++ b/wildmatch.h
@@ -2,6 +2,7 @@
#define WILDMATCH_H
#define WM_CASEFOLD 1
+#define WM_PATHNAME 2
#define WM_ABORT_MALFORMED 2
#define WM_NOMATCH 1
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 1/8] compat/fnmatch: respect NO_FNMATCH* even on glibc
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
In-Reply-To: <1356163028-29967-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
compat/fnmatch/fnmatch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 9473aed..6f7387d 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -55,7 +55,8 @@
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
-#if defined _LIBC || !defined __GNU_LIBRARY__
+#if defined NO_FNMATCH || defined NO_FNMATCH_CASEFOLD || \
+ defined _LIBC || !defined __GNU_LIBRARY__
# if defined STDC_HEADERS || !defined isascii
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 0/8] fnmatch replacement step 1
From: Nguyễn Thái Ngọc Duy @ 2012-12-22 7:57 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy
This series makes wildmatch compatible with fnmatch, at least for
FNM_CASEFOLD and FNM_PATHNAME. This makes it possible to use wildmatch
as a fnmatch replacement. The replacement is optional and turned on via
USE_WILDMATCH.
Step 2 would be turn USE_WILDMATCH by default and remove
compat/fnmatch. We can leave it for now until we are certain we don't
introduce any kind of regressions.
Measurement is performed to see how wildmatch compete with
fnmatch(es). I was surprised that my glibc version is even slower than
compat/fnmatch. For more details, see 5/8. wildmatch is faster (about
20%) in most cases. It is slower in '*/*/*' tests both with and without
FNM_PATHNAME. 7/8 and 8/8 fix that, making wildmatch fastest in all
(tested) cases.
I'd appreciate if people test it with more patterns (both weird and
commonly used) against different fnmatch versions and turn on
USE_WILDMATCH to see if we need to fix something else, both correctness
and performance. So far I'm convinced that the replacement is a good
thing to do.
The series requires nd/wildmatch, obviously.
Nguyễn Thái Ngọc Duy (8):
compat/fnmatch: respect NO_FNMATCH* even on glibc
wildmatch: rename constants and update prototype
wildmatch: make dowild() take arbitrary flags
wildmatch: support "no FNM_PATHNAME" mode
test-wildmatch: add "perf" command to compare wildmatch and fnmatch
Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
wildmatch: make a special case for "*/" with FNM_PATHNAME
wildmatch: advance faster in <asterisk> + <literal> patterns
Makefile | 6 +++
compat/fnmatch/fnmatch.c | 3 +-
dir.c | 3 +-
git-compat-util.h | 13 +++++
t/t3070-wildmatch.sh | 27 ++++++++++
test-wildmatch.c | 82 +++++++++++++++++++++++++++-
wildmatch.c | 137 +++++++++++++++++++++++++++++------------------
wildmatch.h | 23 +++++---
8 files changed, 232 insertions(+), 62 deletions(-)
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply
* MDaemon Notification -- Attachment Removed
From: Postmaster @ 2012-12-22 6:41 UTC (permalink / raw)
To: git
-------------------------------------------------------------------
MDaemon has detected restricted attachments within an email message
-------------------------------------------------------------------
>From : git@vger.kernel.org
To : vcsc@vinalinescontainer.com
Subject : STATUS
Message-ID:
---------------------
Attachment(s) removed
---------------------
vcsc@vinalinescontainer.com
^ permalink raw reply
* Re: Re: Change in cvsps maintainership, abd a --fast-export option
From: Eric S. Raymond @ 2012-12-22 6:21 UTC (permalink / raw)
To: Heiko Voigt; +Cc: Michael Haggerty, git
In-Reply-To: <20121222034751.GA11635@book-mint>
Heiko Voigt <hvoigt@hvoigt.net>:
> Back then when I was converting some repositories to git and I also
> wrote a quick testsuite for cvsps in an attempt to fix the bugs but gave
> up. That was the point when I wrote about cvsimports limitations in the
> documentation.
>
> My commits can be found here:
>
> http://repo.or.cz/w/cvsps-hv.git
>
> I just quickly checked and it seems that it does not run cleanly on a
> modern Linux anymore. If it is of interest to you I can try to get it
> running again.
That would be helpful. Please give it some effort.
I'm going to work on merging the cvsps patches Yann Dirson has been
accumulating.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply
* Re: Re: Change in cvsps maintainership, abd a --fast-export option
From: Heiko Voigt @ 2012-12-22 3:47 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: Michael Haggerty, git
In-Reply-To: <20121221104437.GA5244@thyrsus.com>
Hi,
On Fri, Dec 21, 2012 at 05:44:37AM -0500, Eric S. Raymond wrote:
> Michael Haggerty <mhagger@alum.mit.edu>:
> > In 2009 I added tests demonstrating some of the erroneous behavior of
> > git-cvsimport. The failing tests in t9601-t9603 are concrete examples
> > of the problems mentioned in the manpage.
>
> Thanks, that will be extremely useful. One of the things I'm putting effort
> into is building a good test suite for the tool; I may well be able to adapt
> your tests directly.
Back then when I was converting some repositories to git and I also
wrote a quick testsuite for cvsps in an attempt to fix the bugs but gave
up. That was the point when I wrote about cvsimports limitations in the
documentation.
My commits can be found here:
http://repo.or.cz/w/cvsps-hv.git
I just quickly checked and it seems that it does not run cleanly on a
modern Linux anymore. If it is of interest to you I can try to get it
running again.
Cheers Heiko
^ permalink raw reply
* Re: [PATCH v2] mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder
From: Junio C Hamano @ 2012-12-22 1:53 UTC (permalink / raw)
To: David Aguilar; +Cc: Jeremy Morton, git
In-Reply-To: <7v4njf2xrk.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> By the way, who is going to remove this temporary file once the
> command is done?
Nevermind; I can see that once the backend returns it is removed in
the same function.
^ permalink raw reply
* Missing Refs after Garbage Collection
From: Earl Gresh @ 2012-12-22 1:41 UTC (permalink / raw)
To: git
Hi-
I have observed that after running GC, one particular git repository ended up with some missing refs in the refs/changes/* namespace the Gerrit uses for storing patch sets. The refs were valid and should not have been pruned. Concerned about loosing data, GC is still enabled but ref packing is turned off. Now the number of refs has grown to the point that it's causing performance problems when cloning the project.
Is anyone familiar with git gc deleting valid references? I'm running git version 1.7.8. Have there been any patches in later git releases that might address this issue ( if it is a git problem )?
Thanks
^ permalink raw reply
* What's cooking in git.git (Dec 2012, #06; Fri, 21)
From: Junio C Hamano @ 2012-12-21 23:59 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.
I'll do another rc (hopefully final) for this cycle tomorrow, with
documentation updates that are already in 'master'. The toolchain
to prepare preformatted documentation pages in HTML/man formats have
been updated to the latest AsciiDoc (from 8.5.2 to 8.6.8), and I'd
appreciate it if people can report possible regressions (I already
know the updated toolchain fixes the pretty-quotes that appear in
some pages, e.g. "git fast-import", look for "Here <name").
You can find the changes described here in the integration branches of the
repositories listed at
http://git-blame.blogspot.com/p/git-public-repositories.html
--------------------------------------------------
[Graduated to "master"]
* as/doc-for-devs (2012-12-16) 2 commits
(merged to 'next' on 2012-12-18 at ff1f37e)
+ Documentation: move support for old compilers to CodingGuidelines
+ SubmittingPatches: add convention of prefixing commit messages
It might be a better idea to move the text the bottom one adds to
the extended description from the quick checklist part.
Will fast-track to the upcoming release.
* cr/doc-checkout-branch (2012-12-18) 2 commits
(merged to 'next' on 2012-12-19 at e14b6c4)
+ Documentation/git-checkout.txt: document 70c9ac2 behavior
+ Documentation/git-checkout.txt: clarify usage
Document the magic "git checkout <no-such-branch>" hack to create
local branch out of a remote tracking branch that hasn't been
documented so far.
Will fast-track to the upcoming release.
* jc/doc-diff-blobs (2012-12-18) 1 commit
(merged to 'next' on 2012-12-19 at 82c5000)
+ Documentation: Describe "git diff <blob> <blob>" separately
"git diff <blob> <blob>" was not documented and was only hinted as
an extension to "git diff <commit> <commit> -- <pathspec>", but
comparison between two blobs are more special than that. It does
not take any pathspec to begin with.
Will fast-track to the upcoming release.
* jc/fetch-tags-doc (2012-12-13) 1 commit
(merged to 'next' on 2012-12-17 at 857413a)
+ fetch --tags: clarify documentation
"git fetch --tags" was explained as if it were "git fetch
--no-no-tags", which is not the case, causing confusion.
Will fast-track to the upcoming release.
* jk/avoid-mailto-invalid-in-doc (2012-12-16) 1 commit
(merged to 'next' on 2012-12-18 at 81dac40)
+ Documentation: don't link to example mail addresses
Avoids invalid sample e-mail addresses from becoming mailto links
in the formatted output.
Will fast-track to the upcoming release.
* jk/mailmap-cleanup (2012-12-12) 5 commits
(merged to 'next' on 2012-12-17 at 07c1a11)
+ contrib: update stats/mailmap script
+ .mailmap: normalize emails for Linus Torvalds
+ .mailmap: normalize emails for Jeff King
+ .mailmap: fix broken entry for Martin Langhoff
+ .mailmap: match up some obvious names/emails
Update various entries in our .mailmap file.
Will fast-track to the upcoming release.
* nd/index-format-doc (2012-12-13) 1 commit
(merged to 'next' on 2012-12-17 at 7984924)
+ index-format.txt: clarify what is "invalid"
Will fast-track to the upcoming release.
* sl/git-svn-docs (2012-12-05) 4 commits
(merged to 'next' on 2012-12-07 at 5bfbb73)
+ git-svn: Note about tags.
+ git-svn: Expand documentation for --follow-parent
+ git-svn: Recommend use of structure options.
+ git-svn: Document branches with at-sign(@).
Will fast-track to the upcoming release.
* sl/readme-gplv2 (2012-12-15) 2 commits
(merged to 'next' on 2012-12-18 at c839810)
+ README: it does not matter who the current maintainer is
+ README: Git is released under the GPLv2, not just "the GPL"
Clarify that the project as a whole is GPLv2 only, with some parts
borrowed under different licenses that are compatible with GPLv2.
Will fast-track to the upcoming release.
* ta/api-index-doc (2012-12-16) 1 commit
(merged to 'next' on 2012-12-18 at a251888)
+ Remove misleading date from api-index-skel.txt
Will fast-track to the upcoming release.
* ta/new-command-howto (2012-12-21) 1 commit
(merged to 'next' on 2012-12-21 at 5d0f65f)
+ Move ./technical/api-command.txt to ./howto/new-command.txt
Will fast-track to the upcoming release.
--------------------------------------------------
[New Topics]
* jc/mkstemp-more-careful-error-reporting (2012-12-18) 1 commit
- xmkstemp(): avoid showing truncated template more carefully
An earlier patch to save original arguments to mkstemp() away and
use it to report what filename we failed to create incorrectly used
the buffer munged by failing mkstemp().
Will merge to 'next'.
* jc/maint-test-portability (2012-12-19) 3 commits
- t4014: fix arguments to grep
- t9502: do not assume GNU tar
- t0200: "locale" may not exist
(this branch is used by jc/test-portability.)
Minor test fixes noticed while running our tests on OpenBSD 5.2,
applicable to 'maint'.
Will merge to 'next'.
* jc/test-portability (2012-12-19) 3 commits
- t9020: use configured Python to run the test helper
- t3600: Avoid "cp -a", which is a GNUism
- Merge branch 'jc/maint-test-portability' into 'jc/test-portability'
(this branch uses jc/maint-test-portability.)
The remainder of jc/maint-test-portability, applicable to 'master'.
Will merge to 'next'.
* jc/maint-fnmatch-old-style-definition (2012-12-19) 1 commit
- compat/fnmatch: update old-style definition to ANSI
Update old-style function definition "int foo(bar) int bar; {}"
to "int foo(int bar) {}".
Will merge to 'next'.
* jk/pathspec-literal (2012-12-19) 1 commit
- add global --literal-pathspecs option
Allow scripts to feed literal paths to commands that take
pathspecs, by disabling wildcard globbing.
Will merge to 'next'.
* da/p4merge-mktemp (2012-12-21) 1 commit
- mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder
Create an empty file in $TMPDIR instead of using an empty file in
the local directory (but why?).
* er/python-version-requirements (2012-12-20) 2 commits
- (squash???) remote-helpers/git/__init__.py needs sys before checking sys.hexversion
- Python scripts: check minimum compatible version after auditing
Will merge to 'next' after getting an Ack on the top-squash.
* jc/unpack-file-in-tmpdir (2012-12-19) 1 commit
- unpack-file: allow output to be in $TMPDIR
Throw-away "how about this" to teach unpack-file to use $TMPDIR to
store its output.
Will discard.
* mb/gitweb-highlight-link-target (2012-12-20) 1 commit
- Highlight the link target line in Gitweb using CSS
Expecting a reroll.
* mz/oneway-merge-wo-u-no-lstat (2012-12-20) 1 commit
- oneway_merge(): only lstat() when told to update worktree
Optimize "read-tree -m <tree-ish>" without "-u".
Will merge to 'next'.
* jk/repack-ref-racefix (2012-12-21) 1 commit
- refs: do not use cached refs in repack_without_ref
Race-fix for pack-refs running in parallel to ref creation.
Will merge to 'next'.
* rb/http-cert-cred-no-username-prompt (2012-12-21) 1 commit
- http.c: Avoid username prompt for certifcate credentials
There is no need to ask for username if the authentication is done
by certificate identity.
Will merge to 'next'.
--------------------------------------------------
[Stalled]
* jc/merge-blobs (2012-12-13) 5 commits
. [broken] wip to fix d/f conflicts
- merge-tree: add comments to clarify what these functions are doing
- merge-tree: lose unused "resolve_directories"
- merge-tree: lose unused "flags" from merge_list
- Which merge_file() function do you mean?
A beginning of a new merge strategy based on the disused merge-tree
proof-of-concept code.
* jc/doc-maintainer (2012-11-27) 1 commit
- update "howto maintain git"
An early draft that is still incomplete.
* fc/remote-bzr (2012-12-13) 10 commits
- (fixup) test-bzr.sh: fix multi-line string assignment
- remote-bzr: detect local repositories
- remote-bzr: add support for older versions of bzr
- remote-bzr: add support to push special modes
- remote-bzr: add support for fecthing special modes
- remote-bzr: add simple tests
- remote-bzr: update working tree upon pushing
- remote-bzr: add support for remote repositories
- remote-bzr: add support for pushing
- Add new remote-bzr transport helper
New remote helper for bzr (v3). With minor fixes, this may be ready
for 'next'.
* mo/cvs-server-updates (2012-12-09) 18 commits
- t9402: Use TABs for indentation
- t9402: Rename check.cvsCount and check.list
- t9402: Simplify git ls-tree
- t9402: Add missing &&; Code style
- t9402: No space after IO-redirection
- t9402: Dont use test_must_fail cvs
- t9402: improve check_end_tree() and check_end_full_tree()
- t9402: sed -i is not portable
- cvsserver Documentation: new cvs ... -r support
- cvsserver: add t9402 to test branch and tag refs
- cvsserver: support -r and sticky tags for most operations
- cvsserver: Add version awareness to argsfromdir
- cvsserver: generalize getmeta() to recognize commit refs
- cvsserver: implement req_Sticky and related utilities
- cvsserver: add misc commit lookup, file meta data, and file listing functions
- cvsserver: define a tag name character escape mechanism
- cvsserver: cleanup extra slashes in filename arguments
- cvsserver: factor out git-log parsing logic
Needs review by folks interested in cvsserver.
* as/check-ignore (2012-11-08) 14 commits
- t0007: fix tests on Windows
- Documentation/check-ignore: we show the deciding match, not the first
- Add git-check-ignore sub-command
- dir.c: provide free_directory() for reclaiming dir_struct memory
- pathspec.c: move reusable code from builtin/add.c
- dir.c: refactor treat_gitlinks()
- dir.c: keep track of where patterns came from
- dir.c: refactor is_path_excluded()
- dir.c: refactor is_excluded()
- dir.c: refactor is_excluded_from_list()
- dir.c: rename excluded() to is_excluded()
- dir.c: rename excluded_from_list() to is_excluded_from_list()
- dir.c: rename path_excluded() to is_path_excluded()
- dir.c: rename cryptic 'which' variable to more consistent name
Duy helped to reroll this.
Expecting a re-roll.
* aw/rebase-am-failure-detection (2012-10-11) 1 commit
- rebase: Handle cases where format-patch fails
I am unhappy a bit about the possible performance implications of
having to store the output in a temporary file only for a rare case
of format-patch aborting.
* jk/lua-hackery (2012-10-07) 6 commits
- pretty: fix up one-off format_commit_message calls
- Minimum compilation fixup
- Makefile: make "lua" a bit more configurable
- add a "lua" pretty format
- add basic lua infrastructure
- pretty: make some commit-parsing helpers more public
Interesting exercise. When we do this for real, we probably would want
to wrap a commit to make it more like an "object" with methods like
"parents", etc.
* fc/remote-testgit-feature-done (2012-10-29) 1 commit
- remote-testgit: properly check for errors
Needs review and Ack (or Nack) from people involved in the remote
helper interface for this to move forward.
* rc/maint-complete-git-p4 (2012-09-24) 1 commit
(merged to 'next' on 2012-10-29 at af52cef)
+ Teach git-completion about git p4
Comment from Pete will need to be addressed in a follow-up patch.
* jc/maint-name-rev (2012-09-17) 7 commits
- describe --contains: use "name-rev --algorithm=weight"
- name-rev --algorithm=weight: tests and documentation
- name-rev --algorithm=weight: cache the computed weight in notes
- name-rev --algorithm=weight: trivial optimization
- name-rev: --algorithm option
- name_rev: clarify the logic to assign a new tip-name to a commit
- name-rev: lose unnecessary typedef
"git name-rev" names the given revision based on a ref that can be
reached in the smallest number of steps from the rev, but that is
not useful when the caller wants to know which tag is the oldest one
that contains the rev. This teaches a new mode to the command that
uses the oldest ref among those which contain the rev.
I am not sure if this is worth it; for one thing, even with the help
from notes-cache, it seems to make the "describe --contains" even
slower. Also the command will be unusably slow for a user who does
not have a write access (hence unable to create or update the
notes-cache).
Stalled mostly due to lack of responses.
* jc/xprm-generation (2012-09-14) 1 commit
- test-generation: compute generation numbers and clock skews
A toy to analyze how bad the clock skews are in histories of real
world projects.
Stalled mostly due to lack of responses.
* jc/blame-no-follow (2012-09-21) 2 commits
- blame: pay attention to --no-follow
- diff: accept --no-follow option
Teaches "--no-follow" option to "git blame" to disable its
whole-file rename detection.
Stalled mostly due to lack of responses.
* jc/doc-default-format (2012-11-26) 2 commits
- [SQAUSH] allow "cd Doc* && make DEFAULT_DOC_TARGET=..."
- Allow generating a non-default set of documentation
Need to address the installation half if this is to be any useful.
* mk/maint-graph-infinity-loop (2012-09-25) 1 commit
- graph.c: infinite loop in git whatchanged --graph -m
The --graph code fell into infinite loop when asked to do what the
code did not expect ;-)
Anybody who worked on "--graph" wants to comment?
Stalled mostly due to lack of responses.
* jc/add-delete-default (2012-08-13) 1 commit
- git add: notice removal of tracked paths by default
"git add dir/" updated modified files and added new files, but does
not notice removed files, which may be "Huh?" to some users. They
can of course use "git add -A dir/", but why should they?
Resurrected from graveyard, as I thought it was a worthwhile thing
to do in the longer term.
Waiting for comments.
* mb/remote-default-nn-origin (2012-07-11) 6 commits
- Teach get_default_remote to respect remote.default.
- Test that plain "git fetch" uses remote.default when on a detached HEAD.
- Teach clone to set remote.default.
- Teach "git remote" about remote.default.
- Teach remote.c about the remote.default configuration setting.
- Rename remote.c's default_remote_name static variables.
When the user does not specify what remote to interact with, we
often attempt to use 'origin'. This can now be customized via a
configuration variable.
Expecting a re-roll.
"The first remote becomes the default" bit is better done as a
separate step.
--------------------------------------------------
[Cooking]
* wk/submodule-update-remote (2012-12-19) 3 commits
- submodule add: If --branch is given, record it in .gitmodules
- submodule update: add --remote for submodule's upstream changes
- submodule: add get_submodule_config helper funtion
The beginning of 'integrate with the tip of the remote branch, not
the commit recorded in the superproject gitlink' support.
Will merge to 'next'.
* cc/no-gitk-build-dependency (2012-12-18) 3 commits
- Makefile: replace "echo 1>..." with "echo >..."
- Makefile: detect when PYTHON_PATH changes
- Makefile: remove tracking of TCLTK_PATH
Remove leftover bits from an earlier change to move gitk in its own
subdirectory. Reimplementing the dependency tracking rules needs
to be done in gitk history separately.
Will merge to 'next'.
* jc/format-color-auto (2012-12-17) 2 commits
(merged to 'next' on 2012-12-18 at 5aaac94)
+ log --format: teach %C(auto,black) to respect color config
+ t6006: clean up whitespace
Introduce "log --format=%C(auto,blue)Foo%C(auto,reset)" that does
not color its output when writing to a non-terminal.
Will cook in 'next'.
* ss/svn-prompt (2012-12-17) 3 commits
- git-svn, perl/Git.pm: extend and use Git->prompt method for querying users
- perl/Git.pm: Honor SSH_ASKPASS as fallback if GIT_ASKPASS is not set
- git-svn, perl/Git.pm: add central method for prompting passwords
Waiting for an Ack from the area export.
* zk/clean-report-failure (2012-12-17) 1 commit
- git-clean: Display more accurate delete messages
"git clean" states what it is going to remove and then goes on to
remove it, but sometimes it only discovers things that cannot be
removed after recursing into a directory, which makes the output
confusing and even wrong.
* mp/complete-paths (2012-12-21) 1 commit
- git-completion.bash: add support for path completion
The completion script used to let the default completer to suggest
pathnames, which gave too many irrelevant choices (e.g. "git add"
would not want to add an unmodified path). Teach it to use a more
git-aware logic to enumerate only relevant ones.
Waiting for area-experts review.
* ja/directory-attrs (2012-12-17) 1 commit
(merged to 'next' on 2012-12-17 at ced8e73)
+ Add directory pattern matching to attributes
The attribute mechanism didn't allow limiting attributes to be
applied to only a single directory itself with "path/" like the
exclude mechanism does.
Will cook in 'next'.
* jk/mailmap-from-blob (2012-12-13) 5 commits
(merged to 'next' on 2012-12-17 at 14b7cdc)
+ mailmap: default mailmap.blob in bare repositories
+ mailmap: fix some documentation loose-ends for mailmap.blob
+ mailmap: clean up read_mailmap error handling
+ mailmap: support reading mailmap from blobs
+ mailmap: refactor mailmap parsing for non-file sources
Allow us to read, and default to read, mailmap files from the tip
of the history in bare repositories. This will help running tools
like shortlog in server settings.
Will cook in 'next'.
* dm/port (2012-12-19) 4 commits
- git-compat-util.h: do not #include <sys/param.h> by default
- Generalize the inclusion of strings.h
- Detect when the passwd struct is missing pw_gecos
- Support builds when sys/param.h is missing
(this branch is used by mk/qnx.)
Will merge to 'next'.
* jk/complete-commit-c (2012-12-15) 1 commit
(merged to 'next' on 2012-12-18 at 75b5f21)
+ completion: complete refs for "git commit -c"
Complete "git commmit -c foo<TAB>" into a refname that begins with
"foo".
Will cook in 'next'.
* jk/error-const-return (2012-12-15) 2 commits
- silence some -Wuninitialized false positives
- make error()'s constant return value more visible
Help compilers' flow analysis by making it more explicit that
error() always returns -1, to reduce false "variable used
uninitialized" warnings. Looks somewhat ugly but not too much.
Will merge to 'next'.
* mk/qnx (2012-12-19) 2 commits
- Port to QNX
- Make lock local to fetch_pack
(this branch uses dm/port.)
Port to QNX; we may want to rebase this on top of dm/port topic as
it also wants to use the HAVE_STRINGS_H mechanism it introduces.
Will merge to 'next'.
* rj/maint-cygwin-say-color (2012-12-15) 1 commit
- tests: Allow customization of how say_color() prints
Even though I do not think of a cleaner way to do this, I am not
happy with the way how $GIT_TEST_PRINT and $GIT_TEST_PRINT_LN are
interpolated into the command line with token splitting at $IFS.
Will discard, per discussion with the author.
* as/test-tweaks (2012-12-20) 7 commits
- tests: paint unexpectedly fixed known breakages in bold red
- tests: test the test framework more thoroughly
- tests: refactor mechanics of testing in a sub test-lib
- tests: change info messages from yellow/brown to cyan
- tests: paint skipped tests in blue
- tests: paint known breakages in yellow
- tests: test number comes first in 'not ok $count - $message'
Various minor tweaks to the test framework to paint its output
lines in colors that match what they mean better.
Will merge to 'next'.
* sp/shortlog-missing-lf (2012-12-11) 2 commits
(merged to 'next' on 2012-12-11 at 64b8429)
+ strbuf_add_wrapped*(): Remove unused return value
+ shortlog: fix wrapping lines of wraplen
When a line to be wrapped has a solid run of non space characters
whose length exactly is the wrap width, "git shortlog -w" failed to
add a newline after such a line.
Will cook in 'next'.
* ap/log-mailmap (2012-12-15) 7 commits
- test: Add test for --use-mailmap option
- log: Add --use-mailmap option
- pretty: Use mailmap to display username and email
- mailmap: Add mailmap structure to rev_info and pp
- mailmap: Simplify map_user() interface
- mailmap: Remove buffer length limit in map_user
- Use split_ident_line to parse author and committer
Clean up various codepaths around mailmap and teach the "log"
machinery to use it.
Will merge to 'next' after reading it over once again.
* jc/fetch-ignore-symref (2012-12-11) 1 commit
(merged to 'next' on 2012-12-17 at 370e2c8)
+ fetch: ignore wildcarded refspecs that update local symbolic refs
Avoid false error from an attempt to update local symbolic ref via
fetch.
Will cook in 'next'.
* md/gitweb-sort-by-age (2012-12-11) 1 commit
(merged to 'next' on 2012-12-13 at 9f39410)
+ gitweb: Sort projects with undefined ages last
Gitweb showed repositories without any commit at the top in its
age-sorted view, in which the users are interested in looking at
active projects; sorting them at the bottom makes it more useful.
Will cook in 'next'.
* ss/nedmalloc-compilation (2012-12-11) 1 commit
(merged to 'next' on 2012-12-13 at c1f0d7f)
+ nedmalloc: Fix a compile warning (exposed as error) with GCC 4.7.2
Will cook in 'next'.
* jc/maint-fbsd-sh-ifs-workaround (2012-12-10) 1 commit
(merged to 'next' on 2012-12-11 at 6659fdc)
+ sh-setup: work around "unset IFS" bug in some shells
Will cook in 'next'.
* jc/same-encoding (2012-12-10) 1 commit
(merged to 'next' on 2012-12-17 at 86b41c7)
+ format_commit_message(): simplify calls to logmsg_reencode()
Finishing touches to the series to unify "Do we need to reencode
between these two encodings?" logic.
Will cook in 'next'.
* nd/invalidate-i-t-a-cache-tree (2012-12-15) 4 commits
(merged to 'next' on 2012-12-18 at 33e4488)
+ cache-tree: invalidate i-t-a paths after generating trees
+ cache-tree: fix writing cache-tree when CE_REMOVE is present
+ cache-tree: replace "for" loops in update_one with "while" loops
+ cache-tree: remove dead i-t-a code in verify_cache()
Writing out a tree object when you still have intent-to-add entries
in the index left an incorrect cache-tree data there.
Will cook in 'next'.
* jl/submodule-deinit (2012-12-04) 1 commit
(merged to 'next' on 2012-12-07 at ea772f0)
+ submodule: add 'deinit' command
There was no Porcelain way to say "I no longer am interested in
this submodule", once you express your interest in a submodule with
"submodule init". "submodule deinit" is the way to do so.
Will cook in 'next'.
* pf/editor-ignore-sigint (2012-12-02) 5 commits
(merged to 'next' on 2012-12-07 at 6b04419)
+ launch_editor: propagate signals from editor to git
+ run-command: do not warn about child death from terminal
+ launch_editor: ignore terminal signals while editor has control
+ launch_editor: refactor to use start/finish_command
+ run-command: drop silent_exec_failure arg from wait_or_whine
Avoid confusing cases where the user hits Ctrl-C while in the editor
session, not realizing git will receive the signal. Since most editors
will take over the terminal and will block SIGINT, this is not likely
to confuse anyone.
Will cook in 'next'.
* bc/append-signed-off-by (2012-11-26) 11 commits
- Unify appending signoff in format-patch, commit and sequencer
- format-patch: update append_signoff prototype
- format-patch: stricter S-o-b detection
- t4014: more tests about appending s-o-b lines
- sequencer.c: teach append_signoff to avoid adding a duplicate newline
- sequencer.c: teach append_signoff how to detect duplicate s-o-b
- sequencer.c: always separate "(cherry picked from" from commit body
- sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
- t/t3511: add some tests of 'cherry-pick -s' functionality
- t/test-lib-functions.sh: allow to specify the tag name to test_commit
- sequencer.c: remove broken support for rfc2822 continuation in footer
Expecting a re-roll after a review.
* mh/unify-xml-in-imap-send-and-http-push (2012-12-02) 8 commits
(merged to 'next' on 2012-12-03 at d677090)
+ wrap_in_html(): process message in bulk rather than line-by-line
+ wrap_in_html(): use strbuf_addstr_xml_quoted()
+ imap-send: change msg_data from storing (ptr, len) to storing strbuf
+ imap-send: correctly report errors reading from stdin
+ imap-send: store all_msgs as a strbuf
+ lf_to_crlf(): NUL-terminate msg_data::data
+ xml_entities(): use function strbuf_addstr_xml_quoted()
+ Add new function strbuf_add_xml_quoted()
Update imap-send to reuse xml quoting code from http-push codepath,
clean up some code, and fix a small bug.
Will cook in 'next'.
* jk/fsck-dot-in-trees (2012-11-28) 2 commits
(merged to 'next' on 2012-11-28 at 519dabc)
+ fsck: warn about ".git" in trees
+ fsck: warn about '.' and '..' in trees
Will cook in 'next'.
* mh/pthreads-autoconf (2012-11-27) 1 commit
(merged to 'next' on 2012-11-28 at 780600e)
+ configure.ac: fix pthreads detection on Mac OS X
Will cook in 'next'.
* jn/warn-on-inaccessible-loosen (2012-10-14) 4 commits
(merged to 'next' on 2012-11-28 at 43d51c2)
+ config: exit on error accessing any config file
+ doc: advertise GIT_CONFIG_NOSYSTEM
+ config: treat user and xdg config permission problems as errors
+ config, gitignore: failure to access with ENOTDIR is ok
An RFC to deal with a situation where .config/git is a file and we
notice .config/git/config is not readable due to ENOTDIR, not
ENOENT.
Will cook in 'next'.
* mh/ceiling (2012-10-29) 8 commits
(merged to 'next' on 2012-11-26 at d1ce76a)
+ string_list_longest_prefix(): remove function
+ setup_git_directory_gently_1(): resolve symlinks in ceiling paths
+ longest_ancestor_length(): require prefix list entries to be normalized
+ longest_ancestor_length(): take a string_list argument for prefixes
+ longest_ancestor_length(): use string_list_split()
+ Introduce new function real_path_if_valid()
+ real_path_internal(): add comment explaining use of cwd
+ Introduce new static function real_path_internal()
Elements of GIT_CEILING_DIRECTORIES list may not match the real
pathname we obtain from getcwd(), leading the GIT_DIR discovery
logic to escape the ceilings the user thought to have specified.
Resurrected from Stalled; the earlier performance fear was
unwarranted.
Will cook in 'next'.
* fc/fast-export-fixes (2012-12-03) 15 commits
(merged to 'next' on 2012-12-03 at f9df523)
+ fast-export: make sure updated refs get updated
+ fast-export: don't handle uninteresting refs
+ fast-export: fix comparison in tests
+ fast-export: trivial cleanup
+ remote-testgit: implement the "done" feature manually
+ remote-testgit: report success after an import
+ remote-testgit: exercise more features
+ remote-testgit: cleanup tests
+ remote-testgit: remove irrelevant test
+ remote-testgit: remove non-local functionality
+ Add new simplified git-remote-testgit
+ Rename git-remote-testgit to git-remote-testpy
+ remote-helpers: fix failure message
+ remote-testgit: fix direction of marks
+ fast-export: avoid importing blob marks
Will cook in 'next'.
* jc/apply-trailing-blank-removal (2012-10-12) 1 commit
(merged to 'next' on 2012-11-26 at 3af69e7)
+ apply.c:update_pre_post_images(): the preimage can be truncated
Fix to update_pre_post_images() that did not take into account the
possibility that whitespace fix could shrink the preimage and
change the number of lines in it.
Will cook in 'next'.
* nd/pathspec-wildcard (2012-11-26) 4 commits
(merged to 'next' on 2012-12-03 at eca0fcb)
+ tree_entry_interesting: do basedir compare on wildcard patterns when possible
+ pathspec: apply "*.c" optimization from exclude
+ pathspec: do exact comparison on the leading non-wildcard part
+ pathspec: save the non-wildcard length part
Will cook in 'next'.
* nd/wildmatch (2012-12-15) 15 commits
(merged to 'next' on 2012-12-15 at c734714)
+ t3070: Disable some failing fnmatch tests
(merged to 'next' on 2012-11-21 at 151288f)
+ test-wildmatch: avoid Windows path mangling
(merged to 'next' on 2012-10-25 at 510e8df)
+ Support "**" wildcard in .gitignore and .gitattributes
+ wildmatch: make /**/ match zero or more directories
+ wildmatch: adjust "**" behavior
+ wildmatch: fix case-insensitive matching
+ wildmatch: remove static variable force_lower_case
+ wildmatch: make wildmatch's return value compatible with fnmatch
+ t3070: disable unreliable fnmatch tests
+ Integrate wildmatch to git
+ wildmatch: follow Git's coding convention
+ wildmatch: remove unnecessary functions
+ Import wildmatch from rsync
+ ctype: support iscntrl, ispunct, isxdigit and isprint
+ ctype: make sane_ctype[] const array
Allows pathname patterns in .gitignore and .gitattributes files
with double-asterisks "foo/**/bar" to match any number of directory
hierarchies.
I suspect that this needs to be plugged to pathspec matching code;
otherwise "git log -- 'Docum*/**/*.txt'" would not show the log for
commits that touch Documentation/git.txt, which would be confusing
to the users.
Will cook in 'next'.
* cr/push-force-tag-update (2012-12-03) 10 commits
(merged to 'next' on 2012-12-04 at af2e3a9)
+ push: allow already-exists advice to be disabled
+ push: rename config variable for more general use
+ push: cleanup push rules comment
+ push: clarify rejection of update to non-commit-ish
+ push: require force for annotated tags
+ push: require force for refs under refs/tags/
+ push: flag updates that require force
+ push: keep track of "update" state separately
+ push: add advice for rejected tag reference
+ push: return reject reasons as a bitset
Require "-f" for push to update a tag, even if it is a fast-forward.
Will cook in 'next'.
^ permalink raw reply
* Re: Pushing symbolic references to remote repositories?
From: Junio C Hamano @ 2012-12-21 23:11 UTC (permalink / raw)
To: Dun Peal; +Cc: Shawn Pearce, Git ML
In-Reply-To: <CAJo=hJvqptfKqM+6J8Ddfb5qcqjAU8bB_JO9VB-XVsCCf64NUQ@mail.gmail.com>
Shawn Pearce <spearce@spearce.org> writes:
> On Fri, Dec 21, 2012 at 11:53 AM, Dun Peal <dunpealer@gmail.com> wrote:
>>
>> Is there a clean and reliable way to do that, or are symbolic
>> references just not meant to be shared?
>
> There is no support for symbolic references in the network protocol,
> so they cannot currently be shared by git push or git fetch.
What Shawn said is technically correct, but do not read it as "we
know what protocol update we want at the network level, but we
haven't got around implementing it".
It is unclear what it means to send symrefs across repositories
(rather, what we want it to mean). In that sense, the reality is
closer to the latter of your choices.
There are three primary kinds of symrefs to consider:
* worktree/.git/HEAD is meant to point at the branch that is
currently checked out. This is designed to be under sole control
of the person who is working in such a repository and the outside
people have no business knowing which branch he happens to be
working on at this very moment (it can change the next minute).
* worktree/.git/refs/remotes/$name/HEAD is meant to point at the
remote-tracking branch of the named remote (e.g. 'origin') the
local user is interested in, to let "git checkout -b topic
origin" work, instead of a longer "git checkout -b topic
origin/master".
* bare.git/HEAD is meant to point at the "primary" branch at a
bare, distribution repository nobody works in directly. The
branch pointed at by the symref rarely, if ever, changes.
Nobody will imagine flipping worktree/.git/HEAD from outside by
pushing into it (unless you are trying to pull a prank on the user
who is working in that repository). Also, nobody would want to
update this symref by fetching from outside. So we won't have to
consider updating the first kind in the following discussion.
It is unlikely that anybody sane wants to update the remote-tracking
worktree/.git/refs/remotes/origin/HEAD from outside by pushing.
It *may* make sense to update it upon fetching, though, in some
cases. You first clone from bare.git/HEAD and learn [*1*] that the
primary branch at the time of cloning was 'master', and
remote/origin/HEAD in your repository is set to point at
origin/master. Now the upstream designates a different branch as
the primary (perhaps 'trunk'), and you may want your next "git
fetch" to repoint your remote/origin/HEAD to point at
'remote/origin/trunk'.
However, even this one is not unconditionally a good idea. The
branch you are interested in might be different from what your
remote designates as its primary branch in the first place. You may
for example want to follow along 'next' after cloning from me. E.g.
$ git clone git://git.kernel.org/pub/scm/git/git.git git
$ cd git
$ git symbolic-ref refs/remotes/origin/HEAD
refs/remotes/origin/next
It is not clear if it is a good idea to allow "git fetch" to repoint
your remotes/origin/HEAD to whatever I chose to point my HEAD at.
So for the second kind, pushing is irrelevant, and fetching is
"perhaps sometimes it may make sense".
I think that the only one and a half sensible use cases that
unconditionally make sense to update symrefs across repositories are
to update bare.git/HEAD symref:
- update bare.git/HEAD of a repository that is a local mirror of a
more authoritative repository with "git fetch --mirror", in which
case you do want to follow what branch is designated as the
primary by the project you are mirroring from;
- update bare.git/HEAD from outside by some means to change which
branch is the primary one for the project. Only because your
hosting site does not give you an easy way to do so, pushing from
another repository that happens to point its HEAD at a different
branch seems to be one plausible way to do so, but that does not
have to be the only way.
[Footnote]
*1* We would need to update the network protocol for this purpose,
as most transports do not carry this information and clone has to
guess which branch bare.git/HEAD points at.
The purpose of this message, though, is to illustrate that the
protocol update to carry the information is not the end of the
story, but merely is an enabling beginning. We need to know what
semantics we would want to implement on top of that transfer.
^ permalink raw reply
* Re: Installation Plan
From: Andrew Ardill @ 2012-12-21 22:48 UTC (permalink / raw)
To: Dennis Putnam; +Cc: git@vger.kernel.org
In-Reply-To: <50D475A9.9020407@bellsouth.net>
hi Dennis,
In general your plan looks good. Note that you don't actually need the
Eclipse plugin at all, it just makes it possible to do git operations
while in your IDE. Most people will, even if they have the plugin,
still use the full client as it provides a lot more power and
flexibility. Use whatever you need to, and extend your toolset when
required.
Also, the leap from central repository on Linux to a clone on Windows
needs a little more thought. Will you set up a git server? Access the
central repository over ssh? A shared drive? Many people use a web
service (such as Bitbucket or GitHub) for this purpose as it becomes
easier to manage. You can then have a clone on the Linux box as well
as the Windows box.
On 22 December 2012 01:43, Dennis Putnam <dap1@bellsouth.net> wrote:
> Am I over simplifying things? I also think that this will open the door
> for collaborators in the event I need them with no changes to the way I
> work. I should note that builds are done on demand so is there a way to
> detect when a push is occurring and have the build script wait for
> completion and I suppose vise-versa?
You want to look into the different hooks available, most notable the
post-receive hook. There are also build servers that can monitor a
repository and build whenever it sees a new commit (Jenkins and Bamboo
are two I know of).
Regards,
Andrew Ardill
^ permalink raw reply
* Re: Noob Question
From: Andrew Ardill @ 2012-12-21 22:38 UTC (permalink / raw)
To: W T Riker; +Cc: git@vger.kernel.org
In-Reply-To: <50D463C4.6030208@gmail.com>
On 22 December 2012 00:27, W T Riker <wtriker.ffe@gmail.com> wrote:
> One basic question, since I don't make changes from the Linux
> side, only builds, do I need to install anything git related on that
> machine?
You don't need to install it, but there is no harm in it. If you ever
start doing a build from the linux box and decide you have the wrong
version of your code, it would be useful to have git installed so you
can checkout the right version. Installing git is quick and painless,
however, so you can cross that bridge once you get to it.
Regards,
Andrew Ardill
^ 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