* Re* [PATCH] commit: make default of "cleanup" option configurable
From: Junio C Hamano @ 2013-01-10 19:37 UTC (permalink / raw)
To: git; +Cc: Jonathan Nieder, Ralf Thielow
In-Reply-To: <7vhamq8i44.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> I also wonder, as a longer term alternative (which would require a
> lot of code auditing and some refactoring), if it is useful to have
> an option and/or configuration that lets you configure the "comment
> in log message editor" character from the default "#" to something
> else. "git -c log.commentchar=% commit" may start the log message
> editor with something like this in it:
>
> % Please enter the commit message for your changes. Lines starting
> % with '%' will be ignored, and an empty message aborts the commit.
>
> Naturally, setting log.commentchar to "none" would disable stripping
> of any commented lines if such a feature existed, and stop issuing
> these helpful comments altogether, but still strip excess blank
> lines and trailing whitespaces.
>
> I wouldn't seriously suggest it as I am not sure if the usefulness
> of such a feature would outweigh the cost of coding it, though; at
> least not at this point yet.
A beginning of a patch to do would be like this, which does not look
too bad. There are some low hanging fruits I didn't bother to do in
this illustration (see NEEDSWORK comment in builtin/branch.c if some
of you are interested in pursuing it).
-- >8 --
From: Junio C Hamano <gitster@pobox.com>
Date: Thu, 10 Jan 2013 11:17:21 -0800
Subject: [PATCH] Allow custom "comment char"
Some users do want to write a line that begin with a pound sign,
#, in their commit log message. Many tracking system recognise
a token of #<bugid> form, for example.
The support we offer these use cases is not very friendly to the end
users. They have a choice between
- Don't do it. Avoid such a line by rewrapping or indenting; and
- Use --cleanup=whitespace but remove all the hint lines we add.
Give them a way to set a custom comment char, e.g.
$ git -c core.commentchar="%" commit
so that they do not have to do either of the two workarounds.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/config.txt | 6 ++++++
builtin/branch.c | 16 ++++++++++++----
builtin/commit.c | 15 ++++++++-------
builtin/fmt-merge-msg.c | 4 +++-
builtin/merge.c | 15 +++++++++++----
builtin/stripspace.c | 2 +-
cache.h | 6 ++++++
config.c | 8 ++++++++
environment.c | 6 ++++++
wt-status.c | 10 ++++++----
10 files changed, 67 insertions(+), 21 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index d5809e0..e99b9f2 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -528,6 +528,12 @@ core.editor::
variable when it is set, and the environment variable
`GIT_EDITOR` is not set. See linkgit:git-var[1].
+core.commentchar::
+ Commands such as `commit` and `tag` that lets you edit
+ messages consider a line that begins with this character
+ commented, and removes them after the editor returns
+ (default '#').
+
sequence.editor::
Text editor used by `git rebase -i` for editing the rebase insn file.
The value is meant to be interpreted by the shell when it is used.
diff --git a/builtin/branch.c b/builtin/branch.c
index 873f624..7f8865a 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -706,11 +706,19 @@ static int edit_branch_description(const char *branch_name)
read_branch_desc(&buf, branch_name);
if (!buf.len || buf.buf[buf.len-1] != '\n')
strbuf_addch(&buf, '\n');
+ /*
+ * NEEDSWORK: introduce a strbuf_commented_addf(), possibly
+ * sharing code with status_vprintf(), that makes each line
+ * commented with comment_line_char, and use it here and from
+ * other places (e.g. write_commented_object() and create_note()
+ * in builtin/notes.c and create_tag() in builtin/tag.c).
+ */
strbuf_addf(&buf,
- "# Please edit the description for the branch\n"
- "# %s\n"
- "# Lines starting with '#' will be stripped.\n",
- branch_name);
+ "%c Please edit the description for the branch\n"
+ "%c %s\n"
+ "%c Lines starting with '%c' will be stripped.\n",
+ comment_line_char, comment_line_char,
+ branch_name, comment_line_char, comment_line_char);
fp = fopen(git_path(edit_description), "w");
if ((fwrite(buf.buf, 1, buf.len, fp) < buf.len) || fclose(fp)) {
strbuf_release(&buf);
diff --git a/builtin/commit.c b/builtin/commit.c
index d6dd3df..a946a13 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -733,15 +733,16 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (cleanup_mode == CLEANUP_ALL)
status_printf(s, GIT_COLOR_NORMAL,
_("Please enter the commit message for your changes."
- " Lines starting\nwith '#' will be ignored, and an empty"
- " message aborts the commit.\n"));
+ " Lines starting\nwith '%c' will be ignored, and an empty"
+ " message aborts the commit.\n"), comment_line_char);
else /* CLEANUP_SPACE, that is. */
status_printf(s, GIT_COLOR_NORMAL,
- _("Please enter the commit message for your changes."
- " Lines starting\n"
- "with '#' will be kept; you may remove them"
- " yourself if you want to.\n"
- "An empty message aborts the commit.\n"));
+ _("Please enter the commit message for your changes."
+ " Lines starting\n"
+ "with '%c' will be kept; you may remove them"
+ " yourself if you want to.\n"
+ "An empty message aborts the commit.\n"),
+ comment_line_char);
if (only_include_assumed)
status_printf_ln(s, GIT_COLOR_NORMAL,
"%s", only_include_assumed);
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index e2e27b2..2261e1f 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -463,8 +463,10 @@ static void fmt_tag_signature(struct strbuf *tagbuf,
}
strbuf_complete_line(tagbuf);
if (sig->len) {
+ char comment_head[3];
+ sprintf(comment_head, "%c ", comment_line_char);
strbuf_addch(tagbuf, '\n');
- strbuf_add_lines(tagbuf, "# ", sig->buf, sig->len);
+ strbuf_add_lines(tagbuf, comment_head, sig->buf, sig->len);
}
}
diff --git a/builtin/merge.c b/builtin/merge.c
index 3a31c4b..632d860 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -788,17 +788,24 @@ static const char merge_editor_comment[] =
N_("Please enter a commit message to explain why this merge is necessary,\n"
"especially if it merges an updated upstream into a topic branch.\n"
"\n"
- "Lines starting with '#' will be ignored, and an empty message aborts\n"
+ "Lines starting with '%c' will be ignored, and an empty message aborts\n"
"the commit.\n");
static void prepare_to_commit(struct commit_list *remoteheads)
{
struct strbuf msg = STRBUF_INIT;
- const char *comment = _(merge_editor_comment);
+ const char *commentf = _(merge_editor_comment);
strbuf_addbuf(&msg, &merge_msg);
strbuf_addch(&msg, '\n');
- if (0 < option_edit)
- strbuf_add_lines(&msg, "# ", comment, strlen(comment));
+ if (0 < option_edit) {
+ struct strbuf hint = STRBUF_INIT;
+ char comment_head[3];
+
+ sprintf(comment_head, "%c ", comment_line_char);
+ strbuf_addf(&hint, commentf, comment_line_char);
+ strbuf_add_lines(&msg, comment_head, hint.buf, hint.len);
+ strbuf_release(&hint);
+ }
write_merge_msg(&msg);
if (run_hook(get_index_file(), "prepare-commit-msg",
git_path("MERGE_MSG"), "merge", NULL, NULL))
diff --git a/builtin/stripspace.c b/builtin/stripspace.c
index f16986c..600ca66 100644
--- a/builtin/stripspace.c
+++ b/builtin/stripspace.c
@@ -45,7 +45,7 @@ void stripspace(struct strbuf *sb, int skip_comments)
eol = memchr(sb->buf + i, '\n', sb->len - i);
len = eol ? eol - (sb->buf + i) + 1 : sb->len - i;
- if (skip_comments && len && sb->buf[i] == '#') {
+ if (skip_comments && len && sb->buf[i] == comment_line_char) {
newlen = 0;
continue;
}
diff --git a/cache.h b/cache.h
index c257953..0b435a4 100644
--- a/cache.h
+++ b/cache.h
@@ -562,6 +562,12 @@ extern int core_preload_index;
extern int core_apply_sparse_checkout;
extern int precomposed_unicode;
+/*
+ * The character that begins a commented line in user-editable file
+ * that is subject to stripspace.
+ */
+extern char comment_line_char;
+
enum branch_track {
BRANCH_TRACK_UNSPECIFIED = -1,
BRANCH_TRACK_NEVER = 0,
diff --git a/config.c b/config.c
index 7b444b6..d873c59 100644
--- a/config.c
+++ b/config.c
@@ -717,6 +717,14 @@ static int git_default_core_config(const char *var, const char *value)
if (!strcmp(var, "core.editor"))
return git_config_string(&editor_program, var, value);
+ if (!strcmp(var, "core.commentchar")) {
+ const char *comment;
+ int ret = git_config_string(&comment, var, value);
+ if (!ret)
+ comment_line_char = comment[0];
+ return ret;
+ }
+
if (!strcmp(var, "core.askpass"))
return git_config_string(&askpass_program, var, value);
diff --git a/environment.c b/environment.c
index 85edd7f..a40c38b 100644
--- a/environment.c
+++ b/environment.c
@@ -62,6 +62,12 @@ int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
struct startup_info *startup_info;
unsigned long pack_size_limit_cfg;
+/*
+ * The character that begins a commented line in user-editable file
+ * that is subject to stripspace.
+ */
+char comment_line_char = '#';
+
/* Parallel index stat data preload? */
int core_preload_index = 0;
diff --git a/wt-status.c b/wt-status.c
index 2a9658b..f6f197e 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -45,7 +45,7 @@ static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
strbuf_vaddf(&sb, fmt, ap);
if (!sb.len) {
- strbuf_addch(&sb, '#');
+ strbuf_addch(&sb, comment_line_char);
if (!trail)
strbuf_addch(&sb, ' ');
color_print_strbuf(s->fp, color, &sb);
@@ -59,7 +59,7 @@ static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
strbuf_reset(&linebuf);
if (at_bol) {
- strbuf_addch(&linebuf, '#');
+ strbuf_addch(&linebuf, comment_line_char);
if (*line != '\n' && *line != '\t')
strbuf_addch(&linebuf, ' ');
}
@@ -760,8 +760,10 @@ static void wt_status_print_tracking(struct wt_status *s)
for (cp = sb.buf; (ep = strchr(cp, '\n')) != NULL; cp = ep + 1)
color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s),
- "# %.*s", (int)(ep - cp), cp);
- color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
+ "%c %.*s", comment_line_char,
+ (int)(ep - cp), cp);
+ color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "%c",
+ comment_line_char);
}
static int has_unmerged(struct wt_status *s)
--
1.8.1.351.g191b7b1
^ permalink raw reply related
* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Junio C Hamano @ 2013-01-10 20:22 UTC (permalink / raw)
To: Jeff King; +Cc: Jonathan Nieder, git, Bart Trojanowski
In-Reply-To: <20130110112655.GB21993@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Maybe the right rule is "if we are using the shell to execute, do not
> mention SIGPIPE"? It seems a little iffy at first, but:
>
> 1. It tends to coincide with direct use of internal tools versus
> external tools.
>
> 2. We do not reliably get SIGPIPE there, anyway, since most shells
> will convert it into exit code 141 before we see it.
>
> I.e., something like:
Hmph. That may be a good heuristics, but I wonder if we also want
to special case WIFEXITED(status) && WEXITSTATUS(status) == 141 to
pretend as if nothing went wrong, when ignore_sigpipe is in effect?
> diff --git a/run-command.c b/run-command.c
> index 24eaad5..8bd0b08 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -226,7 +226,7 @@ static inline void set_cloexec(int fd)
> fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
> }
>
> -static int wait_or_whine(pid_t pid, const char *argv0)
> +static int wait_or_whine(pid_t pid, const char *argv0, int ignore_sigpipe)
> {
> int status, code = -1;
> pid_t waiting;
> @@ -242,7 +242,8 @@ static int wait_or_whine(pid_t pid, const char *argv0)
> error("waitpid is confused (%s)", argv0);
> } else if (WIFSIGNALED(status)) {
> code = WTERMSIG(status);
> - if (code != SIGINT && code != SIGQUIT)
> + if (code != SIGINT && code != SIGQUIT &&
> + (!ignore_sigpipe || code != SIGPIPE))
> error("%s died of signal %d", argv0, code);
> /*
> * This return value is chosen so that code & 0xff
> @@ -433,7 +434,7 @@ fail_pipe:
> * At this point we know that fork() succeeded, but execvp()
> * failed. Errors have been reported to our stderr.
> */
> - wait_or_whine(cmd->pid, cmd->argv[0]);
> + wait_or_whine(cmd->pid, cmd->argv[0], 0);
> failed_errno = errno;
> cmd->pid = -1;
> }
> @@ -538,7 +539,7 @@ int finish_command(struct child_process *cmd)
>
> int finish_command(struct child_process *cmd)
> {
> - return wait_or_whine(cmd->pid, cmd->argv[0]);
> + return wait_or_whine(cmd->pid, cmd->argv[0], cmd->use_shell);
> }
>
> int run_command(struct child_process *cmd)
> @@ -725,7 +726,7 @@ int finish_async(struct async *async)
> int finish_async(struct async *async)
> {
> #ifdef NO_PTHREADS
> - return wait_or_whine(async->pid, "child process");
> + return wait_or_whine(async->pid, "child process", 0);
> #else
> void *ret = (void *)(intptr_t)(-1);
>
^ permalink raw reply
* [PATCH] contrib/vim: simplify instructions for old vim support
From: Jonathan Nieder @ 2013-01-10 20:54 UTC (permalink / raw)
To: Jeff King; +Cc: Manlio Perillo, git@vger.kernel.org
In-Reply-To: <20130110113958.GA17137@sigill.intra.peff.net>
Rely on the upstream filetype.vim instead of duplicating its rules in
git's instructions for syntax highlighting support on pre-7.2 vim
versions.
The result is a shorter contrib/vim/README. More importantly, it lets
us punt on maintenance of the autocmd rules.
So now when we fix the upstream gitsendemail rule in light of commit
eed6ca7, new git users stuck on old vim reading contrib/vim/README can
automagically get the fix without any further changes needed to git.
Once the world has moved on to vim 7.2+ completely, we can get rid of
these instructions, but for now if they are this simple it's
effortless to keep them.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Jeff King wrote:
> I'd argue that we should just remove contrib/vim at this point. It has
> no actual files in it, only pointers to vim.org for pre-7.2 vim users.
I think that's reasonable. Of course we can still discuss enhancements
to the vim support on this list, but ultimately it's easiest to
distribute and document such work upstream in the usual way for vim
plugins.
How about this patch?
contrib/vim/README | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/contrib/vim/README b/contrib/vim/README
index fca1e17..8f16d06 100644
--- a/contrib/vim/README
+++ b/contrib/vim/README
@@ -17,16 +17,6 @@ To install:
1. Copy these files to vim's syntax directory $HOME/.vim/syntax
2. To auto-detect the editing of various git-related filetypes:
- $ cat >>$HOME/.vim/filetype.vim <<'EOF'
- autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit
- autocmd BufNewFile,BufRead *.git/config,.gitconfig setf gitconfig
- autocmd BufNewFile,BufRead git-rebase-todo setf gitrebase
- autocmd BufNewFile,BufRead .msg.[0-9]*
- \ if getline(1) =~ '^From.*# This line is ignored.$' |
- \ setf gitsendemail |
- \ endif
- autocmd BufNewFile,BufRead *.git/**
- \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
- \ setf git |
- \ endif
- EOF
+
+ $ curl http://ftp.vim.org/pub/vim/runtime/filetype.vim |
+ sed -ne '/^" Git$/, /^$/ p' >>$HOME/.vim/filetype.vim
--
1.8.1
^ permalink raw reply related
* Re: [PATCH] t0008: avoid brace expansion
From: René Scharfe @ 2013-01-10 21:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Adam Spiers, git discussion list
In-Reply-To: <7vsj693n6o.fsf@alter.siamese.dyndns.org>
Am 10.01.2013 01:18, schrieb Junio C Hamano:
> Adam Spiers <git@adamspiers.org> writes:
>
>> On Wed, Jan 9, 2013 at 11:49 PM, René Scharfe
>> <rene.scharfe@lsrfire.ath.cx> wrote:
>>> Brace expansion is not required by POSIX and not supported by dash nor
>>> NetBSD's sh. Explicitly list all combinations instead.
>>
>> Good catch, thanks!
>
> Yeah; thanks.
>
> It would also be nice to avoid touch while we are at it, by the way.
Good idea! Replacement patch:
--- >8 ---
Brace expansion is a shell feature that's not required by POSIX and not
supported by dash nor NetBSD's sh. Explicitly list all combinations
instead. Also avoid calling touch by creating the test files with a
redirection instead, as suggested by Junio.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
t/t0008-ignores.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 9b0fcd6..d7df719 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -129,8 +129,13 @@ test_expect_success 'setup' '
one
ignored-*
EOF
- touch {,a/}{not-ignored,ignored-{and-untracked,but-in-index}} &&
- git add -f {,a/}ignored-but-in-index
+ for dir in . a
+ do
+ : >$dir/not-ignored &&
+ : >$dir/ignored-and-untracked &&
+ : >$dir/ignored-but-in-index
+ done &&
+ git add -f ignored-but-in-index a/ignored-but-in-index &&
cat <<-\EOF >a/.gitignore &&
two*
*three
--
1.8.0
^ permalink raw reply related
* Re: [PATCH] contrib/vim: simplify instructions for old vim support
From: Jeff King @ 2013-01-10 21:34 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Manlio Perillo, git@vger.kernel.org
In-Reply-To: <20130110205427.GG16532@google.com>
On Thu, Jan 10, 2013 at 12:54:27PM -0800, Jonathan Nieder wrote:
> Rely on the upstream filetype.vim instead of duplicating its rules in
> git's instructions for syntax highlighting support on pre-7.2 vim
> versions.
>
> The result is a shorter contrib/vim/README. More importantly, it lets
> us punt on maintenance of the autocmd rules.
>
> So now when we fix the upstream gitsendemail rule in light of commit
> eed6ca7, new git users stuck on old vim reading contrib/vim/README can
> automagically get the fix without any further changes needed to git.
>
> Once the world has moved on to vim 7.2+ completely, we can get rid of
> these instructions, but for now if they are this simple it's
> effortless to keep them.
>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
> Jeff King wrote:
>
> > I'd argue that we should just remove contrib/vim at this point. It has
> > no actual files in it, only pointers to vim.org for pre-7.2 vim users.
>
> I think that's reasonable. Of course we can still discuss enhancements
> to the vim support on this list, but ultimately it's easiest to
> distribute and document such work upstream in the usual way for vim
> plugins.
>
> How about this patch?
Yeah, I think this makes sense. I'd be fine with removing it entirely,
but it doesn't hurt to err on the conservative side and leave it there.
It's not like it's generating a huge maintenance burden, and with your
patch, there is even less to maintain.
Acked-by: Jeff King <peff@peff.net>
-Peff
^ permalink raw reply
* Re: [PATCH v2 01/10] string-list: allow case-insensitive string list
From: René Scharfe @ 2013-01-10 21:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Antoine Pelisse
In-Reply-To: <1357603821-8647-2-git-send-email-gitster@pobox.com>
Am 08.01.2013 01:10, schrieb Junio C Hamano:
> Some string list needs to be searched case insensitively, and for
> that to work correctly, the string needs to be sorted case
> insensitively from the beginning.
>
> Allow a custom comparison function to be defined on a string list
> instance and use it throughout in place of strcmp().
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
We can avoid using a static variable to pass the comparison function from
sort_string_list() to cmp_items() by dialling back the flexibility a bit
and only have a flag to switch between strcmp() and strcasecmp(). I bet
this suffices for quite a while yet. Slightly more code, less yuck,
squashable.
René
---
mailmap.c | 2 +-
string-list.c | 23 ++++++++++++++---------
string-list.h | 4 +---
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/mailmap.c b/mailmap.c
index 276c54f..08126b1 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -235,7 +235,7 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
int err = 0;
map->strdup_strings = 1;
- map->cmp = strcasecmp;
+ map->ignore_case = 1;
if (!git_mailmap_blob && is_bare_repository())
git_mailmap_blob = "HEAD:.mailmap";
diff --git a/string-list.c b/string-list.c
index aabb25e..ddecc23 100644
--- a/string-list.c
+++ b/string-list.c
@@ -1,13 +1,15 @@
#include "cache.h"
#include "string-list.h"
+typedef int (*compare_strings_fn)(const char *, const char *);
+
/* if there is no exact match, point to the index where the entry could be
* inserted */
static int get_entry_index(const struct string_list *list, const char *string,
int *exact_match)
{
int left = -1, right = list->nr;
- compare_strings_fn cmp = list->cmp ? list->cmp : strcmp;
+ compare_strings_fn cmp = list->ignore_case ? strcasecmp : strcmp;
while (left + 1 < right) {
int middle = (left + right) / 2;
@@ -97,7 +99,7 @@ void string_list_remove_duplicates(struct string_list *list, int free_util)
{
if (list->nr > 1) {
int src, dst;
- compare_strings_fn cmp = list->cmp ? list->cmp : strcmp;
+ compare_strings_fn cmp = list->ignore_case ? strcasecmp : strcmp;
for (src = dst = 1; src < list->nr; src++) {
if (!cmp(list->items[dst - 1].string, list->items[src].string)) {
if (list->strdup_strings)
@@ -212,28 +214,31 @@ struct string_list_item *string_list_append(struct string_list *list,
list->strdup_strings ? xstrdup(string) : (char *)string);
}
-/* Yuck */
-static compare_strings_fn compare_for_qsort;
+static int cmp_items_ignore_case(const void *a, const void *b)
+{
+ const struct string_list_item *one = a;
+ const struct string_list_item *two = b;
+ return strcasecmp(one->string, two->string);
+}
-/* Only call this from inside sort_string_list! */
static int cmp_items(const void *a, const void *b)
{
const struct string_list_item *one = a;
const struct string_list_item *two = b;
- return compare_for_qsort(one->string, two->string);
+ return strcmp(one->string, two->string);
}
void sort_string_list(struct string_list *list)
{
- compare_for_qsort = list->cmp ? list->cmp : strcmp;
- qsort(list->items, list->nr, sizeof(*list->items), cmp_items);
+ qsort(list->items, list->nr, sizeof(*list->items),
+ list->ignore_case ? cmp_items_ignore_case : cmp_items);
}
struct string_list_item *unsorted_string_list_lookup(struct string_list *list,
const char *string)
{
int i;
- compare_strings_fn cmp = list->cmp ? list->cmp : strcmp;
+ compare_strings_fn cmp = list->ignore_case ? strcasecmp : strcmp;
for (i = 0; i < list->nr; i++)
if (!cmp(string, list->items[i].string))
diff --git a/string-list.h b/string-list.h
index de6769c..33f2e9c 100644
--- a/string-list.h
+++ b/string-list.h
@@ -6,13 +6,11 @@ struct string_list_item {
void *util;
};
-typedef int (*compare_strings_fn)(const char *, const char *);
-
struct string_list {
struct string_list_item *items;
unsigned int nr, alloc;
unsigned int strdup_strings:1;
- compare_strings_fn cmp; /* NULL uses strcmp() */
+ unsigned int ignore_case:1;
};
#define STRING_LIST_INIT_NODUP { NULL, 0, 0, 0 }
--
1.8.0
^ permalink raw reply related
* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Jeff King @ 2013-01-10 21:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jonathan Nieder, git, Bart Trojanowski
In-Reply-To: <7vbocw23fq.fsf@alter.siamese.dyndns.org>
On Thu, Jan 10, 2013 at 12:22:49PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > Maybe the right rule is "if we are using the shell to execute, do not
> > mention SIGPIPE"? It seems a little iffy at first, but:
> >
> > 1. It tends to coincide with direct use of internal tools versus
> > external tools.
> >
> > 2. We do not reliably get SIGPIPE there, anyway, since most shells
> > will convert it into exit code 141 before we see it.
> >
> > I.e., something like:
>
> Hmph. That may be a good heuristics, but I wonder if we also want
> to special case WIFEXITED(status) && WEXITSTATUS(status) == 141 to
> pretend as if nothing went wrong, when ignore_sigpipe is in effect?
We could, but I don't see much point. There is very little to gain (because
nobody is complaining about the exit code, only the message), and we
might possibly fail to propagate an error condition (unlikely, but more
serious consequences). To be honest, I am having doubts about touching
it at all. I had to really work to provoke the error without setting
SHELL_PATH=zsh, so I am worried that we are getting worked up over
something that just doesn't happen in practice. And I am not sure that
setting SHELL_PATH=zsh is a sane thing (I only knew about it because
Bart mentioned it he was using zsh).
Bart, do you actually set up SHELL_PATH like that? Is /bin/sh on your
system zsh? If the latter, I wonder if this is actually a bug in zsh.
-Peff
^ permalink raw reply
* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Johannes Sixt @ 2013-01-10 21:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Jonathan Nieder, git, Bart Trojanowski
In-Reply-To: <7vbocw23fq.fsf@alter.siamese.dyndns.org>
Am 10.01.2013 21:22, schrieb Junio C Hamano:
> Jeff King <peff@peff.net> writes:
>
>> Maybe the right rule is "if we are using the shell to execute, do not
>> mention SIGPIPE"? It seems a little iffy at first, but:
>>
>> 1. It tends to coincide with direct use of internal tools versus
>> external tools.
>>
>> 2. We do not reliably get SIGPIPE there, anyway, since most shells
>> will convert it into exit code 141 before we see it.
>>
>> I.e., something like:
>
> Hmph. That may be a good heuristics, but I wonder if we also want
> to special case WIFEXITED(status) && WEXITSTATUS(status) == 141 to
> pretend as if nothing went wrong, when ignore_sigpipe is in effect?
The purpose of Peff's patch is to remove the error message, but not to
pretend success (the return code remains 141).
I looked at all instances with use_shell=1 or RUN_USING_SHELL:
Most of the time, we do not care where the output of the command goes
to, which I regard as the same case as when a shell runs a command: We
don't need to report the SIGPIPE death.
The interesting cases are when git reads back the output of the command.
Here, a SIGPIPE death of the child would indicate a bug in git, I think,
and some diagnostic would be worth it. But we can just as well declare
that git doesn't have bugs ;)
These are the interesting cases:
connect.c:640: conn->use_shell = 1;
a connection to a local repository
convert.c:372: child_process.use_shell = 1;
clean/smudge filter
credential.c:216: helper.use_shell = 1;
credential helper
diff.c:4851: child.use_shell = 1;
textconv
All in all, I think the heuristics makes sense.
-- Hannes
^ permalink raw reply
* Re: [RFC/PATCH] avoid SIGPIPE warnings for aliases
From: Junio C Hamano @ 2013-01-10 22:51 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Jeff King, Jonathan Nieder, git, Bart Trojanowski
In-Reply-To: <50EF380A.9010809@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
> The interesting cases are when git reads back the output of the command.
> Here, a SIGPIPE death of the child would indicate a bug in git, I think,
> and some diagnostic would be worth it. But we can just as well declare
> that git doesn't have bugs ;)
>
> These are the interesting cases:
> connect.c:640: conn->use_shell = 1;
> a connection to a local repository
> convert.c:372: child_process.use_shell = 1;
> clean/smudge filter
> credential.c:216: helper.use_shell = 1;
> credential helper
> diff.c:4851: child.use_shell = 1;
> textconv
>
> All in all, I think the heuristics makes sense.
Fair enough. Thanks for grepping.
^ permalink raw reply
* [PATCH v5] git-clean: Display more accurate delete messages
From: Zoltan Klinger @ 2013-01-10 22:53 UTC (permalink / raw)
To: git; +Cc: Zoltan Klinger
(1) Only print out the names of the files and directories that got
actually deleted. Also do not mention that we are not removing
directories when the user did not ask us to do so with '-d'.
(2) Show ignore message for skipped untracked git repositories.
Consider the following repo layout:
test.git/
|-- tracked_dir/
| |-- some_tracked_file
| |-- some_untracked_file
|-- tracked_file
|-- untracked_file
|-- untracked_foo/
| |-- bar/
| | |-- bar.txt
| |-- emptydir/
| |-- frotz.git/
| |-- frotz.tx
|-- untracked_some.git/
|-- some.txt
Suppose the user issues 'git clean -fd' from the test.git directory.
When -d option is used and untracked directory 'foo' contains a
subdirectory 'frotz.git' that is managed by a different git repository
therefore it will not be removed.
$ git clean -fd
Removing tracked_dir/some_untracked_file
Removing untracked_file
Removing untracked_foo/
Removing untracked_some.git/
The message displayed to the user is slightly misleading. The foo/
directory has not been removed because of foo/frotz.git still exists.
On the other hand the subdirectories 'bar' and 'emptydir' have been
deleted but they're not mentioned anywhere. Also, untracked_some.git
has not been removed either.
This behaviour is the result of the way the deletion of untracked
directories are reported. In the current implementation they are
deleted recursively but only the name of the top most directory is
printed out. The calling function does not know about any
subdirectories that could not be removed during the recursion.
Improve the way the deleted directories are reported back to
the user:
(1) Create a recursive delete function 'remove_dirs' in builtin/clean.c
to run in both dry_run and delete modes with the delete logic as
follows:
(a) Check if the current directory to be deleted is an untracked
git repository. If it is and --force --force option is not set
do not touch this directory, print ignore message, set dir_gone
flag to false for the caller and return.
(b) Otherwise for each item in current directory:
(i) If current directory cannot be accessed, print warning,
set dir_gone flag to false and return.
(ii) If the item is a subdirectory recurse into it,
check for the returned value of the dir_gone flag.
If the subdirectory is gone, add the name of the deleted
directory to a list of successfully removed items 'dels'.
Else set the dir_gone flag as the current directory
cannot be removed because we have at least one subdirectory
hanging around.
(iii) If it is a file try to remove it. If success add the
file name to the 'dels' list, else print error and set
dir_gone flag to false.
(c) After we finished deleting all items in the current directory and
the dir_gone flag is still true, remove the directory itself.
If failed set the dir_gone flag to false.
(d) If the current directory cannot be deleted because the dir_gone flag
has been set to false, print out all the successfully deleted items
for this directory from the 'dels' list.
(e) We're done with the current directory, return.
(2) Modify the cmd_clean() function to:
(a) call the recursive delete function 'remove_dirs()' for each
topmost directory it wants to remove
(b) check for the returned value of dir_gone flag. If it's true
print the name of the directory as being removed.
Consider the output of the improved version:
$ git clean -fd
Removing tracked_dir/some_untracked_file
Removing untracked_file
Skipping repository untracked_foo/frotz.git
Removing untracked_foo/bar
Removing untracked_foo/emptydir
Skipping repository untracked_some.git/
Now it displays only the file and directory names that got actually
deleted and shows the name of the untracked git repositories it ignored.
Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
---
builtin/clean.c | 156 ++++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 127 insertions(+), 29 deletions(-)
diff --git a/builtin/clean.c b/builtin/clean.c
index 69c1cda..943845d 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -10,6 +10,7 @@
#include "cache.h"
#include "dir.h"
#include "parse-options.h"
+#include "refs.h"
#include "string-list.h"
#include "quote.h"
@@ -20,6 +21,12 @@ static const char *const builtin_clean_usage[] = {
NULL
};
+static const char *msg_remove = N_("Removing %s\n");
+static const char *msg_would_remove = N_("Would remove %s\n");
+static const char *msg_skip_git_dir = N_("Skipping repository %s\n");
+static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n");
+static const char *msg_warn_remove_failed = N_("failed to remove %s");
+
static int git_clean_config(const char *var, const char *value, void *cb)
{
if (!strcmp(var, "clean.requireforce"))
@@ -34,11 +41,114 @@ static int exclude_cb(const struct option *opt, const char *arg, int unset)
return 0;
}
+static int remove_dirs(struct strbuf *path, const char *prefix, int force_flag,
+ int dry_run, int quiet, int *dir_gone)
+{
+ DIR *dir;
+ struct strbuf quoted = STRBUF_INIT;
+ struct dirent *e;
+ int res = 0, ret = 0, gone = 1, original_len = path->len, len, i;
+ unsigned char submodule_head[20];
+ struct string_list dels = STRING_LIST_INIT_DUP;
+
+ *dir_gone = 1;
+
+ if ((force_flag & REMOVE_DIR_KEEP_NESTED_GIT) &&
+ !resolve_gitlink_ref(path->buf, "HEAD", submodule_head)) {
+ if (!quiet) {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ printf(dry_run ? _(msg_would_skip_git_dir) : _(msg_skip_git_dir),
+ quoted.buf);
+ }
+
+ *dir_gone = 0;
+ return 0;
+ }
+
+ dir = opendir(path->buf);
+ if (!dir) {
+ /* an empty dir could be removed even if it is unreadble */
+ res = dry_run ? 0 : rmdir(path->buf);
+ if (res) {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ warning(_(msg_warn_remove_failed), quoted.buf);
+ *dir_gone = 0;
+ }
+ return res;
+ }
+
+ if (path->buf[original_len - 1] != '/')
+ strbuf_addch(path, '/');
+
+ len = path->len;
+ while ((e = readdir(dir)) != NULL) {
+ struct stat st;
+ if (is_dot_or_dotdot(e->d_name))
+ continue;
+
+ strbuf_setlen(path, len);
+ strbuf_addstr(path, e->d_name);
+ if (lstat(path->buf, &st))
+ ; /* fall thru */
+ else if (S_ISDIR(st.st_mode)) {
+ if (remove_dirs(path, prefix, force_flag, dry_run, quiet, &gone))
+ ret = 1;
+ if (gone) {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ string_list_append(&dels, quoted.buf);
+ }
+ else
+ *dir_gone = 0;
+ continue;
+ } else {
+ res = dry_run ? 0 : unlink(path->buf);
+ if (!res) {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ string_list_append(&dels, quoted.buf);
+ }
+ else {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ warning(_(msg_warn_remove_failed), quoted.buf);
+ *dir_gone = 0;
+ ret = 1;
+ }
+ continue;
+ }
+
+ /* path too long, stat fails, or non-directory still exists */
+ *dir_gone = 0;
+ ret = 1;
+ break;
+ }
+ closedir(dir);
+
+ strbuf_setlen(path, original_len);
+
+ if (*dir_gone) {
+ res = dry_run ? 0 : rmdir(path->buf);
+ if (!res)
+ *dir_gone = 1;
+ else {
+ quote_path_relative(path->buf, strlen(path->buf), "ed, prefix);
+ warning(_(msg_warn_remove_failed), quoted.buf);
+ *dir_gone = 0;
+ ret = 1;
+ }
+ }
+
+ if (!*dir_gone && !quiet) {
+ for (i = 0; i < dels.nr; i++)
+ printf(dry_run ? _(msg_would_remove) : _(msg_remove), dels.items[i].string);
+ }
+ string_list_clear(&dels, 0);
+ return ret;
+}
+
int cmd_clean(int argc, const char **argv, const char *prefix)
{
- int i;
- int show_only = 0, remove_directories = 0, quiet = 0, ignored = 0;
- int ignored_only = 0, config_set = 0, errors = 0;
+ int i, res;
+ int dry_run = 0, remove_directories = 0, quiet = 0, ignored = 0;
+ int ignored_only = 0, config_set = 0, errors = 0, gone = 1;
int rm_flags = REMOVE_DIR_KEEP_NESTED_GIT;
struct strbuf directory = STRBUF_INIT;
struct dir_struct dir;
@@ -49,7 +159,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
char *seen = NULL;
struct option options[] = {
OPT__QUIET(&quiet, N_("do not print names of files removed")),
- OPT__DRY_RUN(&show_only, N_("dry run")),
+ OPT__DRY_RUN(&dry_run, N_("dry run")),
OPT__FORCE(&force, N_("force")),
OPT_BOOLEAN('d', NULL, &remove_directories,
N_("remove whole directories")),
@@ -77,7 +187,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (ignored && ignored_only)
die(_("-x and -X cannot be used together"));
- if (!show_only && !force) {
+ if (!dry_run && !force) {
if (config_set)
die(_("clean.requireForce set to true and neither -n nor -f given; "
"refusing to clean"));
@@ -149,38 +259,26 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
if (S_ISDIR(st.st_mode)) {
strbuf_addstr(&directory, ent->name);
- qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
- if (show_only && (remove_directories ||
- (matches == MATCHED_EXACTLY))) {
- printf(_("Would remove %s\n"), qname);
- } else if (remove_directories ||
- (matches == MATCHED_EXACTLY)) {
- if (!quiet)
- printf(_("Removing %s\n"), qname);
- if (remove_dir_recursively(&directory,
- rm_flags) != 0) {
- warning(_("failed to remove %s"), qname);
+ if (remove_directories || (matches == MATCHED_EXACTLY)) {
+ if (remove_dirs(&directory, prefix, rm_flags, dry_run, quiet, &gone))
errors++;
+ if (gone && !quiet) {
+ qname = quote_path_relative(directory.buf, directory.len, &buf, prefix);
+ printf(dry_run ? _(msg_would_remove) : _(msg_remove), qname);
}
- } else if (show_only) {
- printf(_("Would not remove %s\n"), qname);
- } else {
- printf(_("Not removing %s\n"), qname);
}
strbuf_reset(&directory);
} else {
if (pathspec && !matches)
continue;
- qname = quote_path_relative(ent->name, -1, &buf, prefix);
- if (show_only) {
- printf(_("Would remove %s\n"), qname);
- continue;
- } else if (!quiet) {
- printf(_("Removing %s\n"), qname);
- }
- if (unlink(ent->name) != 0) {
- warning(_("failed to remove %s"), qname);
+ res = dry_run ? 0 : unlink(ent->name);
+ if (res) {
+ qname = quote_path_relative(ent->name, -1, &buf, prefix);
+ warning(_(msg_warn_remove_failed), qname);
errors++;
+ } else if (!quiet) {
+ qname = quote_path_relative(ent->name, -1, &buf, prefix);
+ printf(dry_run ? _(msg_would_remove) : _(msg_remove), qname);
}
}
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] contrib/vim: simplify instructions for old vim support
From: Jonathan Nieder @ 2013-01-10 23:08 UTC (permalink / raw)
To: Jeff King; +Cc: Manlio Perillo, git@vger.kernel.org, Junio C Hamano
In-Reply-To: <20130110213427.GA26138@sigill.intra.peff.net>
Jeff King wrote:
> On Thu, Jan 10, 2013 at 12:54:27PM -0800, Jonathan Nieder wrote:
>> Rely on the upstream filetype.vim instead of duplicating its rules in
>> git's instructions for syntax highlighting support on pre-7.2 vim
>> versions.
[...]
> Yeah, I think this makes sense. I'd be fine with removing it entirely,
> but it doesn't hurt to err on the conservative side and leave it there.
> It's not like it's generating a huge maintenance burden, and with your
> patch, there is even less to maintain.
>
> Acked-by: Jeff King <peff@peff.net>
Thanks for looking it over.
^ permalink raw reply
* Re: [PATCH 03/19] reset.c: pass pathspec around instead of (prefix, argv) pair
From: Junio C Hamano @ 2013-01-10 23:09 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Martin von Zweigbergk, git
In-Reply-To: <CACsJy8Apu1BJ2t+vpbzpQ4Wni==Azzmp99a+TmBzR3h8qpx=8g@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> On Thu, Jan 10, 2013 at 2:26 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Martin von Zweigbergk <martinvonz@gmail.com> writes:
>>
>>> We use the path arguments in two places in reset.c: in
>>> interactive_reset() and read_from_tree(). Both of these call
>>> get_pathspec(), so we pass the (prefix, arv) pair to both
>>> functions. Move the call to get_pathspec() out of these methods, for
>>> two reasons: 1) One argument is simpler than two. 2) It lets us use
>>> the (arguably clearer) "if (pathspec)" in place of "if (i < argc)".
>>> ---
>>> If I understand correctly, this should be rebased on top of
>>> nd/parse-pathspec. Please let me know.
>>
>> Yeah, this will conflict with the get_pathspec-to-parse_pathspec
>> conversion Duy has been working on.
>
> Or I could hold off nd/parse-pathspec if this series has a better
> chance of graduation first. Decision?
I am greedy and want to have both ;-)
Before deciding that, I'd appreciate a second set of eyes giving
Martin's series an independent review, to see if it is going in the
right direction. I think I didn't spot anything questionable in it
myself, but second opinion always helps.
There is no textual conflict between the two topics at the moment,
but because the ultimate goal of your series is to remove all uses
of the pathspec.raw[] field outside the implementation of pathspec
matching, it might help to rename the field to _private_raw (or
remove it), and either make get_pathspec() private or disappear, to
ensure that the compiler will help us catching semantic conflicts
with new users of it at a late stage of your series.
^ permalink raw reply
* Re: bugreport: stgit cannot export empty patch
From: bryanlarsen @ 2013-01-10 23:16 UTC (permalink / raw)
To: git
In-Reply-To: <xmqqboll2nl0.fsf@junio.mtv.corp.google.com>
Junio C Hamano writes:
> Stepan Koltsov <stepan.koltsov@> writes:
>> stgit fails to export empty patches:
>>
>> % stg new empty-patch -m 'asasas'
>> Now at patch "empty-patch"
>> % stg export empty-patch
>> Checking for changes in the working directory ... done
>> fatal: unrecognized input
>> stg export: git failed with code 128
>> zsh: exit 2 stg export empty-patch
>>
>> % stg --version
>> Stacked GIT 0.16-3-g67cf
>> git version 1.7.9.1
>> Python version 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
>> [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]
> I don't use (or read the sources to) StGIT, but isn't the whole point of
> "stg export" to "convert your StGIT patches into patch files"? For an
> empty commit, what is an appropriate output? IOW, is it reasonable to
> have an empty commit in your history if you are planning to "stg export"
> it?
Here's another example where the functionality is useful:
https://github.com/Hobo/agility-gitorial-patches is used to build
http://cookbook.hobocentral.net/tutorials/agility
Each commit/patch becomes a step in the tutorial. Some tutorial steps don't
have any code attached to them.
In the past, an export of an empty commit would yield a patch where the last
three lines were
> ---
> 0 files changed, 0 insertions(+), 0 deletions(-)
>
The latest version of stgit along with git v1.6 eliminates the error. A
bisection identifies cc64b318f26c9e176c4f07b1a459a86e7a04c4eb as the source
of the problem.
Thanks,
Bryan
--
View this message in context: http://git.661346.n2.nabble.com/bugreport-stgit-cannot-export-empty-patch-tp7559494p7574691.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH 02/21] Add parse_pathspec() that converts cmdline args to struct pathspec
From: Martin von Zweigbergk @ 2013-01-10 23:26 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <1357453268-12543-3-git-send-email-pclouds@gmail.com>
On Sat, Jan 5, 2013 at 10:20 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> +
> + /* No arguments, no prefix -> no pathspec */
> + if (!entry && !prefix)
> + return;
>
> + /* No arguments with prefix -> prefix pathspec */
When working with the old get_pathspec(), I remember wondering if a
flag switching between "no argument -> prefix pathspec" and "no
argument -> no pathspec" would be worthwhile. I think e.g. 'add' and
'clean' would use the former , while 'reset' and 'commit' would use
the latter. Since you're now changing all the callers of
get_pathspec(), it seems like the perfect time to ask this question.
What do you think?
^ permalink raw reply
* [PATCH] minor diff between gitweb docs and actual template for $GIT/description
From: Tim Chase @ 2013-01-11 0:33 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
The documentation for gitweb gives one description of the default
content for the $GIT/description, the description template has other
text. One of these two patches should be applied to bring them into
order (applying both would just reverse the problem). Or, both
could be changed to the same new text.
-tkc
(not subscribed to the actual git ML, just git-users@googlegroups.com)
[-- Attachment #2: git_change_gitweb.diff --]
[-- Type: text/plain, Size: 660 bytes --]
diff --git a/Documentation/gitweb.txt b/Documentation/gitweb.txt
index 168e8bf..7c4cb69 100644
--- a/Documentation/gitweb.txt
+++ b/Documentation/gitweb.txt
@@ -227,7 +227,7 @@ description (or `gitweb.description`)::
repository). Plain text file; HTML will be escaped. By default set to
+
-------------------------------------------------------------------------------
-Unnamed repository; edit this file to name it for gitweb.
+Unnamed repository; edit this file 'description' to name the repository.
-------------------------------------------------------------------------------
+
from the template during repository creation, usually installed in
[-- Attachment #3: git_change_template.diff --]
[-- Type: text/plain, Size: 314 bytes --]
diff --git a/templates/this--description b/templates/this--description
index 498b267..c6f25e8 100644
--- a/templates/this--description
+++ b/templates/this--description
@@ -1 +1 @@
-Unnamed repository; edit this file 'description' to name the repository.
+Unnamed repository; edit this file to name it for gitweb.
^ permalink raw reply related
* Re: [PATCH] minor diff between gitweb docs and actual template for $GIT/description
From: Jonathan Nieder @ 2013-01-11 2:22 UTC (permalink / raw)
To: Tim Chase; +Cc: git, Jakub Narebski
In-Reply-To: <50EF5DC8.1000500@tim.thechases.com>
(+cc: Jakub, who maintains gitweb)
Hi Tim,
Tim Chase wrote:
> The documentation for gitweb gives one description of the default
> content for the $GIT/description, the description template has other
> text. One of these two patches should be applied to bring them into
> order (applying both would just reverse the problem). Or, both
> could be changed to the same new text.
May we have your sign-off? (See Documentation/SubmittingPatches for
what this means.)
> --- a/Documentation/gitweb.txt
> +++ b/Documentation/gitweb.txt
> @@ -227,7 +227,7 @@ description (or `gitweb.description`)::
> repository). Plain text file; HTML will be escaped. By default set to
> +
> -------------------------------------------------------------------------------
> -Unnamed repository; edit this file to name it for gitweb.
> +Unnamed repository; edit this file 'description' to name the repository.
> -------------------------------------------------------------------------------
> +
> from the template during repository creation, usually installed in
Looks sane to me. Thanks for noticing.
Regards,
Jonathan
^ permalink raw reply
* Re: [PATCH 02/21] Add parse_pathspec() that converts cmdline args to struct pathspec
From: Duy Nguyen @ 2013-01-11 2:33 UTC (permalink / raw)
To: Martin von Zweigbergk; +Cc: git
In-Reply-To: <CANiSa6iUqZ7E9NWgMfR3bUxZoyhjO2Jz+Z=yjs9vkfmbit7SOg@mail.gmail.com>
On Fri, Jan 11, 2013 at 6:26 AM, Martin von Zweigbergk
<martinvonz@gmail.com> wrote:
> On Sat, Jan 5, 2013 at 10:20 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>> +
>> + /* No arguments, no prefix -> no pathspec */
>> + if (!entry && !prefix)
>> + return;
>>
>> + /* No arguments with prefix -> prefix pathspec */
>
> When working with the old get_pathspec(), I remember wondering if a
> flag switching between "no argument -> prefix pathspec" and "no
> argument -> no pathspec" would be worthwhile. I think e.g. 'add' and
> 'clean' would use the former , while 'reset' and 'commit' would use
> the latter. Since you're now changing all the callers of
> get_pathspec(), it seems like the perfect time to ask this question.
> What do you think?
Yes that'll simplify the call sites. Will do.
--
Duy
^ permalink raw reply
* [PATCH v2] clone: forbid --bare --separate-git-dir <dir>
From: Nguyễn Thái Ngọc Duy @ 2013-01-11 3:09 UTC (permalink / raw)
To: Jonathan Niedier
Cc: git, Junio C Hamano, Jens Lehmann, Heiko Voigt, Manlio Perillo,
W. Trevor King, Nguyễn Thái Ngọc Duy
In-Reply-To: <1357465670-32766-1-git-send-email-pclouds@gmail.com>
The --separate-git-dir option was introduced to make it simple to put
the git directory somewhere outside the worktree, for example when
cloning a repository for use as a submodule.
It was not intended for use when creating a bare repository. In that
case there is no worktree and it is more natural to directly clone the
repository and create a .git file as separate steps:
git clone --bare /path/to/repo.git bar.git
printf 'gitdir: bar.git\n' >foo.git
Forbid the combination, making the command easier to explain.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Just reword the commit message (or copying it from Jonathan
actually). No comments about remove_junk_on_signal because we're less
likely to re-enable it again.
builtin/clone.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/builtin/clone.c b/builtin/clone.c
index ec2f75b..b30189f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -704,6 +704,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (option_origin)
die(_("--bare and --origin %s options are incompatible."),
option_origin);
+ if (real_git_dir)
+ die(_("--bare and --separate-git-dir are incompatible."));
option_no_checkout = 1;
}
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* Re: [PATCH v2] clone: forbid --bare --separate-git-dir <dir>
From: Junio C Hamano @ 2013-01-11 3:15 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy
Cc: Jonathan Niedier, git, Jens Lehmann, Heiko Voigt, Manlio Perillo,
W. Trevor King
In-Reply-To: <1357873799-17413-1-git-send-email-pclouds@gmail.com>
Thanks.
^ permalink raw reply
* [PATCH 1/2] fetch, upload-pack: add --no-shallow for infinite depth
From: Nguyễn Thái Ngọc Duy @ 2013-01-11 3:30 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Stefan Beller, Jonathan Nieder, schlotter,
Ralf.Wildenhues, Nguyễn Thái Ngọc Duy
In-Reply-To: <7vy5g383sy.fsf_-_@alter.siamese.dyndns.org>
The user can do --depth=2147483647 (*) for infinite depth now. But
it's hard to remember. Any other numbers larger than the longest
commit chain in the repository would also do, but some guessing may
be involved. Make easy-to-remember --no-shallow an alias for
--depth=2147483647.
Make upload-pack recognize this special number as infinite depth. The
effect is essentially the same as before, except that upload-pack is
more efficient because it does not have to traverse to the bottom
any more. The chance of a user actually wanting exactly 2147483647
commits depth, not infinite, on a repository with a history that long,
is probably too small to consider.
(*) This is the largest positive number a 32-bit signed integer can
contain. JGit and older C Git store depth as "int" so both are OK
with this number. Dulwich does not support shallow clone.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Documentation/fetch-options.txt | 4 ++++
Documentation/git-fetch-pack.txt | 2 ++
Documentation/technical/shallow.txt | 3 +++
builtin/fetch.c | 15 ++++++++++++++-
commit.h | 3 +++
t/t5500-fetch-pack.sh | 16 ++++++++++++++++
upload-pack.c | 13 ++++++++++---
7 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 6e98bdf..012d1b2 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt
@@ -13,6 +13,10 @@
to the specified number of commits from the tip of each remote
branch history. Tags for the deepened commits are not fetched.
+--no-shallow::
+ Deepen to the roots of the repository's history (i.e. the
+ result repository is no longer shallow).
+
ifndef::git-pull[]
--dry-run::
Show what would be done, without making any changes.
diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt
index 8c75120..b81e90d 100644
--- a/Documentation/git-fetch-pack.txt
+++ b/Documentation/git-fetch-pack.txt
@@ -84,6 +84,8 @@ be in a separate packet, and the list must end with a flush packet.
--depth=<n>::
Limit fetching to ancestor-chains not longer than n.
+ 'git-upload-pack' treats the special depth 2147483647 as
+ infinite even if there is an ancestor-chain that long.
--no-progress::
Do not show the progress.
diff --git a/Documentation/technical/shallow.txt b/Documentation/technical/shallow.txt
index 0502a54..ea2f69f 100644
--- a/Documentation/technical/shallow.txt
+++ b/Documentation/technical/shallow.txt
@@ -53,3 +53,6 @@ It also writes an appropriate $GIT_DIR/shallow.
You can deepen a shallow repository with "git-fetch --depth 20
repo branch", which will fetch branch from repo, but stop at depth
20, updating $GIT_DIR/shallow.
+
+The special depth 2147483647 (or 0x7fffffff, the largest positive
+number a signed 32-bit integer can contain) means infinite depth.
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 4b5a898..bf7b5c5 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -32,7 +32,7 @@ enum {
static int all, append, dry_run, force, keep, multiple, prune, update_head_ok, verbosity;
static int progress = -1, recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
-static int tags = TAGS_DEFAULT;
+static int tags = TAGS_DEFAULT, no_shallow;
static const char *depth;
static const char *upload_pack;
static struct strbuf default_rla = STRBUF_INIT;
@@ -82,6 +82,9 @@ static struct option builtin_fetch_options[] = {
OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
OPT_STRING(0, "depth", &depth, N_("depth"),
N_("deepen history of shallow clone")),
+ { OPTION_SET_INT, 0, "no-shallow", &no_shallow, NULL,
+ N_("deepen history to the bottom"),
+ PARSE_OPT_NONEG | PARSE_OPT_NOARG, NULL, 1 },
{ OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"),
N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN },
{ OPTION_STRING, 0, "recurse-submodules-default",
@@ -970,6 +973,16 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix,
builtin_fetch_options, builtin_fetch_usage, 0);
+ if (no_shallow) {
+ if (depth)
+ die(_("--depth and --no-shallow cannot be used together"));
+ else {
+ static char inf_depth[12];
+ sprintf(inf_depth, "%d", INFINITE_DEPTH);
+ depth = inf_depth;
+ }
+ }
+
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
if (recurse_submodules_default) {
int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
diff --git a/commit.h b/commit.h
index 0f469e5..fbde106 100644
--- a/commit.h
+++ b/commit.h
@@ -162,6 +162,9 @@ extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *r
extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup);
extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
+/* largest postive number a signed 32-bit integer can contain */
+#define INFINITE_DEPTH 0x7fffffff
+
extern int register_shallow(const unsigned char *sha1);
extern int unregister_shallow(const unsigned char *sha1);
extern int for_each_commit_graft(each_commit_graft_fn, void *);
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 6322e8a..6a6e672 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -264,6 +264,22 @@ test_expect_success 'clone shallow object count' '
grep "^count: 52" count.shallow
'
+test_expect_success 'fetch --depth --no-shallow' '
+ (
+ cd shallow &&
+ test_must_fail git fetch --depth=1 --no-shallow
+ )
+'
+
+test_expect_success 'infinite deepening (full repo)' '
+ (
+ cd shallow &&
+ git fetch --no-shallow &&
+ git fsck --full &&
+ ! test -f .git/shallow
+ )
+'
+
test_expect_success 'clone shallow without --no-single-branch' '
git clone --depth 1 "file://$(pwd)/." shallow2
'
diff --git a/upload-pack.c b/upload-pack.c
index 6142421..88f0029 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -670,10 +670,17 @@ static void receive_needs(void)
if (depth == 0 && shallows.nr == 0)
return;
if (depth > 0) {
- struct commit_list *result, *backup;
+ struct commit_list *result = NULL, *backup = NULL;
int i;
- backup = result = get_shallow_commits(&want_obj, depth,
- SHALLOW, NOT_SHALLOW);
+ if (depth == INFINITE_DEPTH)
+ for (i = 0; i < shallows.nr; i++) {
+ struct object *object = shallows.objects[i].item;
+ object->flags |= NOT_SHALLOW;
+ }
+ else
+ backup = result =
+ get_shallow_commits(&want_obj, depth,
+ SHALLOW, NOT_SHALLOW);
while (result) {
struct object *object = &result->item->object;
if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH 2/2] upload-pack: fix off-by-one depth calculation in shallow clone
From: Nguyễn Thái Ngọc Duy @ 2013-01-11 3:30 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Stefan Beller, Jonathan Nieder, schlotter,
Ralf.Wildenhues, Nguyễn Thái Ngọc Duy
In-Reply-To: <1357875005-21956-1-git-send-email-pclouds@gmail.com>
get_shallow_commits() is used to determine the cut points at a given
depth (i.e. the number of commits in a chain that the user likes to
get). However we count current depth up to the commit "commit" but we
do the cutting at its parents (i.e. current depth + 1). This makes
upload-pack always return one commit more than requested. This patch
fixes it.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
shallow.c | 8 +++++++-
t/t5500-fetch-pack.sh | 25 +++++++++++++++++++------
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/shallow.c b/shallow.c
index a0363de..6be915f 100644
--- a/shallow.c
+++ b/shallow.c
@@ -72,8 +72,14 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
}
if (parse_commit(commit))
die("invalid commit");
- commit->object.flags |= not_shallow_flag;
cur_depth++;
+ if (cur_depth >= depth) {
+ commit_list_insert(commit, &result);
+ commit->object.flags |= shallow_flag;
+ commit = NULL;
+ continue;
+ }
+ commit->object.flags |= not_shallow_flag;
for (p = commit->parents, commit = NULL; p; p = p->next) {
if (!p->item->util) {
int *pointer = xmalloc(sizeof(int));
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 6a6e672..58d3bdf 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -130,16 +130,25 @@ test_expect_success 'single given branch clone' '
test_must_fail git --git-dir=branch-a/.git rev-parse origin/B
'
+test_expect_success 'clone shallow depth 1' '
+ git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0
+ test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1
+'
+
test_expect_success 'clone shallow' '
git clone --no-single-branch --depth 2 "file://$(pwd)/." shallow
'
+test_expect_success 'clone shallow depth count' '
+ test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 2
+'
+
test_expect_success 'clone shallow object count' '
(
cd shallow &&
git count-objects -v
) > count.shallow &&
- grep "^in-pack: 18" count.shallow
+ grep "^in-pack: 12" count.shallow
'
test_expect_success 'clone shallow object count (part 2)' '
@@ -256,12 +265,16 @@ test_expect_success 'additional simple shallow deepenings' '
)
'
+test_expect_success 'clone shallow depth count' '
+ test "`git --git-dir=shallow/.git rev-list --count HEAD`" = 11
+'
+
test_expect_success 'clone shallow object count' '
(
cd shallow &&
git count-objects -v
) > count.shallow &&
- grep "^count: 52" count.shallow
+ grep "^count: 55" count.shallow
'
test_expect_success 'fetch --depth --no-shallow' '
@@ -289,7 +302,7 @@ test_expect_success 'clone shallow object count' '
cd shallow2 &&
git count-objects -v
) > count.shallow2 &&
- grep "^in-pack: 6" count.shallow2
+ grep "^in-pack: 3" count.shallow2
'
test_expect_success 'clone shallow with --branch' '
@@ -297,7 +310,7 @@ test_expect_success 'clone shallow with --branch' '
'
test_expect_success 'clone shallow object count' '
- echo "in-pack: 6" > count3.expected &&
+ echo "in-pack: 3" > count3.expected &&
GIT_DIR=shallow3/.git git count-objects -v |
grep "^in-pack" > count3.actual &&
test_cmp count3.expected count3.actual
@@ -326,7 +339,7 @@ EOF
GIT_DIR=shallow6/.git git tag -l >taglist.actual &&
test_cmp taglist.expected taglist.actual &&
- echo "in-pack: 7" > count6.expected &&
+ echo "in-pack: 4" > count6.expected &&
GIT_DIR=shallow6/.git git count-objects -v |
grep "^in-pack" > count6.actual &&
test_cmp count6.expected count6.actual
@@ -341,7 +354,7 @@ EOF
GIT_DIR=shallow7/.git git tag -l >taglist.actual &&
test_cmp taglist.expected taglist.actual &&
- echo "in-pack: 7" > count7.expected &&
+ echo "in-pack: 4" > count7.expected &&
GIT_DIR=shallow7/.git git count-objects -v |
grep "^in-pack" > count7.actual &&
test_cmp count7.expected count7.actual
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* [PATCH] cvsimport: rewrite to use cvsps 3.x to fix major bugs
From: Junio C Hamano @ 2013-01-11 3:32 UTC (permalink / raw)
To: git; +Cc: Eric S. Raymond
From: "Eric S. Raymond" <esr@thyrsus.com>
The combination of git-cvsimport and cvsps had serious problems.
Among these were:
(1) Analysis of branchy repos was buggy in multiple ways in both
programs, leading to incorrect repo translations.
(2) Even after a correct branch analysis, extra (redundant) fileops
would often be generated on the new-branch side.
(3) Inability to report more than one tag pointing to the same revision.
(4) Failure in certain cases of clock-skew reported by the t9603 test.
(5) Failure to use commitids for changeset ordering in cases were this
would have prevented clock skew from causing incorrect grouping.
Problems 2-5 and portions of problem 1 have been solved by a major
rewrite of cvsps (the 3.x release series); it now emits a git
fast-import stream. Also, the buggy attempt at ancestry-branch
tracking previously invoked by -A has been replaced with a simpler and
better topo analysis. cvsps is now about 20% smaller than formerly.
All this changed cvsps's interface enough to require a complete
rewrite of git-cvsimport (hence this patch). In the process the code
size of the wrapper script dropped by about x3 and it can now support
alternate conversion engines; the first new engine is cvs2git, with
parsecvs expected to follow shortly.
The old Perl git-cvsimport is moved to git-cvsimport-fallback; new
git-cvsimport will hand off to the fallback script when it detects
that the user has a pre-3.x cvsps. The fallback is only there so that
people with simple enough repositories that can be correctly handled
by cvsps-2.x but without the bleeding-edge cvsps 3.x installed does
not have to be left without any cvsimport that works for them (with
the same bugs and all). The fallback support will be removed after
cvsps 3.x and the rewritten cvsimport matures and gets widely
available.
This patch also removes Michael Haggerty's git-cvsimport tests
(t960[123]) from the git tree. These are actually conversion-engine
tests and have been merged into a larger cvsps test suite, which I
intend to spin out into a general CVS-lifting test that can also be
applied to utilities such as cvs2git and parsecvs. The t9604 test
will move in a future patch, when I likewise have it integrated
into the general test suite.
The following known bug has not been fixed: "If any files were ever
"cvs import"ed more than once (e.g., import of more than one vendor
release) the HEAD contains the wrong content." However, cvsps now
emits a warning in this case. There is also one pathological tagging
case that was successful in the former t9602 test that now fails
(with a warning).
I plan to address these problems. This patch at least gets the
cvsps-3.x/git-cvsimport combination to a state that is not too
broken to ship - that is, in all failure cases known to me it
now emits useful warnings rather than silently botching the
import.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* This was (re)sent privately to me; the previous attempt by Eric
somehow did not reach the list. Let me see if I have better
luck, as we really would want to be reviewing these patches.
I rewrote one paragraph in the log about the fallback, though.
For the record the original read like this:
The old Perl git-cvsimport is moved to git-cvsimport-fallback; new
git-cvsimport will hand off to the fallback script when it detects
that the user has a pre-3.x cvsps. I make no warranties that
cvsps-2.x will actually work or do anything more useful than make
demons fly out of your nose; the fallback is only there because Junio
disliked the idea of a flag day, and should be removed after a decent
interval.
which I felt somewhat irresponsible to existing users.
Makefile | 3 +-
git-cvsimport.perl => git-cvsimport-fallback.perl | 8 +
git-cvsimport.py | 354 +++++++++++++++++++++
t/t9601/cvsroot/.gitattributes | 1 -
t/t9601/cvsroot/CVSROOT/.gitignore | 2 -
t/t9601/cvsroot/module/added-imported.txt,v | 44 ---
t/t9601/cvsroot/module/imported-anonymously.txt,v | 42 ---
.../module/imported-modified-imported.txt,v | 76 -----
t/t9601/cvsroot/module/imported-modified.txt,v | 59 ----
t/t9601/cvsroot/module/imported-once.txt,v | 43 ---
t/t9601/cvsroot/module/imported-twice.txt,v | 60 ----
t/t9602/README | 62 ----
t/t9602/cvsroot/.gitattributes | 1 -
t/t9602/cvsroot/CVSROOT/.gitignore | 2 -
t/t9602/cvsroot/module/default,v | 102 ------
t/t9602/cvsroot/module/sub1/default,v | 102 ------
t/t9602/cvsroot/module/sub1/subsubA/default,v | 101 ------
t/t9602/cvsroot/module/sub1/subsubB/default,v | 107 -------
.../module/sub2/Attic/branch_B_MIXED_only,v | 59 ----
t/t9602/cvsroot/module/sub2/default,v | 102 ------
t/t9602/cvsroot/module/sub2/subsubA/default,v | 102 ------
t/t9602/cvsroot/module/sub3/default,v | 102 ------
t/t9603/cvsroot/.gitattributes | 1 -
t/t9603/cvsroot/CVSROOT/.gitignore | 2 -
t/t9603/cvsroot/module/a,v | 74 -----
t/t9603/cvsroot/module/b,v | 90 ------
26 files changed, 364 insertions(+), 1337 deletions(-)
rename git-cvsimport.perl => git-cvsimport-fallback.perl (98%)
create mode 100755 git-cvsimport.py
delete mode 100644 t/t9601/cvsroot/.gitattributes
delete mode 100644 t/t9601/cvsroot/CVSROOT/.gitignore
delete mode 100644 t/t9601/cvsroot/module/added-imported.txt,v
delete mode 100644 t/t9601/cvsroot/module/imported-anonymously.txt,v
delete mode 100644 t/t9601/cvsroot/module/imported-modified-imported.txt,v
delete mode 100644 t/t9601/cvsroot/module/imported-modified.txt,v
delete mode 100644 t/t9601/cvsroot/module/imported-once.txt,v
delete mode 100644 t/t9601/cvsroot/module/imported-twice.txt,v
delete mode 100644 t/t9602/README
delete mode 100644 t/t9602/cvsroot/.gitattributes
delete mode 100644 t/t9602/cvsroot/CVSROOT/.gitignore
delete mode 100644 t/t9602/cvsroot/module/default,v
delete mode 100644 t/t9602/cvsroot/module/sub1/default,v
delete mode 100644 t/t9602/cvsroot/module/sub1/subsubA/default,v
delete mode 100644 t/t9602/cvsroot/module/sub1/subsubB/default,v
delete mode 100644 t/t9602/cvsroot/module/sub2/Attic/branch_B_MIXED_only,v
delete mode 100644 t/t9602/cvsroot/module/sub2/default,v
delete mode 100644 t/t9602/cvsroot/module/sub2/subsubA/default,v
delete mode 100644 t/t9602/cvsroot/module/sub3/default,v
delete mode 100644 t/t9603/cvsroot/.gitattributes
delete mode 100644 t/t9603/cvsroot/CVSROOT/.gitignore
delete mode 100644 t/t9603/cvsroot/module/a,v
delete mode 100644 t/t9603/cvsroot/module/b,v
diff --git a/Makefile b/Makefile
index 736ecd4..ca5d9e9 100644
--- a/Makefile
+++ b/Makefile
@@ -464,7 +464,7 @@ SCRIPT_PERL += git-add--interactive.perl
SCRIPT_PERL += git-difftool.perl
SCRIPT_PERL += git-archimport.perl
SCRIPT_PERL += git-cvsexportcommit.perl
-SCRIPT_PERL += git-cvsimport.perl
+SCRIPT_PERL += git-cvsimport-fallback.perl
SCRIPT_PERL += git-cvsserver.perl
SCRIPT_PERL += git-relink.perl
SCRIPT_PERL += git-send-email.perl
@@ -472,6 +472,7 @@ SCRIPT_PERL += git-svn.perl
SCRIPT_PYTHON += git-remote-testgit.py
SCRIPT_PYTHON += git-p4.py
+SCRIPT_PYTHON += git-cvsimport.py
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
diff --git a/git-cvsimport.perl b/git-cvsimport-fallback.perl
similarity index 98%
rename from git-cvsimport.perl
rename to git-cvsimport-fallback.perl
index 0a31ebd..4bc0717 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport-fallback.perl
@@ -1,4 +1,8 @@
#!/usr/bin/perl
+# This code became obsolete in January 2013, and is retained only as a
+# fallback from git-cvsimport.py for users who have only cvsps-2.x.
+# It (and the code in cvsimport.py that calls it) should be removed
+# once the 3.x version has had a reasonable time to propagate.
# This tool is copyright (c) 2005, Matthias Urlichs.
# It is released under the Gnu Public License, version 2.
@@ -27,6 +31,10 @@
use POSIX qw(strftime tzset dup2 ENOENT);
use IPC::Open2;
+print(STDERR "You do not appear to have cvsps 3.x.\n");
+print(STDERR "Falling back to unmaintained Perl cvsimport for cvsps 2.x.\n");
+print(STDERR "Upgrade your cvsps for best results.\n");
+
$SIG{'PIPE'}="IGNORE";
set_timezone('UTC');
diff --git a/git-cvsimport.py b/git-cvsimport.py
new file mode 100755
index 0000000..129471e
--- /dev/null
+++ b/git-cvsimport.py
@@ -0,0 +1,354 @@
+#!/usr/bin/env python
+#
+# Import CVS history into git
+#
+# Intended to be a near-workalike of Matthias Urlichs's Perl implementation.
+#
+# By Eric S. Raymond <esr@thyrsus.com>, December 2012
+# May be redistributed under the license of the git project.
+
+import sys
+
+if sys.hexversion < 0x02060000:
+ sys.stderr.write("git cvsimport: requires Python 2.6 or later.\n")
+ sys.exit(1)
+
+import os, getopt, subprocess, tempfile, shutil
+
+DEBUG_COMMANDS = 1
+
+class Fatal(Exception):
+ "Unrecoverable error."
+ def __init__(self, msg):
+ Exception.__init__(self)
+ self.msg = msg
+
+def do_or_die(dcmd, legend=""):
+ "Either execute a command or raise a fatal exception."
+ if legend:
+ legend = " " + legend
+ if verbose >= DEBUG_COMMANDS:
+ sys.stdout.write("git cvsimport: executing '%s'%s\n" % (dcmd, legend))
+ try:
+ retcode = subprocess.call(dcmd, shell=True)
+ if retcode < 0:
+ raise Fatal("git cvsimport: child was terminated by signal %d." % -retcode)
+ elif retcode != 0:
+ raise Fatal("git cvsimport: child returned %d." % retcode)
+ except (OSError, IOError) as e:
+ raise Fatal("git cvsimport: execution of %s%s failed: %s" % (dcmd, legend, e))
+
+def capture_or_die(dcmd, legend=""):
+ "Either execute a command and capture its output or die."
+ if legend:
+ legend = " " + legend
+ if verbose >= DEBUG_COMMANDS:
+ sys.stdout.write("git cvsimport: executing '%s'%s\n" % (dcmd, legend))
+ try:
+ return subprocess.check_output(dcmd, shell=True)
+ except subprocess.CalledProcessError as e:
+ if e.returncode < 0:
+ sys.stderr.write("git cvsimport: child was terminated by signal %d." % -e.returncode)
+ elif e.returncode != 0:
+ sys.stderr.write("git cvsimport: child returned %d." % e.returncode)
+ sys.exit(1)
+
+class cvsps:
+ "Method class for cvsps back end."
+ def __init__(self):
+ self.opts = ""
+ self.revmap = None
+ def set_repo(self, val):
+ "Set the repository root option."
+ if not val.startswith(":"):
+ if not val.startswith(os.sep):
+ val = os.path.abspath(val)
+ val = ":local:" + val
+ self.opts += " --root '%s'" % val
+ def set_authormap(self, val):
+ "Set the author-map file."
+ self.opts += " -A '%s'" % val
+ def set_fuzz(self, val):
+ "Set the commit-similarity window."
+ self.opts += " -z %s" % val
+ def set_nokeywords(self):
+ "Suppress CVS keyword expansion."
+ self.opts += " -k"
+ def add_opts(self, val):
+ "Add options to the engine command line."
+ self.opts += " " + val
+ def set_exclusion(self, val):
+ "Set a file exclusion regexp."
+ self.opts += " -n -f '%s'" % val
+ def set_after(self, val):
+ "Set a date threshold for incremental import."
+ self.opts += " -d '%s'" % val
+ def set_revmap(self, val):
+ "Set the file to which the engine should dump a reference map."
+ self.revmap = val
+ self.opts += " -R '%s'" % self.revmap
+ def set_module(self, val):
+ "Set the module to query."
+ self.opts += " " + val
+ def command(self):
+ "Emit the command implied by all previous options."
+ return "cvsps --fast-export " + self.opts
+
+class cvs2git:
+ "Method class for cvs2git back end."
+ def __init__(self):
+ self.opts = ""
+ self.modulepath = "."
+ def set_authormap(self, _val):
+ "Set the author-map file."
+ sys.stderr.write("git cvsimport: author maping is not supported with cvs2git.\n")
+ sys.exit(1)
+ def set_repo(self, _val):
+ "Set the repository root option."
+ sys.stderr.write("git cvsimport: cvs2git must run within a repository checkout directory.\n")
+ sys.exit(1)
+ def set_fuzz(self, _val):
+ "Set the commit-similarity window."
+ sys.stderr.write("git cvsimport: fuzz setting is not supported with cvs2git.\n")
+ sys.exit(1)
+ def set_nokeywords(self):
+ "Suppress CVS keyword expansion."
+ self.opts += " --keywords-off"
+ def add_opts(self, val):
+ "Add options to the engine command line."
+ self.opts += " " + val
+ def set_exclusion(self, val):
+ "Set a file exclusion regexp."
+ self.opts += " --exclude='%s'" % val
+ def set_after(self, _val):
+ "Set a date threshold for incremental import."
+ sys.stderr.write("git cvsimport: incremental import is not supported with cvs2git.\n")
+ sys.exit(1)
+ def set_revmap(self, _val):
+ "Set the file to which the engine should dump a reference map."
+ sys.stderr.write("git cvsimport: can't get a reference map from cvs2git.\n")
+ sys.exit(1)
+ def set_module(self, val):
+ "Set the module to query."
+ self.modulepath = " " + val
+ def command(self):
+ "Emit the command implied by all previous options."
+ return "(cvs2git --username=git-cvsimport --quiet --quiet --blobfile={0} --dumpfile={1} {2} {3} && cat {0} {1} && rm {0} {1})".format(tempfile.mkstemp()[1], tempfile.mkstemp()[1], self.opts, self.modulepath)
+
+class filesource:
+ "Method class for file-source back end."
+ def __init__(self, filename):
+ self.filename = filename
+ def __complain(self, legend):
+ sys.stderr.write("git cvsimport: %s with file source.\n" % legend)
+ sys.exit(1)
+ def set_repo(self, _val):
+ "Set the repository root option."
+ self.__complain("repository can't be set")
+ def set_authormap(self, _val):
+ "Set the author-map file."
+ sys.stderr.write("git cvsimport: author mapping is not supported with filesource.\n")
+ sys.exit(1)
+ def set_fuzz(self, _val):
+ "Set the commit-similarity window."
+ self.__complain("fuzz can't be set")
+ def set_nokeywords(self, _val):
+ "Suppress CVS keyword expansion."
+ self.__complain("keyword suppression can't be set")
+ def add_opts(self, _val):
+ "Add options to the engine command line."
+ self.__complain("other options can't be set")
+ def set_exclusion(self, _val):
+ "Set a file exclusion regexp."
+ self.__complain("exclusions can't be set")
+ def set_after(self, _val):
+ "Set a date threshold for incremental import."
+ pass
+ def set_revmap(self, _val):
+ "Set the file to which the engine should dump a reference map."
+ sys.stderr.write("git cvsimport: can't get a reference map from cvs2git.\n")
+ sys.exit(1)
+ def set_module(self, _val):
+ "Set the module to query."
+ self.__complain("module can't be set")
+ def command(self):
+ "Emit the command implied by all previous options."
+ return "cat " + self.filename
+
+if __name__ == '__main__':
+ if sys.hexversion < 0x02060000:
+ sys.stderr.write("git cvsimport: requires Python 2.6 or later.\n")
+ sys.exit(1)
+ (options, arguments) = getopt.getopt(sys.argv[1:], "vbe:d:C:r:o:ikus:p:z:P:S:aL:A:Rh")
+ verbose = 0
+ bare = False
+ root = None
+ outdir = os.getcwd()
+ remotize = False
+ import_only = False
+ underscore_to_dot = False
+ slashsubst = None
+ authormap = None
+ revisionmap = False
+ backend = cvsps()
+ for (opt, val) in options:
+ if opt == '-v':
+ verbose += 1
+ elif opt == '-b':
+ bare = True
+ elif opt == '-e':
+ for cls in (cvsps, cvs2git):
+ if cls.__name__ == val:
+ backend = cls()
+ break
+ else:
+ sys.stderr.write("git cvsimport: unknown engine %s.\n" % val)
+ sys.exit(1)
+ elif opt == '-d':
+ backend.set_repo(val)
+ elif opt == '-C':
+ outdir = val
+ elif opt == '-r':
+ remotize = True
+ elif opt == '-o':
+ sys.stderr.write("git cvsimport: -o is no longer supported.\n")
+ sys.exit(1)
+ elif opt == '-i':
+ import_only = True
+ elif opt == '-k':
+ backend.set_nokeywords()
+ elif opt == '-u':
+ underscore_to_dot = True
+ elif opt == '-s':
+ slashsubst = val
+ elif opt == '-p':
+ backend.add_opts(val.replace(",", " "))
+ elif opt == '-z':
+ backend.set_fuzz(val)
+ elif opt == '-P':
+ backend = filesource(val)
+ sys.exit(1)
+ elif opt in ('-m', '-M'):
+ sys.stderr.write("git cvsimport: -m and -M are no longer supported: use reposurgeon instead.\n")
+ sys.exit(1)
+ elif opt == '-S':
+ backend.set_exclusion(val)
+ elif opt == '-a':
+ sys.stderr.write("git cvsimport: -a is no longer supported.\n")
+ sys.exit(1)
+ elif opt == '-L':
+ sys.stderr.write("git cvsimport: -L is no longer supported.\n")
+ sys.exit(1)
+ elif opt == '-A':
+ authormap = os.path.abspath(val)
+ elif opt == '-R':
+ revisionmap = True
+ else:
+ print """\
+git cvsimport [-A <author-conv-file>] [-C <git_repository>] [-b] [-d <CVSROOT>]
+ [-e engine] [-h] [-i] [-k] [-p <options-for-cvsps>] [-P <source-file>]
+ [-r <remote>] [-R] [-s <subst>] [-S <regex>] [-u] [-v] [-z <fuzz>]
+ [<CVS_module>]
+"""
+ def metadata(fn, outdir='.'):
+ if bare:
+ return os.path.join(outdir, fn)
+ else:
+ return os.path.join(outdir, ".git", fn)
+ # Ugly fallback code for people with only cvsps-2.x
+ # Added January 2013 - should be removed after a decent interval.
+ if backend.__class__.__name__ == "cvsps":
+ try:
+ subprocess.check_output("cvsps -V 2>/dev/null", shell=True)
+ except subprocess.CalledProcessError as e:
+ if e.returncode == 1:
+ sys.stderr.write("cvsimport: falling back to old version...\n")
+ sys.exit(os.system("git-cvsimport-fallback " + " ".join(sys.argv[1:])))
+ else:
+ sys.stderr.write("cvsimport: cannot execute cvsps.\n")
+ sys.exit(1)
+ # Real mainline code begins here
+ try:
+ if outdir:
+ try:
+ # If the output directory does not exist, create it
+ # and initialize it as a git repository.
+ os.mkdir(outdir)
+ do_or_die("git init --quiet " + outdir)
+ except OSError:
+ # Otherwise, assume user wants incremental import.
+ if not bare and not os.path.exists(os.path.join(outdir, ".git")):
+ raise Fatal("output directory is not a git repository")
+ threshold = capture_or_die("git log -1 --format=%ct").strip()
+ backend.set_after(threshold)
+ if revisionmap:
+ backend.set_revmap(tempfile.mkstemp()[1])
+ markmap = tempfile.mkstemp()[1]
+ if arguments:
+ backend.set_module(arguments[0])
+ gitopts = ""
+ if bare:
+ gitopts += " --bare"
+ if revisionmap:
+ gitopts += " --export-marks='%s'" % markmap
+ if authormap:
+ shutil.copyfile(authormap, metadata("cvs-authors", outdir))
+ if os.path.exists(metadata("cvs-authors", outdir)):
+ backend.set_authormap(metadata("cvs-authors", outdir))
+ do_or_die("%s | (cd %s >/dev/null; git fast-import --quiet %s)" \
+ % (backend.command(), outdir, gitopts))
+ os.chdir(outdir)
+ if underscore_to_dot or slashsubst:
+ tagnames = capture_or_die("git tag -l")
+ for tag in tagnames.split():
+ if tag:
+ changed = tag
+ if underscore_to_dot:
+ changed = changed.replace("_", ".")
+ if slashsubst:
+ changed = changed.replace(os.sep, slashsubst)
+ if changed != tag:
+ do_or_die("git tag -f %s %s >/dev/null" % (tag, changed))
+ if underscore_to_dot or slashsubst or remotize:
+ branchnames = capture_or_die("git branch -l")
+ for branch in branchnames.split():
+ if branch:
+ # Ugh - fragile dependency on branch -l output format
+ branch = branch[2:]
+ changed = branch
+ if underscore_to_dot:
+ changed = changed.replace("_", ".")
+ if slashsubst:
+ changed = changed.replace(os.sep, slashsubst)
+ if remotize:
+ changed = os.path.join("remotes", remotize, branch)
+ if changed != branch:
+ do_or_die("branch --m %s %s >/dev/null" % (branch, changed))
+ if revisionmap:
+ refd = {}
+ for line in open(backend.revmap):
+ if line.startswith("#"):
+ continue
+ (fn, rev, mark) = line.split()
+ refd[(fn, rev)] = mark
+ markd = {}
+ for line in open(markmap):
+ if line.startswith("#"):
+ continue
+ (mark, hashd) = line.split()
+ markd[mark] = hashd
+ with open(metadata("cvs-revisions"), "a") as wfp:
+ for ((fn, rev), val) in refd.items():
+ if val in markd:
+ wfp.write("%s %s %s\n" % (fn, rev, markd[val]))
+ os.remove(markmap)
+ os.remove(backend.revmap)
+ if not import_only and not bare:
+ do_or_die("git checkout -q")
+ except Fatal, err:
+ sys.stderr.write("git_cvsimport: " + err.msg + "\n")
+ sys.exit(1)
+ except KeyboardInterrupt:
+ pass
+
+# end
diff --git a/t/t9601/cvsroot/.gitattributes b/t/t9601/cvsroot/.gitattributes
deleted file mode 100644
index 562b12e..0000000
--- a/t/t9601/cvsroot/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -whitespace
diff --git a/t/t9601/cvsroot/CVSROOT/.gitignore b/t/t9601/cvsroot/CVSROOT/.gitignore
deleted file mode 100644
index 3bb9b34..0000000
--- a/t/t9601/cvsroot/CVSROOT/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-history
-val-tags
diff --git a/t/t9601/cvsroot/module/added-imported.txt,v b/t/t9601/cvsroot/module/added-imported.txt,v
deleted file mode 100644
index 5f83072..0000000
--- a/t/t9601/cvsroot/module/added-imported.txt,v
+++ /dev/null
@@ -1,44 +0,0 @@
-head 1.1;
-access;
-symbols
- vtag-4:1.1.1.1
- vbranchA:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.1
-date 2004.02.09.15.43.15; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.16; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@Add a file to the working copy.
-@
-text
-@Adding this file, before importing it with different contents.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-4).
-@
-text
-@d1 1
-a1 1
-This is vtag-4 (on vbranchA) of added-then-imported.txt.
-@
-
diff --git a/t/t9601/cvsroot/module/imported-anonymously.txt,v b/t/t9601/cvsroot/module/imported-anonymously.txt,v
deleted file mode 100644
index 55e1b0c..0000000
--- a/t/t9601/cvsroot/module/imported-anonymously.txt,v
+++ /dev/null
@@ -1,42 +0,0 @@
-head 1.1;
-branch 1.1.1;
-access;
-symbols
- vtag-1:1.1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@This is vtag-1 (on vbranchA) of imported-anonymously.txt.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-1).
-@
-text
-@@
-
-
diff --git a/t/t9601/cvsroot/module/imported-modified-imported.txt,v b/t/t9601/cvsroot/module/imported-modified-imported.txt,v
deleted file mode 100644
index e5830ae..0000000
--- a/t/t9601/cvsroot/module/imported-modified-imported.txt,v
+++ /dev/null
@@ -1,76 +0,0 @@
-head 1.2;
-access;
-symbols
- vtag-2:1.1.1.2
- vtag-1:1.1.1.1
- vbranchA:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2004.02.09.15.43.14; author kfogel; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next 1.1.1.2;
-
-1.1.1.2
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@First regular commit, to imported-modified-imported.txt, on HEAD.
-@
-text
-@This is a modification of imported-modified-imported.txt on HEAD.
-It should supersede the version from the vendor branch.
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d1 2
-a2 1
-This is vtag-1 (on vbranchA) of imported-modified-imported.txt.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-1).
-@
-text
-@@
-
-
-1.1.1.2
-log
-@Import (vbranchA, vtag-2).
-@
-text
-@d1 1
-a1 1
-This is vtag-2 (on vbranchA) of imported-modified-imported.txt.
-@
-
-
diff --git a/t/t9601/cvsroot/module/imported-modified.txt,v b/t/t9601/cvsroot/module/imported-modified.txt,v
deleted file mode 100644
index bbcfe44..0000000
--- a/t/t9601/cvsroot/module/imported-modified.txt,v
+++ /dev/null
@@ -1,59 +0,0 @@
-head 1.2;
-access;
-symbols
- vtag-1:1.1.1.1
- vbranchA:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2004.02.09.15.43.14; author kfogel; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@Commit on HEAD.
-@
-text
-@This is a modification of imported-modified.txt on HEAD.
-It should supersede the version from the vendor branch.
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d1 2
-a2 1
-This is vtag-1 (on vbranchA) of imported-modified.txt.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-1).
-@
-text
-@@
-
-
diff --git a/t/t9601/cvsroot/module/imported-once.txt,v b/t/t9601/cvsroot/module/imported-once.txt,v
deleted file mode 100644
index c5dd82b..0000000
--- a/t/t9601/cvsroot/module/imported-once.txt,v
+++ /dev/null
@@ -1,43 +0,0 @@
-head 1.1;
-branch 1.1.1;
-access;
-symbols
- vtag-1:1.1.1.1
- vbranchA:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@This is vtag-1 (on vbranchA) of imported-once.txt.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-1).
-@
-text
-@@
-
-
diff --git a/t/t9601/cvsroot/module/imported-twice.txt,v b/t/t9601/cvsroot/module/imported-twice.txt,v
deleted file mode 100644
index d1f3f1b..0000000
--- a/t/t9601/cvsroot/module/imported-twice.txt,v
+++ /dev/null
@@ -1,60 +0,0 @@
-head 1.1;
-branch 1.1.1;
-access;
-symbols
- vtag-2:1.1.1.2
- vtag-1:1.1.1.1
- vbranchA:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next 1.1.1.2;
-
-1.1.1.2
-date 2004.02.09.15.43.13; author kfogel; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@This is vtag-1 (on vbranchA) of imported-twice.txt.
-@
-
-
-1.1.1.1
-log
-@Import (vbranchA, vtag-1).
-@
-text
-@@
-
-
-1.1.1.2
-log
-@Import (vbranchA, vtag-2).
-@
-text
-@d1 1
-a1 1
-This is vtag-2 (on vbranchA) of imported-twice.txt.
-@
-
-
diff --git a/t/t9602/README b/t/t9602/README
deleted file mode 100644
index c231e0f..0000000
--- a/t/t9602/README
+++ /dev/null
@@ -1,62 +0,0 @@
-This repository is for testing the ability to group revisions
-correctly along tags and branches. Here is its history:
-
- 1. The initial import (revision 1.1 of everybody) created a
- directory structure with a file named `default' in each dir:
-
- ./
- default
- sub1/default
- subsubA/default
- subsubB/default
- sub2/default
- subsubA/default
- sub3/default
-
- 2. Then tagged everyone with T_ALL_INITIAL_FILES.
-
- 3. Then tagged everyone except sub1/subsubB/default with
- T_ALL_INITIAL_FILES_BUT_ONE.
-
- 4. Then created branch B_FROM_INITIALS on everyone.
-
- 5. Then created branch B_FROM_INITIALS_BUT_ONE on everyone except
- /sub1/subsubB/default.
-
- 6. Then committed modifications to two files: sub3/default, and
- sub1/subsubA/default.
-
- 7. Then committed a modification to all 7 files.
-
- 8. Then backdated sub3/default to revision 1.2, and
- sub2/subsubA/default to revision 1.1, and tagged with T_MIXED.
-
- 9. Same as 8, but tagged with -b to create branch B_MIXED.
-
- 10. Switched the working copy to B_MIXED, and added
- sub2/branch_B_MIXED_only. (That's why the RCS file is in
- sub2/Attic/ -- it never existed on trunk.)
-
- 11. In one commit, modified default, sub1/default, and
- sub2/subsubA/default, on branch B_MIXED.
-
- 12. Did "cvs up -A" on sub2/default, then in one commit, made a
- change to sub2/default and sub2/branch_B_MIXED_only. So this
- commit should be spread between the branch and the trunk.
-
- 13. Do "cvs up -A" to get everyone back to trunk, then make a new
- branch B_SPLIT on everyone except sub1/subsubB/default,v.
-
- 14. Switch to branch B_SPLIT (see sub1/subsubB/default disappear)
- and commit a change that affects everyone except sub3/default.
-
- 15. An hour or so later, "cvs up -A" to get sub1/subsubB/default
- back, then commit a change on that file, on trunk. (It's
- important that this change happened after the previous commits
- on B_SPLIT.)
-
- 16. Branch sub1/subsubB/default to B_SPLIT, then "cvs up -r B_SPLIT"
- to switch the whole working copy to the branch.
-
- 17. Commit a change on B_SPLIT, to sub1/subsubB/default and
- sub3/default.
diff --git a/t/t9602/cvsroot/.gitattributes b/t/t9602/cvsroot/.gitattributes
deleted file mode 100644
index 562b12e..0000000
--- a/t/t9602/cvsroot/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -whitespace
diff --git a/t/t9602/cvsroot/CVSROOT/.gitignore b/t/t9602/cvsroot/CVSROOT/.gitignore
deleted file mode 100644
index 3bb9b34..0000000
--- a/t/t9602/cvsroot/CVSROOT/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-history
-val-tags
diff --git a/t/t9602/cvsroot/module/default,v b/t/t9602/cvsroot/module/default,v
deleted file mode 100644
index 3b68382..0000000
--- a/t/t9602/cvsroot/module/default,v
+++ /dev/null
@@ -1,102 +0,0 @@
-head 1.2;
-access;
-symbols
- B_SPLIT:1.2.0.4
- B_MIXED:1.2.0.2
- T_MIXED:1.2
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches
- 1.2.2.1
- 1.2.4.1;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.2.2.1
-date 2003.05.23.00.31.36; author jrandom; state Exp;
-branches;
-next ;
-
-1.2.4.1
-date 2003.06.03.03.20.31; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@This is the file `default' in the top level of the project.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added in the second commit (affecting all 7 files).
-@
-
-
-1.2.4.1
-log
-@First change on branch B_SPLIT.
-
-This change excludes sub3/default, because it was not part of this
-commit, and sub1/subsubB/default, which is not even on the branch yet.
-@
-text
-@a5 2
-
-First change on branch B_SPLIT.
-@
-
-
-1.2.2.1
-log
-@Modify three files, on branch B_MIXED.
-@
-text
-@a5 2
-
-This line was added on branch B_MIXED only (affecting 3 files).
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub1/default,v b/t/t9602/cvsroot/module/sub1/default,v
deleted file mode 100644
index b7fdccd..0000000
--- a/t/t9602/cvsroot/module/sub1/default,v
+++ /dev/null
@@ -1,102 +0,0 @@
-head 1.2;
-access;
-symbols
- B_SPLIT:1.2.0.4
- B_MIXED:1.2.0.2
- T_MIXED:1.2
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches
- 1.2.2.1
- 1.2.4.1;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.2.2.1
-date 2003.05.23.00.31.36; author jrandom; state Exp;
-branches;
-next ;
-
-1.2.4.1
-date 2003.06.03.03.20.31; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@This is sub1/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added in the second commit (affecting all 7 files).
-@
-
-
-1.2.4.1
-log
-@First change on branch B_SPLIT.
-
-This change excludes sub3/default, because it was not part of this
-commit, and sub1/subsubB/default, which is not even on the branch yet.
-@
-text
-@a5 2
-
-First change on branch B_SPLIT.
-@
-
-
-1.2.2.1
-log
-@Modify three files, on branch B_MIXED.
-@
-text
-@a5 2
-
-This line was added on branch B_MIXED only (affecting 3 files).
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub1/subsubA/default,v b/t/t9602/cvsroot/module/sub1/subsubA/default,v
deleted file mode 100644
index 472b7b2..0000000
--- a/t/t9602/cvsroot/module/sub1/subsubA/default,v
+++ /dev/null
@@ -1,101 +0,0 @@
-head 1.3;
-access;
-symbols
- B_SPLIT:1.3.0.4
- B_MIXED:1.3.0.2
- T_MIXED:1.3
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.3
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches
- 1.3.4.1;
-next 1.2;
-
-1.2
-date 2003.05.23.00.15.26; author jrandom; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.3.4.1
-date 2003.06.03.03.20.31; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.3
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@This is sub1/subsubA/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added by the first commit (affecting two files).
-
-This line was added in the second commit (affecting all 7 files).
-@
-
-
-1.3.4.1
-log
-@First change on branch B_SPLIT.
-
-This change excludes sub3/default, because it was not part of this
-commit, and sub1/subsubB/default, which is not even on the branch yet.
-@
-text
-@a7 2
-
-First change on branch B_SPLIT.
-@
-
-
-1.2
-log
-@First commit to proj, affecting two files.
-@
-text
-@d6 2
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub1/subsubB/default,v b/t/t9602/cvsroot/module/sub1/subsubB/default,v
deleted file mode 100644
index fe6efa4..0000000
--- a/t/t9602/cvsroot/module/sub1/subsubB/default,v
+++ /dev/null
@@ -1,107 +0,0 @@
-head 1.3;
-access;
-symbols
- B_SPLIT:1.3.0.2
- B_MIXED:1.2.0.2
- T_MIXED:1.2
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.3
-date 2003.06.03.04.29.14; author jrandom; state Exp;
-branches
- 1.3.2.1;
-next 1.2;
-
-1.2
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.3.2.1
-date 2003.06.03.04.33.13; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.3
-log
-@A trunk change to sub1/subsubB/default. This was committed about an
-hour after an earlier change that affected most files on branch
-B_SPLIT. This file is not on that branch yet, but after this commit,
-we'll branch to B_SPLIT, albeit rooted in a revision that didn't exist
-at the time the rest of B_SPLIT was created.
-@
-text
-@This is sub1/subsubB/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added in the second commit (affecting all 7 files).
-
-This bit was committed on trunk about an hour after an earlier change
-to everyone else on branch B_SPLIT. Afterwards, we'll finally branch
-this file to B_SPLIT, but rooted in a revision that didn't exist at
-the time the rest of B_SPLIT was created.
-@
-
-
-1.3.2.1
-log
-@This change affects sub3/default and sub1/subsubB/default, on branch
-B_SPLIT. Note that the latter file did not even exist on this branch
-until after some other files had had revisions committed on B_SPLIT.
-@
-text
-@a10 4
-
-This change affects sub3/default and sub1/subsubB/default, on branch
-B_SPLIT. Note that the latter file did not even exist on this branch
-until after some other files had had revisions committed on B_SPLIT.
-@
-
-
-1.2
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@d6 5
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub2/Attic/branch_B_MIXED_only,v b/t/t9602/cvsroot/module/sub2/Attic/branch_B_MIXED_only,v
deleted file mode 100644
index 34c9789..0000000
--- a/t/t9602/cvsroot/module/sub2/Attic/branch_B_MIXED_only,v
+++ /dev/null
@@ -1,59 +0,0 @@
-head 1.1;
-access;
-symbols
- B_MIXED:1.1.0.2;
-locks; strict;
-comment @# @;
-
-
-1.1
-date 2003.05.23.00.25.26; author jrandom; state dead;
-branches
- 1.1.2.1;
-next ;
-
-1.1.2.1
-date 2003.05.23.00.25.26; author jrandom; state Exp;
-branches;
-next 1.1.2.2;
-
-1.1.2.2
-date 2003.05.23.00.48.51; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.1
-log
-@file branch_B_MIXED_only was initially added on branch B_MIXED.
-@
-text
-@@
-
-
-1.1.2.1
-log
-@Add a file on branch B_MIXED.
-@
-text
-@a0 1
-This file was added on branch B_MIXED. It never existed on trunk.
-@
-
-
-1.1.2.2
-log
-@A single commit affecting one file on branch B_MIXED and one on trunk.
-@
-text
-@a1 3
-
-The same commit added these two lines here on branch B_MIXED, and two
-similar lines to ./default on trunk.
-@
-
-
diff --git a/t/t9602/cvsroot/module/sub2/default,v b/t/t9602/cvsroot/module/sub2/default,v
deleted file mode 100644
index 018f7f8..0000000
--- a/t/t9602/cvsroot/module/sub2/default,v
+++ /dev/null
@@ -1,102 +0,0 @@
-head 1.3;
-access;
-symbols
- B_SPLIT:1.3.0.2
- B_MIXED:1.2.0.2
- T_MIXED:1.2
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.3
-date 2003.05.23.00.48.51; author jrandom; state Exp;
-branches
- 1.3.2.1;
-next 1.2;
-
-1.2
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.3.2.1
-date 2003.06.03.03.20.31; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.3
-log
-@A single commit affecting one file on branch B_MIXED and one on trunk.
-@
-text
-@This is sub2/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added in the second commit (affecting all 7 files).
-
-The same commit added these two lines here on trunk, and two similar
-lines to ./branch_B_MIXED_only on branch B_MIXED.
-@
-
-
-1.3.2.1
-log
-@First change on branch B_SPLIT.
-
-This change excludes sub3/default, because it was not part of this
-commit, and sub1/subsubB/default, which is not even on the branch yet.
-@
-text
-@a8 2
-
-First change on branch B_SPLIT.
-@
-
-
-1.2
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@d6 3
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub2/subsubA/default,v b/t/t9602/cvsroot/module/sub2/subsubA/default,v
deleted file mode 100644
index d13242c..0000000
--- a/t/t9602/cvsroot/module/sub2/subsubA/default,v
+++ /dev/null
@@ -1,102 +0,0 @@
-head 1.2;
-access;
-symbols
- B_SPLIT:1.2.0.2
- B_MIXED:1.1.0.2
- T_MIXED:1.1
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches
- 1.2.2.1;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1
- 1.1.2.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.1.2.1
-date 2003.05.23.00.31.36; author jrandom; state Exp;
-branches;
-next ;
-
-1.2.2.1
-date 2003.06.03.03.20.31; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@This is sub2/subsub2/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added in the second commit (affecting all 7 files).
-@
-
-
-1.2.2.1
-log
-@First change on branch B_SPLIT.
-
-This change excludes sub3/default, because it was not part of this
-commit, and sub1/subsubB/default, which is not even on the branch yet.
-@
-text
-@a5 2
-
-First change on branch B_SPLIT.
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.2.1
-log
-@Modify three files, on branch B_MIXED.
-@
-text
-@a3 2
-
-This line was added on branch B_MIXED only (affecting 3 files).
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9602/cvsroot/module/sub3/default,v b/t/t9602/cvsroot/module/sub3/default,v
deleted file mode 100644
index 88e4567..0000000
--- a/t/t9602/cvsroot/module/sub3/default,v
+++ /dev/null
@@ -1,102 +0,0 @@
-head 1.3;
-access;
-symbols
- B_SPLIT:1.3.0.2
- B_MIXED:1.2.0.2
- T_MIXED:1.2
- B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
- B_FROM_INITIALS:1.1.1.1.0.2
- T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
- T_ALL_INITIAL_FILES:1.1.1.1
- vendortag:1.1.1.1
- vendorbranch:1.1.1;
-locks; strict;
-comment @# @;
-
-
-1.3
-date 2003.05.23.00.17.53; author jrandom; state Exp;
-branches
- 1.3.2.1;
-next 1.2;
-
-1.2
-date 2003.05.23.00.15.26; author jrandom; state Exp;
-branches;
-next 1.1;
-
-1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches
- 1.1.1.1;
-next ;
-
-1.1.1.1
-date 2003.05.22.23.20.19; author jrandom; state Exp;
-branches;
-next ;
-
-1.3.2.1
-date 2003.06.03.04.33.13; author jrandom; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.3
-log
-@Second commit to proj, affecting all 7 files.
-@
-text
-@This is sub3/default.
-
-Every directory in the `proj' project has a file named `default'.
-
-This line was added by the first commit (affecting two files).
-
-This line was added in the second commit (affecting all 7 files).
-@
-
-
-1.3.2.1
-log
-@This change affects sub3/default and sub1/subsubB/default, on branch
-B_SPLIT. Note that the latter file did not even exist on this branch
-until after some other files had had revisions committed on B_SPLIT.
-@
-text
-@a7 4
-
-This change affects sub3/default and sub1/subsubB/default, on branch
-B_SPLIT. Note that the latter file did not even exist on this branch
-until after some other files had had revisions committed on B_SPLIT.
-@
-
-
-1.2
-log
-@First commit to proj, affecting two files.
-@
-text
-@d6 2
-@
-
-
-1.1
-log
-@Initial revision
-@
-text
-@d4 2
-@
-
-
-1.1.1.1
-log
-@Initial import.
-@
-text
-@@
diff --git a/t/t9603/cvsroot/.gitattributes b/t/t9603/cvsroot/.gitattributes
deleted file mode 100644
index 562b12e..0000000
--- a/t/t9603/cvsroot/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -whitespace
diff --git a/t/t9603/cvsroot/CVSROOT/.gitignore b/t/t9603/cvsroot/CVSROOT/.gitignore
deleted file mode 100644
index 3bb9b34..0000000
--- a/t/t9603/cvsroot/CVSROOT/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-history
-val-tags
diff --git a/t/t9603/cvsroot/module/a,v b/t/t9603/cvsroot/module/a,v
deleted file mode 100644
index ba8fd5a..0000000
--- a/t/t9603/cvsroot/module/a,v
+++ /dev/null
@@ -1,74 +0,0 @@
-head 1.2;
-access;
-symbols
- A:1.2.0.2;
-locks; strict;
-comment @# @;
-
-
-1.2
-date 2009.02.21.18.11.14; author tester; state Exp;
-branches
- 1.2.2.1;
-next 1.1;
-
-1.1
-date 2009.02.21.18.11.43; author tester; state Exp;
-branches;
-next ;
-
-1.2.2.1
-date 2009.03.11.19.03.52; author tester; state Exp;
-branches;
-next 1.2.2.2;
-
-1.2.2.2
-date 2009.03.11.19.09.10; author tester; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.2
-log
-@Rev 2
-@
-text
-@1.2
-@
-
-
-1.2.2.1
-log
-@Rev 4 Branch A
-@
-text
-@d1 1
-a1 1
-1.2.2.1
-@
-
-
-1.2.2.2
-log
-@Rev 5 Branch A
-@
-text
-@d1 1
-a1 1
-1.2.2.2
-@
-
-
-1.1
-log
-@Rev 1
-@
-text
-@d1 1
-a1 1
-1.1
-@
diff --git a/t/t9603/cvsroot/module/b,v b/t/t9603/cvsroot/module/b,v
deleted file mode 100644
index d268855..0000000
--- a/t/t9603/cvsroot/module/b,v
+++ /dev/null
@@ -1,90 +0,0 @@
-head 1.3;
-access;
-symbols
- A:1.2.0.2;
-locks; strict;
-comment @# @;
-
-
-1.3
-date 2009.03.11.19.05.08; author tester; state Exp;
-branches;
-next 1.2;
-
-1.2
-date 2009.02.21.18.11.43; author tester; state Exp;
-branches
- 1.2.2.1;
-next 1.1;
-
-1.1
-date 2009.02.21.18.11.14; author tester; state Exp;
-branches;
-next ;
-
-1.2.2.1
-date 2009.03.11.19.03.52; author tester; state Exp;
-branches;
-next 1.2.2.2;
-
-1.2.2.2
-date 2009.03.11.19.09.10; author tester; state Exp;
-branches;
-next ;
-
-
-desc
-@@
-
-
-1.3
-log
-@Rev 4
-@
-text
-@1.3
-@
-
-
-1.2
-log
-@Rev 3
-@
-text
-@d1 1
-a1 1
-1.2
-@
-
-
-1.2.2.1
-log
-@Rev 4 Branch A
-@
-text
-@d1 1
-a1 1
-1.2.2.1
-@
-
-
-1.2.2.2
-log
-@Rev 5 Branch A
-@
-text
-@d1 1
-a1 1
-1.2
-@
-
-
-1.1
-log
-@Rev 2
-@
-text
-@d1 1
-a1 1
-1.1
-@
--
1.8.1.407.g59f98af
^ permalink raw reply related
* Suggestion: add option in git-p4 to preserve user in Git repository
From: Olivier Delalleau @ 2013-01-11 3:38 UTC (permalink / raw)
To: git
Hi,
I'm in a situation where I don't have P4 admin rights to use the
--preserve-user option of git-p4. However, I would like to keep user
information in the associated Git branch.
Would it be possible to add an option for this?
Thanks,
-=- Olivier
^ permalink raw reply
* Re: [PATCH 1/2] fetch, upload-pack: add --no-shallow for infinite depth
From: Junio C Hamano @ 2013-01-11 3:55 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy
Cc: git, Stefan Beller, Jonathan Nieder, schlotter, Ralf.Wildenhues
In-Reply-To: <1357875005-21956-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> The user can do --depth=2147483647 (*) for infinite depth now. But
> it's hard to remember. Any other numbers larger than the longest
> commit chain in the repository would also do, but some guessing may
> be involved. Make easy-to-remember --no-shallow an alias for
> --depth=2147483647.
I think "no shallow" makes sense in a much more important way than
"infinite depth", and this patch is a good idea for a reason
entirely different from the justification your log message makes ;-)
We explain that "clone --depth=<number>" is a way to end up with a
partial repository that contains only the recent history, and while
this may give users a smaller repository, in return the result will
be a "shallow repository" with certain limitations (i.e. fetching or
cloning from such a repository will be refused).
We also explain that the reason to use --depth=<number> is to grab
some history behind what you originally acquired into your "shallow
repository" so that you have deeper history than your original
"shallow repository".
A reader who does not know how this shallowness is implemented
cannot be blamed if she thinks the shallowness is a permanent
attribute of a repository, and once a repository is tainted by
shallowness, it cannot be wiped away by deepening it, because
nowhere in the documentation we say the "shallowness" will go away
once you grabbed enough number of older commits with it.
Calling the option "--no-shallow" (or even better, "--unshallow",
meaning "make it a repository that is no longer shallow") makes it
crystal clear that the option is about wiping away the shallowness.
Of course, the result has to contain an untruncted history, but that
is a mere side effect and an implementation detail from the end
user's point of view.
> Make upload-pack recognize this special number as infinite depth. The
> effect is essentially the same as before, except that upload-pack is
> more efficient because it does not have to traverse to the bottom
> any more. The chance of a user actually wanting exactly 2147483647
> commits depth, not infinite, on a repository with a history that long,
> is probably too small to consider.
>
> (*) This is the largest positive number a 32-bit signed integer can
> contain. JGit and older C Git store depth as "int" so both are OK
> with this number. Dulwich does not support shallow clone.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> Documentation/fetch-options.txt | 4 ++++
> Documentation/git-fetch-pack.txt | 2 ++
> Documentation/technical/shallow.txt | 3 +++
> builtin/fetch.c | 15 ++++++++++++++-
> commit.h | 3 +++
> t/t5500-fetch-pack.sh | 16 ++++++++++++++++
> upload-pack.c | 13 ++++++++++---
> 7 files changed, 52 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
> index 6e98bdf..012d1b2 100644
> --- a/Documentation/fetch-options.txt
> +++ b/Documentation/fetch-options.txt
> @@ -13,6 +13,10 @@
> to the specified number of commits from the tip of each remote
> branch history. Tags for the deepened commits are not fetched.
>
> +--no-shallow::
> + Deepen to the roots of the repository's history (i.e. the
> + result repository is no longer shallow).
> +
Mentioning both is a good thing, but I think "no longer shallow" is
more important aspect of this operation than "deepen to the roots".
> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> index 6322e8a..6a6e672 100755
> --- a/t/t5500-fetch-pack.sh
> +++ b/t/t5500-fetch-pack.sh
> @@ -264,6 +264,22 @@ test_expect_success 'clone shallow object count' '
> grep "^count: 52" count.shallow
> '
>
> +test_expect_success 'fetch --depth --no-shallow' '
> + (
> + cd shallow &&
> + test_must_fail git fetch --depth=1 --no-shallow
> + )
> +'
> +
> +test_expect_success 'infinite deepening (full repo)' '
> + (
> + cd shallow &&
> + git fetch --no-shallow &&
> + git fsck --full &&
> + ! test -f .git/shallow
This looks as if fsck is what removes .git/shallow but I do not
think that is what is being tested...
> diff --git a/upload-pack.c b/upload-pack.c
> index 6142421..88f0029 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -670,10 +670,17 @@ static void receive_needs(void)
> if (depth == 0 && shallows.nr == 0)
> return;
> if (depth > 0) {
> - struct commit_list *result, *backup;
> + struct commit_list *result = NULL, *backup = NULL;
> int i;
> - backup = result = get_shallow_commits(&want_obj, depth,
> - SHALLOW, NOT_SHALLOW);
> + if (depth == INFINITE_DEPTH)
> + for (i = 0; i < shallows.nr; i++) {
> + struct object *object = shallows.objects[i].item;
> + object->flags |= NOT_SHALLOW;
> + }
> + else
> + backup = result =
> + get_shallow_commits(&want_obj, depth,
> + SHALLOW, NOT_SHALLOW);
Nice. Thanks.
^ permalink raw reply
* Re: [PATCH] minor diff between gitweb docs and actual template for $GIT/description
From: Tim Chase @ 2013-01-11 4:25 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Jakub Narebski
In-Reply-To: <20130111022200.GH30784@google.com>
On 01/10/13 20:22, Jonathan Nieder wrote:
> (+cc: Jakub, who maintains gitweb)
> Hi Tim,
>
> Tim Chase wrote:
>
>> The documentation for gitweb gives one description of the default
>> content for the $GIT/description, the description template has other
>> text. One of these two patches should be applied to bring them into
>> order (applying both would just reverse the problem). Or, both
>> could be changed to the same new text.
>
> May we have your sign-off? (See Documentation/SubmittingPatches for
> what this means.)
Hahahahah...a one liner doc-fix copy/pasting code from one place in
the codebase to another? If you need it, you've got it:
For my one line diff:
Signed-off-by: Tim Chase <git@tim.thechases.com>
Otherwise, consider my contribution CC0 or public domain or whatever
suits you best. Or take my patch as a bug report and "make" the fix
yourself. :-)
The patches should have been based off the master branch of
github.com/git/git, FWIW.
-tkc
@gumnos
^ 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