* [PATCH 19/21] grep: use writable strbuf from caller for grep_tree()
From: Nguyễn Thái Ngọc Duy @ 2010-12-17 12:44 UTC (permalink / raw)
To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
In-Reply-To: <AANLkTi=hXQqtYmhtHh+D67d9puRrDA+iScpafaYYMsAk@mail.gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
strbuf_offset and its patch are dropped.
builtin/grep.c | 51 ++++++++++++++++++++++++---------------------------
1 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index fbc7d02..fa1ad28 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -623,43 +623,29 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
}
static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
- struct tree_desc *tree,
- const char *tree_name, const char *base)
+ struct tree_desc *tree, struct strbuf *base, int tn_len)
{
- int len;
int hit = 0;
struct name_entry entry;
- char *down;
- int tn_len = strlen(tree_name);
- struct strbuf pathbuf;
-
- strbuf_init(&pathbuf, PATH_MAX + tn_len);
-
- if (tn_len) {
- strbuf_add(&pathbuf, tree_name, tn_len);
- strbuf_addch(&pathbuf, ':');
- tn_len = pathbuf.len;
- }
- strbuf_addstr(&pathbuf, base);
- len = pathbuf.len;
+ int old_baselen = base->len;
while (tree_entry(tree, &entry)) {
int te_len = tree_entry_len(entry.path, entry.sha1);
- pathbuf.len = len;
- strbuf_add(&pathbuf, entry.path, te_len);
+
+ strbuf_add(base, entry.path, te_len);
if (S_ISDIR(entry.mode))
/* Match "abc/" against pathspec to
* decide if we want to descend into "abc"
* directory.
*/
- strbuf_addch(&pathbuf, '/');
+ strbuf_addch(base, '/');
- down = pathbuf.buf + tn_len;
- if (!pathspec_matches(pathspec->raw, down, opt->max_depth))
+ if (!pathspec_matches(pathspec->raw, base->buf + tn_len, opt->max_depth))
;
- else if (S_ISREG(entry.mode))
- hit |= grep_sha1(opt, entry.sha1, pathbuf.buf, tn_len);
+ else if (S_ISREG(entry.mode)) {
+ hit |= grep_sha1(opt, entry.sha1, base->buf, tn_len);
+ }
else if (S_ISDIR(entry.mode)) {
enum object_type type;
struct tree_desc sub;
@@ -671,13 +657,14 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
die("unable to read tree (%s)",
sha1_to_hex(entry.sha1));
init_tree_desc(&sub, data, size);
- hit |= grep_tree(opt, pathspec, &sub, tree_name, down);
+ hit |= grep_tree(opt, pathspec, &sub, base, tn_len);
free(data);
}
+ strbuf_setlen(base, old_baselen);
+
if (hit && opt->status_only)
break;
}
- strbuf_release(&pathbuf);
return hit;
}
@@ -690,13 +677,23 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
struct tree_desc tree;
void *data;
unsigned long size;
- int hit;
+ struct strbuf base;
+ int hit, len;
+
data = read_object_with_reference(obj->sha1, tree_type,
&size, NULL);
if (!data)
die("unable to read tree (%s)", sha1_to_hex(obj->sha1));
+
+ len = name ? strlen(name) : 0;
+ strbuf_init(&base, PATH_MAX + len + 1);
+ if (len) {
+ strbuf_add(&base, name, len);
+ strbuf_addch(&base, ':');
+ }
init_tree_desc(&tree, data, size);
- hit = grep_tree(opt, pathspec, &tree, name, "");
+ hit = grep_tree(opt, pathspec, &tree, &base, base.len);
+ strbuf_release(&base);
free(data);
return hit;
}
--
1.7.3.3.476.g10a82
^ permalink raw reply related
* [PATCH 15/21] Convert ce_path_match() to use struct pathspec
From: Nguyễn Thái Ngọc Duy @ 2010-12-17 12:43 UTC (permalink / raw)
To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
In-Reply-To: <1292589787-9525-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
The old 14/21. Slightly changed because of rev_info->pathspec change.
builtin/update-index.c | 8 ++++++--
cache.h | 2 +-
diff-lib.c | 4 ++--
preload-index.c | 5 ++++-
read-cache.c | 7 ++++---
revision.c | 2 +-
wt-status.c | 5 ++++-
7 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 3ab214d..9d1f67e 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -543,7 +543,10 @@ static int do_reupdate(int ac, const char **av,
*/
int pos;
int has_head = 1;
- const char **pathspec = get_pathspec(prefix, av + 1);
+ const char **paths = get_pathspec(prefix, av + 1);
+ struct pathspec pathspec;
+
+ init_pathspec(&pathspec, paths);
if (read_ref("HEAD", head_sha1))
/* If there is no HEAD, that means it is an initial
@@ -556,7 +559,7 @@ static int do_reupdate(int ac, const char **av,
struct cache_entry *old = NULL;
int save_nr;
- if (ce_stage(ce) || !ce_path_match(ce, pathspec))
+ if (ce_stage(ce) || !ce_path_match(ce, &pathspec))
continue;
if (has_head)
old = read_one_ent(NULL, head_sha1,
@@ -575,6 +578,7 @@ static int do_reupdate(int ac, const char **av,
if (save_nr != active_nr)
goto redo;
}
+ free_pathspec(&pathspec);
return 0;
}
diff --git a/cache.h b/cache.h
index dc0bfb4..b5cd61c 100644
--- a/cache.h
+++ b/cache.h
@@ -508,7 +508,7 @@ struct pathspec {
extern int init_pathspec(struct pathspec *, const char **);
extern void free_pathspec(struct pathspec *);
-extern int ce_path_match(const struct cache_entry *ce, const char **pathspec);
+extern int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec);
extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path);
extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object);
extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
diff --git a/diff-lib.c b/diff-lib.c
index 2251f3d..1e22992 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -106,7 +106,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
break;
- if (!ce_path_match(ce, revs->prune_data.raw))
+ if (!ce_path_match(ce, &revs->prune_data))
continue;
if (ce_stage(ce)) {
@@ -427,7 +427,7 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o)
if (tree == o->df_conflict_entry)
tree = NULL;
- if (ce_path_match(idx ? idx : tree, revs->prune_data.raw))
+ if (ce_path_match(idx ? idx : tree, &revs->prune_data))
do_oneway_diff(o, idx, tree);
return 0;
diff --git a/preload-index.c b/preload-index.c
index e3d0bda..49cb08d 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -35,7 +35,9 @@ static void *preload_thread(void *_data)
struct index_state *index = p->index;
struct cache_entry **cep = index->cache + p->offset;
struct cache_def cache;
+ struct pathspec pathspec;
+ init_pathspec(&pathspec, p->pathspec);
memset(&cache, 0, sizeof(cache));
nr = p->nr;
if (nr + p->offset > index->cache_nr)
@@ -51,7 +53,7 @@ static void *preload_thread(void *_data)
continue;
if (ce_uptodate(ce))
continue;
- if (!ce_path_match(ce, p->pathspec))
+ if (!ce_path_match(ce, &pathspec))
continue;
if (threaded_has_symlink_leading_path(&cache, ce->name, ce_namelen(ce)))
continue;
@@ -61,6 +63,7 @@ static void *preload_thread(void *_data)
continue;
ce_mark_uptodate(ce);
} while (--nr > 0);
+ free_pathspec(&pathspec);
return NULL;
}
diff --git a/read-cache.c b/read-cache.c
index 1f42473..f1141a3 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -683,17 +683,18 @@ int ce_same_name(struct cache_entry *a, struct cache_entry *b)
return ce_namelen(b) == len && !memcmp(a->name, b->name, len);
}
-int ce_path_match(const struct cache_entry *ce, const char **pathspec)
+int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec)
{
const char *match, *name;
+ const char **ps = pathspec->raw;
int len;
- if (!pathspec)
+ if (!pathspec->nr)
return 1;
len = ce_namelen(ce);
name = ce->name;
- while ((match = *pathspec++) != NULL) {
+ while ((match = *ps++) != NULL) {
int matchlen = strlen(match);
if (matchlen > len)
continue;
diff --git a/revision.c b/revision.c
index 515e2dd..a0d3816 100644
--- a/revision.c
+++ b/revision.c
@@ -969,7 +969,7 @@ static void prepare_show_merge(struct rev_info *revs)
struct cache_entry *ce = active_cache[i];
if (!ce_stage(ce))
continue;
- if (ce_path_match(ce, revs->prune_data.raw)) {
+ if (ce_path_match(ce, &revs->prune_data)) {
prune_num++;
prune = xrealloc(prune, sizeof(*prune) * prune_num);
prune[prune_num-2] = ce->name;
diff --git a/wt-status.c b/wt-status.c
index 5c6b118..457d265 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -350,14 +350,16 @@ static void wt_status_collect_changes_index(struct wt_status *s)
static void wt_status_collect_changes_initial(struct wt_status *s)
{
+ struct pathspec pathspec;
int i;
+ init_pathspec(&pathspec, s->pathspec);
for (i = 0; i < active_nr; i++) {
struct string_list_item *it;
struct wt_status_change_data *d;
struct cache_entry *ce = active_cache[i];
- if (!ce_path_match(ce, s->pathspec))
+ if (!ce_path_match(ce, &pathspec))
continue;
it = string_list_insert(&s->change, ce->name);
d = it->util;
@@ -372,6 +374,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
else
d->index_status = DIFF_STATUS_ADDED;
}
+ free_pathspec(&pathspec);
}
static void wt_status_collect_untracked(struct wt_status *s)
--
1.7.3.3.476.g10a82
^ permalink raw reply related
* [PATCH 14/21] struct rev_info: convert prune_data to struct pathspec
From: Nguyễn Thái Ngọc Duy @ 2010-12-17 12:43 UTC (permalink / raw)
To: git, Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy
In-Reply-To: <AANLkTikKCU==mS5_TdqHstETj=CQ_deHMCJ4xW0r+Sck@mail.gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
New patch. rev_info->pathspec is now struct pathspec.
builtin/add.c | 2 +-
builtin/diff.c | 12 ++++--------
builtin/fast-export.c | 2 +-
diff-lib.c | 6 +++---
revision.c | 15 ++++++++-------
revision.h | 2 +-
wt-status.c | 4 ++--
7 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index 56a4e0a..3fc79a5 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -86,7 +86,7 @@ int add_files_to_cache(const char *prefix, const char **pathspec, int flags)
struct rev_info rev;
init_revisions(&rev, prefix);
setup_revisions(0, NULL, &rev, NULL);
- rev.prune_data = pathspec;
+ init_pathspec(&rev.prune_data, pathspec);
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = update_callback;
data.flags = flags;
diff --git a/builtin/diff.c b/builtin/diff.c
index 76c42d8..4ebb1b6 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -371,14 +371,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
}
die("unhandled object '%s' given.", name);
}
- if (rev.prune_data) {
- const char **pathspec = rev.prune_data;
- while (*pathspec) {
- if (!path)
- path = *pathspec;
- paths++;
- pathspec++;
- }
+ if (rev.prune_data.nr) {
+ if (!path)
+ path = rev.prune_data.items[0].match;
+ paths += rev.prune_data.nr;
}
/*
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index c8fd46b..ba57457 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -651,7 +651,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
if (import_filename)
import_marks(import_filename);
- if (import_filename && revs.prune_data)
+ if (import_filename && revs.prune_data.nr)
full_tree = 1;
get_tags_and_duplicates(&revs.pending, &extra_refs);
diff --git a/diff-lib.c b/diff-lib.c
index 3b809f2..2251f3d 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -106,7 +106,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
break;
- if (!ce_path_match(ce, revs->prune_data))
+ if (!ce_path_match(ce, revs->prune_data.raw))
continue;
if (ce_stage(ce)) {
@@ -427,7 +427,7 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o)
if (tree == o->df_conflict_entry)
tree = NULL;
- if (ce_path_match(idx ? idx : tree, revs->prune_data))
+ if (ce_path_match(idx ? idx : tree, revs->prune_data.raw))
do_oneway_diff(o, idx, tree);
return 0;
@@ -501,7 +501,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
active_nr = dst - active_cache;
init_revisions(&revs, NULL);
- revs.prune_data = opt->pathspec.raw;
+ init_pathspec(&revs.prune_data, opt->pathspec.raw);
tree = parse_tree_indirect(tree_sha1);
if (!tree)
die("bad tree object %s", sha1_to_hex(tree_sha1));
diff --git a/revision.c b/revision.c
index b2a5867..515e2dd 100644
--- a/revision.c
+++ b/revision.c
@@ -323,7 +323,7 @@ static int rev_compare_tree(struct rev_info *revs, struct commit *parent, struct
* tagged commit by specifying both --simplify-by-decoration
* and pathspec.
*/
- if (!revs->prune_data)
+ if (!revs->prune_data.nr)
return REV_TREE_SAME;
}
@@ -969,7 +969,7 @@ static void prepare_show_merge(struct rev_info *revs)
struct cache_entry *ce = active_cache[i];
if (!ce_stage(ce))
continue;
- if (ce_path_match(ce, revs->prune_data)) {
+ if (ce_path_match(ce, revs->prune_data.raw)) {
prune_num++;
prune = xrealloc(prune, sizeof(*prune) * prune_num);
prune[prune_num-2] = ce->name;
@@ -979,7 +979,8 @@ static void prepare_show_merge(struct rev_info *revs)
ce_same_name(ce, active_cache[i+1]))
i++;
}
- revs->prune_data = prune;
+ free_pathspec(&revs->prune_data);
+ init_pathspec(&revs->prune_data, prune);
revs->limited = 1;
}
@@ -1616,7 +1617,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
}
if (prune_data)
- revs->prune_data = get_pathspec(revs->prefix, prune_data);
+ init_pathspec(&revs->prune_data, get_pathspec(revs->prefix, prune_data));
if (revs->def == NULL)
revs->def = opt ? opt->def : NULL;
@@ -1647,13 +1648,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (revs->topo_order)
revs->limited = 1;
- if (revs->prune_data) {
- diff_tree_setup_paths(revs->prune_data, &revs->pruning);
+ if (revs->prune_data.nr) {
+ diff_tree_setup_paths(revs->prune_data.raw, &revs->pruning);
/* Can't prune commits with rename following: the paths change.. */
if (!DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
revs->prune = 1;
if (!revs->full_diff)
- diff_tree_setup_paths(revs->prune_data, &revs->diffopt);
+ diff_tree_setup_paths(revs->prune_data.raw, &revs->diffopt);
}
if (revs->combine_merges)
revs->ignore_merges = 0;
diff --git a/revision.h b/revision.h
index 05659c6..82509dd 100644
--- a/revision.h
+++ b/revision.h
@@ -34,7 +34,7 @@ struct rev_info {
/* Basic information */
const char *prefix;
const char *def;
- void *prune_data;
+ struct pathspec prune_data;
unsigned int early_output;
/* Traversal flags */
diff --git a/wt-status.c b/wt-status.c
index 54b6b03..5c6b118 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -319,7 +319,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
}
rev.diffopt.format_callback = wt_status_collect_changed_cb;
rev.diffopt.format_callback_data = s;
- rev.prune_data = s->pathspec;
+ init_pathspec(&rev.prune_data, s->pathspec);
run_diff_files(&rev, 0);
}
@@ -344,7 +344,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)
rev.diffopt.detect_rename = 1;
rev.diffopt.rename_limit = 200;
rev.diffopt.break_opt = 0;
- rev.prune_data = s->pathspec;
+ init_pathspec(&rev.prune_data, s->pathspec);
run_diff_index(&rev, 1);
}
--
1.7.3.3.476.g10a82
^ permalink raw reply related
* conflict resolution of pd/bash-4-completion [Re: What's cooking in git.git (Dec 2010, #05; Thu, 16)]
From: SZEDER Gábor @ 2010-12-17 11:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vk4j8kfwy.fsf@alter.siamese.dyndns.org>
Hi,
On Thu, Dec 16, 2010 at 11:38:21PM -0800, Junio C Hamano wrote:
> * pd/bash-4-completion (2010-12-15) 3 commits
> - Merge branch 'master' (early part) into pd/bash-4-completion
> - bash: simple reimplementation of _get_comp_words_by_ref
> - bash: get --pretty=m<tab> completion to work with bash v4
>
> Updated by Jonathan; this still has some conflicts around "notes"
> completion I tried to resolve near the tip of 'pu'.
The resolution of that conflict is not quite correct. I'm not sure
how I should send a proper conflict resolution... but I'll try
anyway.
So the patch below applies to today's pu (i.e. db92f24) and fixes the
current merge conflict resolution in the completion function for 'git
notes'.
I also have a few comments to the patches in this topic, but it's
quite hard to find the time to think them through and sum them up
properly in this pre-Xmas frenzy...
Best,
Gábor
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index bd5b322..e0c40c3 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1707,20 +1707,15 @@ _git_notes ()
{
local subcommands='add append copy edit list prune remove show'
local subcommand="$(__git_find_on_cmdline "$subcommands")"
- local words cword
- _get_comp_words_by_ref -n =: words cword
- local cur=${words[cword-1]}
- if [ -z "$subcommand" ]; then
- __gitcomp "$subcommands"
- return
- fi
+ local cur words cword
+ _get_comp_words_by_ref -n =: cur words cword
case "$subcommand,$cur" in
,--*)
__gitcomp '--ref'
;;
,*)
- case "${COMP_WORDS[COMP_CWORD-1]}" in
+ case "${words[cword-1]}" in
--ref)
__gitcomp "$(__git_refs)"
;;
@@ -1748,7 +1743,7 @@ _git_notes ()
prune,*)
;;
*)
- case "${COMP_WORDS[COMP_CWORD-1]}" in
+ case "${words[cword-1]}" in
-m|-F)
;;
*)
--
1.7.3.4.547.g524288
^ permalink raw reply related
* Re: [PATCH 1/3] gitweb: add extensions to highlight feature
From: Jakub Narebski @ 2010-12-17 11:17 UTC (permalink / raw)
To: Sylvain Rabot; +Cc: git
In-Reply-To: <1292538804.2511.4.camel@kheops>
On Thu, 16 Dec 2010, Sylvain Rabot wrote:
> On Thu, 2010-12-16 at 14:22 -0800, Jakub Narebski wrote:
> > Sylvain Rabot <sylvain@abstraction.fr> writes:
> > > # alternate extensions, see /etc/highlight/filetypes.conf
> > > 'h' => 'c',
> > > + map { $_ => 'sh' } qw(bash zsh),
> >
> > Good idea.
>
> Does ksh, csh can be highlighted as sh too ?
My /etc/highlight/filetypes.conf does include only
$ext(sh)=bash
All of bash, zsh and ksh are POSIX shell (sh) compatibile, so sh syntax
(which is according to my /usr/share/highlight/langDefs/sh.lang file
"Bash script language definition file" ;-)) should work. csh IIRC isn't.
So therefore I am not sure if csh can be highlighted correctly using sh
syntax.
--
Jakub Narebski
Poland
^ permalink raw reply
* EGit for Mylyn 0.9.3: EGit integrated with the Mylyn task framework
From: Intland @ 2010-12-17 10:40 UTC (permalink / raw)
To: git
Hi all,
EGit for Mylyn is a custom fork of the original EGit project, to integrate EGit (the Git plugin for Eclipse) with Mylyn
(the task-focused framework).
Intland Software has created this fork to *enable associating Git changes with Mylyn tasks, and tracking these
associations*. However, it was primarily developed to satisfy Intland's own needs, the binaries and the source code is
freely available for downloading and cloning.
Highlights in this fork:
* "Open Corresponding Task" feature
* Commit messages are initialized with the IDs of the active Mylyn tasks
* EGit tightly integrated with the codeBeamer issue trackers
More details, download info, etc.: http://blogs.intland.com/main/entry/20101216
^ permalink raw reply
* Re: [PATCH 10/21] tree_entry_interesting(): fix depth limit with overlapping pathspecs
From: Nguyen Thai Ngoc Duy @ 2010-12-17 10:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmxo5l2g4.fsf@alter.siamese.dyndns.org>
2010/12/17 Junio C Hamano <gitster@pobox.com>:
> One thing I am not clear is what it means to limit the recursion level
> when you have wildcards.
Recursion level does not affect wildcards at all. That was original
design, a91f453 (grep: Add --max-depth option. - 2009-07-22). I think
current git-grep still follows that.
> [Footnote]
>
> *1* In addition, perhaps you may later want to introduce some "negative"
> match operators to pathspecs; while I am not particularly fond of that
> direction at this moment, I would like to leave the door open for that
> possibility, in case it turns out to be a good thing to have.
It's a essential thing for narrow clone, otherwise I can't widen a
narrow clone. But narrow clone must prove it's a good thing to have
first..
--
Duy
^ permalink raw reply
* Re: [PATCH 14/21] Convert ce_path_match() to use struct pathspec
From: Nguyen Thai Ngoc Duy @ 2010-12-17 9:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v39pxl10y.fsf@alter.siamese.dyndns.org>
2010/12/17 Junio C Hamano <gitster@pobox.com>:
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> diff --git a/diff-lib.c b/diff-lib.c
>> index 3b809f2..63db7f4 100644
>> --- a/diff-lib.c
>> +++ b/diff-lib.c
>> @@ -89,9 +89,11 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
>> int silent_on_removed = option & DIFF_SILENT_ON_REMOVED;
>> unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED)
>> ? CE_MATCH_RACY_IS_DIRTY : 0);
>> + struct pathspec pathspec;
>>
>> diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
>>
>> + init_pathspec(&pathspec, revs->prune_data);
>
> I wonder if it makes more sense to change the type of revs->prune_data
> from an array of pointers to strings to a pointer to struct pathspec.
> Is there a downside?
Converting a pointer to another pointer means mis typecasting can
happen and the compiler won't help catching them. I thinking of
changing prune_data to simply struct pathspec. Looks like it breaks
thing.. hm...
--
Duy
^ permalink raw reply
* Re: [PATCH 19/21] grep: use writable strbuf from caller in grep_tree()
From: Nguyen Thai Ngoc Duy @ 2010-12-17 9:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy67pjlvb.fsf@alter.siamese.dyndns.org>
2010/12/17 Junio C Hamano <gitster@pobox.com>:
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> + hit = grep_tree(opt, pathspec, &tree, &base, base.neglen);
>
> If you are going to let the users of strbuf API to refer directly to the
> field, I think "neglen" should be renamed to something more reasonable,
> say, "offset".
>
> I am still debating myself if this strbuf_offset is anugly hack merely to
> allow the implementation of "grep" not to carry one extra offset around
> throughout its callchain, or if it is generic enough that other/future
> callers would benefit from. I am leaning toward to think this is an ugly
> hack, as a new caller that wants to carry _two_ offsets into a strbuf
> wouldn't get much benefit from this new API. But I may be missreading
> your code.
>
I did not want to another offset to tree_entry_interesting. But an
extra argument would be less ugly than an extra API.
--
Duy
^ permalink raw reply
* What's cooking in git.git (Dec 2010, #05; Thu, 16)
From: Junio C Hamano @ 2010-12-17 7:38 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'. The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.
--------------------------------------------------
[New Topics]
* jn/maint-gitweb-pathinfo-fix (2010-12-14) 1 commit
(merged to 'next' on 2010-12-14 at 1af8cca)
+ gitweb: Fix handling of whitespace in generated links
* rj/maint-difftool-cygwin-workaround (2010-12-14) 1 commit
- difftool: Fix failure on Cygwin
* rj/maint-test-fixes (2010-12-14) 5 commits
- t9501-*.sh: Fix a test failure on Cygwin
- lib-git-svn.sh: Add check for mis-configured web server variables
- lib-git-svn.sh: Avoid setting web server variables unnecessarily
- t9142: Move call to start_httpd into the setup test
- t3600-rm.sh: Don't pass a non-existent prereq to test #15
* rj/test-fixes (2010-12-14) 4 commits
- t4135-*.sh: Skip the "backslash" tests on cygwin
- t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW
- t3032-*.sh: Pass the -b (--binary) option to sed on cygwin
- t6038-*.sh: Pass the -b (--binary) option to sed on cygwin
* tr/maint-branch-no-track-head (2010-12-14) 1 commit
- branch: do not attempt to track HEAD implicitly
Probably needs a re-roll to exclude either (1) any ref outside the
hierarchies for branches (i.e. refs/{heads,remotes}/), or (2) only refs
outside refs/ hierarchies (e.g. HEAD, ORIG_HEAD, ...). The latter feels
safer and saner.
* by/log-l (2010-12-14) 8 commits
. log -L: implement move/copy detection (-M/-C)
. log -L: add --full-line-diff option
. log -L: add --graph prefix before output
. log -L: support parent rewriting
. Implement line-history search (git log -L)
. Export rewrite_parents() for 'log -L'
. Export three functions from diff.c
. Refactor parse_loc
Seems to have some bad interactions with nd/struct-pathspec.
* hv/mingw-fs-funnies (2010-12-14) 5 commits
- mingw_rmdir: set errno=ENOTEMPTY when appropriate
- mingw: add fallback for rmdir in case directory is in use
- mingw: make failures to unlink or move raise a question
- mingw: work around irregular failures of unlink on windows
- mingw: move unlink wrapper to mingw.c
--------------------------------------------------
[Graduated to "master"]
* aa/status-hilite-branch (2010-12-09) 2 commits
(merged to 'next' on 2010-12-10 at d00551d)
+ default color.status.branch to "same as header"
(merged to 'next' on 2010-12-08 at 0291858)
+ status: show branchname with a configurable color
* ak/describe-exact (2010-12-09) 4 commits
(merged to 'next' on 2010-12-10 at 33497db)
+ describe: Delay looking up commits until searching for an inexact match
+ describe: Store commit_names in a hash table by commit SHA1
+ describe: Do not use a flex array in struct commit_name
+ describe: Use for_each_rawref
* jc/maint-no-openssl-build-fix (2010-12-08) 1 commit
(merged to 'next' on 2010-12-08 at e348a87)
+ Do not link with -lcrypto under NO_OPENSSL
* jc/maint-svn-info-test-fix (2010-12-06) 1 commit
(merged to 'next' on 2010-12-08 at f821694)
+ t9119: do not compare "Text Last Updated" line from "svn info"
* jl/fetch-submodule-recursive (2010-12-09) 4 commits
(merged to 'next' on 2010-12-10 at edd0bf0)
+ fetch_populated_submodules(): document dynamic allocation
(merged to 'next' on 2010-12-08 at 676c4f5)
+ Submodules: Add the "fetchRecurseSubmodules" config option
+ Add the 'fetch.recurseSubmodules' config setting
+ fetch/pull: Add the --recurse-submodules option
* jn/fast-import-blob-access (2010-12-13) 6 commits
(merged to 'next' on 2010-12-12 at 7dc56dd)
+ t9300: avoid short reads from dd
(merged to 'next' on 2010-12-08 at a42f0b3)
+ t9300: remove unnecessary use of /dev/stdin
+ fast-import: Allow cat-blob requests at arbitrary points in stream
+ fast-import: let importers retrieve blobs
+ fast-import: clarify documentation of "feature" command
+ fast-import: stricter parsing of integer options
* jn/fast-import-ondemand-checkpoint (2010-11-22) 1 commit
(merged to 'next' on 2010-12-08 at f538396)
+ fast-import: treat SIGUSR1 as a request to access objects early
* jn/maint-fast-import-object-reuse (2010-11-23) 1 commit
(merged to 'next' on 2010-12-08 at 5d29c08)
+ fast-import: insert new object entries at start of hash bucket
* jn/maint-svn-fe (2010-12-08) 4 commits
(merged to 'next' on 2010-12-09 at 98beb7c)
+ t9010 fails when no svn is available
(merged to 'next' on 2010-12-08 at e25350b)
+ vcs-svn: fix intermittent repo_tree corruption
+ treap: make treap_insert return inserted node
+ t9010 (svn-fe): Eliminate dependency on svn perl bindings
* jn/submodule-b-current (2010-12-05) 2 commits
(merged to 'next' on 2010-12-08 at 33423f3)
+ git submodule: Remove now obsolete tests before cloning a repo
+ git submodule -b ... of current HEAD fails
* kb/diff-C-M-synonym (2010-11-10) 2 commits
(merged to 'next' on 2010-12-13 at 13fdbdd)
+ diff: use "find" instead of "detect" as prefix for long forms of -M and -C
+ diff: add --detect-copies-harder as a synonym for --find-copies-harder
* nd/extended-sha1-relpath (2010-12-09) 3 commits
(merged to 'next' on 2010-12-10 at 0018aa6)
+ get_sha1: teach ":$n:<path>" the same relative path logic
(merged to 'next' on 2010-12-08 at 940e5e2)
+ get_sha1: support relative path ":path" syntax
+ Make prefix_path() return char* without const
* nd/maint-relative (2010-11-20) 1 commit
(merged to 'next' on 2010-12-10 at 018bc80)
+ get_cwd_relative(): do not misinterpret root path
* rj/msvc-fix (2010-12-04) 4 commits
(merged to 'next' on 2010-12-10 at 7a2c2c6)
+ msvc: Fix macro redefinition warnings
+ msvc: Fix build by adding missing INTMAX_MAX define
+ msvc: git-daemon.exe: Fix linker "unresolved externals" error
+ msvc: Fix compilation errors in compat/win32/sys/poll.c
--------------------------------------------------
[Stalled]
* nd/index-doc (2010-09-06) 1 commit
- doc: technical details about the index file format
Half-written but it is a good start. I may need to give some help in
describing more recent index extensions.
* cb/ignored-paths-are-precious (2010-08-21) 1 commit
- checkout/merge: optionally fail operation when ignored files need to be overwritten
This needs tests; also we know of longstanding bugs in related area that
needs to be addressed---they do not have to be part of this series but
their reproduction recipe would belong to the test script for this topic.
It would hurt users to make the new feature on by default, especially the
ones with subdirectories that come and go.
* jk/tag-contains (2010-07-05) 4 commits
- Why is "git tag --contains" so slow?
- default core.clockskew variable to one day
- limit "contains" traversals based on commit timestamp
- tag: speed up --contains calculation
The idea of the bottom one is probably Ok, except that the use of object
flags needs to be rethought, or at least the helper needs to be moved to
builtin/tag.c to make it clear that it should not be used outside the
current usage context.
* tr/config-doc (2010-10-24) 2 commits
. Documentation: complete config list from other manpages
. Documentation: Move variables from config.txt to separate file
This unfortunately heavily conflicts with patches in flight...
--------------------------------------------------
[Cooking]
* nd/oneline-sha1-name-from-specific-ref (2010-12-13) 3 commits
- get_sha1: support $commit^{/regex} syntax
- get_sha1_oneline: make callers prepare the commit list to traverse
- get_sha1_oneline: fix lifespan rule of temp_commit_buffer variable
This should be more or less ready for 'next'.
* mg/cvsimport (2010-11-28) 3 commits
- cvsimport.txt: document the mapping between config and options
- cvsimport: fix the parsing of uppercase config options
- cvsimport: partial whitespace cleanup
I was being lazy and said "Ok" to "cvsimport.capital-r" but luckily other
people injected sanity to the discussion. Weatherbaloon patch sent, but
not queued here.
* tf/commit-list-prefix (2010-11-26) 1 commit
- commit: Add commit_list prefix in two function names.
This churn already introduced an unnecessary conflict. It is not by
itself a biggie, but these things tend to add up.
* pd/bash-4-completion (2010-12-15) 3 commits
- Merge branch 'master' (early part) into pd/bash-4-completion
- bash: simple reimplementation of _get_comp_words_by_ref
- bash: get --pretty=m<tab> completion to work with bash v4
Updated by Jonathan; this still has some conflicts around "notes"
completion I tried to resolve near the tip of 'pu'.
* jn/svn-fe (2010-12-06) 18 commits
- vcs-svn: Allow change nodes for root of tree (/)
- vcs-svn: Implement Prop-delta handling
- vcs-svn: Sharpen parsing of property lines
- vcs-svn: Split off function for handling of individual properties
- vcs-svn: Make source easier to read on small screens
- vcs-svn: More dump format sanity checks
- vcs-svn: Reject path nodes without Node-action
- vcs-svn: Delay read of per-path properties
- vcs-svn: Combine repo_replace and repo_modify functions
- vcs-svn: Replace = Delete + Add
- vcs-svn: handle_node: Handle deletion case early
- vcs-svn: Use mark to indicate nodes with included text
- vcs-svn: Unclutter handle_node by introducing have_props var
- vcs-svn: Eliminate node_ctx.mark global
- vcs-svn: Eliminate node_ctx.srcRev global
- vcs-svn: Check for errors from open()
- vcs-svn: Allow simple v3 dumps (no deltas yet)
- vcs-svn: Error out for v3 dumps
Some RFC patches, to give them early and wider exposure.
* nd/maint-fix-add-typo-detection (2010-11-27) 5 commits
- Revert "excluded_1(): support exclude files in index"
- unpack-trees: fix sparse checkout's "unable to match directories"
- unpack-trees: move all skip-worktree checks back to unpack_trees()
- dir.c: add free_excludes()
- cache.h: realign and use (1 << x) form for CE_* constants
* jh/gitweb-caching (2010-12-03) 4 commits
. gitweb: Minimal testing of gitweb caching
. gitweb: File based caching layer (from git.kernel.org)
. gitweb: add output buffering and associated functions
. gitweb: Prepare for splitting gitweb
Previous iteration; dropped.
* jh/gitweb-caching-8 (2010-12-09) 18 commits
. gitweb: Add better error handling for gitweb caching
. gitweb: Prepare for cached error pages & better error page handling
. gitweb: When changing output (STDOUT) change STDERR as well
. gitweb: Add show_warning() to display an immediate warning, with refresh
. gitweb: add print_transient_header() function for central header printing
. gitweb: Add commented url & url hash to page footer
. gitweb: Change file handles (in caching) to lexical variables as opposed to globs
. gitweb: add isDumbClient() check
. gitweb: Adding isBinaryAction() and isFeedAction() to determine the action type
. gitweb: Revert reset_output() back to original code
. gitweb: Change is_cacheable() to return true always
. gitweb: Revert back to $cache_enable vs. $caching_enabled
. gitweb: Add more explicit means of disabling 'Generating...' page
. gitweb: Regression fix concerning binary output of files
. gitweb: Minimal testing of gitweb caching
. gitweb: File based caching layer (from git.kernel.org)
. gitweb: add output buffering and associated functions
. gitweb: Prepare for splitting gitweb
It appears that John and Jakub are finally working together to help
producing something that we can ship in-tree, finally. I am looking
forward to seeing the conclusion of the discussion.
* nd/setup (2010-11-26) 47 commits
- git.txt: correct where --work-tree path is relative to
- Revert "Documentation: always respect core.worktree if set"
- t0001: test git init when run via an alias
- Remove all logic from get_git_work_tree()
- setup: rework setup_explicit_git_dir()
- setup: clean up setup_discovered_git_dir()
- t1020-subdirectory: test alias expansion in a subdirectory
- setup: clean up setup_bare_git_dir()
- setup: limit get_git_work_tree()'s to explicit setup case only
- Use git_config_early() instead of git_config() during repo setup
- Add git_config_early()
- rev-parse: prints --git-dir relative to user's cwd
- git-rev-parse.txt: clarify --git-dir
- t1510: setup case #31
- t1510: setup case #30
- t1510: setup case #29
- t1510: setup case #28
- t1510: setup case #27
- t1510: setup case #26
- t1510: setup case #25
- t1510: setup case #24
- t1510: setup case #23
- t1510: setup case #22
- t1510: setup case #21
- t1510: setup case #20
- t1510: setup case #19
- t1510: setup case #18
- t1510: setup case #17
- t1510: setup case #16
- t1510: setup case #15
- t1510: setup case #14
- t1510: setup case #13
- t1510: setup case #12
- t1510: setup case #11
- t1510: setup case #10
- t1510: setup case #9
- t1510: setup case #8
- t1510: setup case #7
- t1510: setup case #6
- t1510: setup case #5
- t1510: setup case #4
- t1510: setup case #3
- t1510: setup case #2
- t1510: setup case #1
- t1510: setup case #0
- Add t1510 and basic rules that run repo setup
- builtins: print setup info if repo is found
Need to re-read this series to move it forward.
* yd/dir-rename (2010-10-29) 5 commits
- Allow hiding renames of individual files involved in a directory rename.
- Unified diff output format for bulk moves.
- Add testcases for the --detect-bulk-moves diffcore flag.
- Raw diff output format for bulk moves.
- Introduce bulk-move detection in diffcore.
Need to re-queue the reroll.
* nd/struct-pathspec (2010-12-15) 21 commits
- t7810: overlapping pathspecs and depth limit
- grep: drop pathspec_matches() in favor of tree_entry_interesting()
- grep: use writable strbuf from caller in grep_tree()
- strbuf: allow "buf" to point to the middle of the allocated buffer
- grep: use match_pathspec_depth() for cache/worktree grepping
- grep: convert to use struct pathspec
- Convert ce_path_match() to use match_pathspec_depth()
- Convert ce_path_match() to use struct pathspec
- pathspec: add match_pathspec_depth()
- tree_entry_interesting(): optimize wildcard matching when base is matched
- tree_entry_interesting(): support wildcard matching
- tree_entry_interesting(): fix depth limit with overlapping pathspecs
- tree_entry_interesting(): support depth limit
- tree_entry_interesting(): refactor into separate smaller functions
- diff-tree: convert base+baselen to writable strbuf
- glossary: define pathspec
- Move tree_entry_interesting() to tree-walk.c and export it
- tree_entry_interesting(): remove dependency on struct diff_options
- Convert struct diff_options to use struct pathspec
- diff-no-index: use diff_tree_setup_paths()
- Add struct pathspec
(this branch is used by en/object-list-with-pathspec.)
Rerolled again. Getting nicer by the round ;-)
* en/object-list-with-pathspec (2010-09-20) 2 commits
- Add testcases showing how pathspecs are handled with rev-list --objects
- Make rev-list --objects work together with pathspecs
(this branch uses nd/struct-pathspec.)
* tr/merge-unborn-clobber (2010-08-22) 1 commit
- Exhibit merge bug that clobbers index&WT
* ab/i18n (2010-10-07) 161 commits
- po/de.po: complete German translation
- po/sv.po: add Swedish translation
- gettextize: git-bisect bisect_next_check "You need to" message
- gettextize: git-bisect [Y/n] messages
- gettextize: git-bisect bisect_replay + $1 messages
- gettextize: git-bisect bisect_reset + $1 messages
- gettextize: git-bisect bisect_run + $@ messages
- gettextize: git-bisect die + eval_gettext messages
- gettextize: git-bisect die + gettext messages
- gettextize: git-bisect echo + eval_gettext message
- gettextize: git-bisect echo + gettext messages
- gettextize: git-bisect gettext + echo message
- gettextize: git-bisect add git-sh-i18n
- gettextize: git-stash drop_stash say/die messages
- gettextize: git-stash "unknown option" message
- gettextize: git-stash die + eval_gettext $1 messages
- gettextize: git-stash die + eval_gettext $* messages
- gettextize: git-stash die + eval_gettext messages
- gettextize: git-stash die + gettext messages
- gettextize: git-stash say + gettext messages
- gettextize: git-stash echo + gettext message
- gettextize: git-stash add git-sh-i18n
- gettextize: git-submodule "blob" and "submodule" messages
- gettextize: git-submodule "path not initialized" message
- gettextize: git-submodule "[...] path is ignored" message
- gettextize: git-submodule "Entering [...]" message
- gettextize: git-submodule $errmsg messages
- gettextize: git-submodule "Submodule change[...]" messages
- gettextize: git-submodule "cached cannot be used" message
- gettextize: git-submodule $update_module say + die messages
- gettextize: git-submodule die + eval_gettext messages
- gettextize: git-submodule say + eval_gettext messages
- gettextize: git-submodule echo + eval_gettext messages
- gettextize: git-submodule add git-sh-i18n
- gettextize: git-pull "rebase against" / "merge with" messages
- gettextize: git-pull "[...] not currently on a branch" message
- gettextize: git-pull "You asked to pull" message
- gettextize: git-pull split up "no candidate" message
- gettextize: git-pull eval_gettext + warning message
- gettextize: git-pull eval_gettext + die message
- gettextize: git-pull die messages
- gettextize: git-pull add git-sh-i18n
- gettext docs: add "Testing marked strings" section to po/README
- gettext docs: the Git::I18N Perl interface
- gettext docs: the git-sh-i18n.sh Shell interface
- gettext docs: the gettext.h C interface
- gettext docs: add "Marking strings for translation" section in po/README
- gettext docs: add a "Testing your changes" section to po/README
- po/pl.po: add Polish translation
- po/hi.po: add Hindi Translation
- po/en_GB.po: add British English translation
- po/de.po: add German translation
- Makefile: only add gettext tests on XGETTEXT_INCLUDE_TESTS=YesPlease
- gettext docs: add po/README file documenting Git's gettext
- gettextize: git-am printf(1) message to eval_gettext
- gettextize: git-am core say messages
- gettextize: git-am "Apply?" message
- gettextize: git-am clean_abort messages
- gettextize: git-am cannot_fallback messages
- gettextize: git-am die messages
- gettextize: git-am eval_gettext messages
- gettextize: git-am multi-line getttext $msg; echo
- gettextize: git-am one-line gettext $msg; echo
- gettextize: git-am add git-sh-i18n
- gettext tests: add GETTEXT_POISON tests for shell scripts
- gettext tests: add GETTEXT_POISON support for shell scripts
- Makefile: MSGFMT="msgfmt --check" under GNU_GETTEXT
- Makefile: add GNU_GETTEXT, set when we expect GNU gettext
- gettextize: git-shortlog basic messages
- gettextize: git-revert split up "could not revert/apply" message
- gettextize: git-revert literal "me" messages
- gettextize: git-revert "Your local changes" message
- gettextize: git-revert basic messages
- gettextize: git-notes "Refusing to %s notes in %s" message
- gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
- gettextize: git-notes basic commands
- gettextize: git-gc "Auto packing the repository" message
- gettextize: git-gc basic messages
- gettextize: git-describe basic messages
- gettextize: git-clean clean.requireForce messages
- gettextize: git-clean basic messages
- gettextize: git-bundle basic messages
- gettextize: git-archive basic messages
- gettextize: git-status "renamed: " message
- gettextize: git-status "Initial commit" message
- gettextize: git-status "Changes to be committed" message
- gettextize: git-status shortstatus messages
- gettextize: git-status "nothing to commit" messages
- gettextize: git-status basic messages
- gettextize: git-push "prevent you from losing" message
- gettextize: git-push basic messages
- gettextize: git-tag tag_template message
- gettextize: git-tag basic messages
- gettextize: git-reset "Unstaged changes after reset" message
- gettextize: git-reset reset_type_names messages
- gettextize: git-reset basic messages
- gettextize: git-rm basic messages
- gettextize: git-mv "bad" messages
- gettextize: git-mv basic messages
- gettextize: git-merge "Wonderful" message
- gettextize: git-merge "You have not concluded your merge" messages
- gettextize: git-merge "Updating %s..%s" message
- gettextize: git-merge basic messages
- gettextize: git-log "--OPT does not make sense" messages
- gettextize: git-log basic messages
- gettextize: git-grep "--open-files-in-pager" message
- gettextize: git-grep basic messages
- gettextize: git-fetch split up "(non-fast-forward)" message
- gettextize: git-fetch update_local_ref messages
- gettextize: git-fetch formatting messages
- gettextize: git-fetch basic messages
- gettextize: git-diff basic messages
- gettextize: git-commit advice messages
- gettextize: git-commit "enter the commit message" message
- gettextize: git-commit print_summary messages
- gettextize: git-commit formatting messages
- gettextize: git-commit "middle of a merge" message
- gettextize: git-commit basic messages
- gettextize: git-checkout "Switched to a .. branch" message
- gettextize: git-checkout "HEAD is now at" message
- gettextize: git-checkout describe_detached_head messages
- gettextize: git-checkout: our/their version message
- gettextize: git-checkout basic messages
- gettextize: git-branch "(no branch)" message
- gettextize: git-branch "git branch -v" messages
- gettextize: git-branch "Deleted branch [...]" message
- gettextize: git-branch "remote branch '%s' not found" message
- gettextize: git-branch basic messages
- gettextize: git-add refresh_index message
- gettextize: git-add "remove '%s'" message
- gettextize: git-add "pathspec [...] did not match" message
- gettextize: git-add "Use -f if you really want" message
- gettextize: git-add "no files added" message
- gettextize: git-add basic messages
- gettextize: git-clone "Cloning into" message
- gettextize: git-clone basic messages
- gettext tests: test message re-encoding under C
- po/is.po: add Icelandic translation
- gettext tests: mark a test message as not needing translation
- gettext tests: test re-encoding with a UTF-8 msgid under Shell
- gettext tests: test message re-encoding under Shell
- gettext tests: add detection for is_IS.ISO-8859-1 locale
- gettext tests: test if $VERSION exists before using it
- gettextize: git-init "Initialized [...] repository" message
- gettextize: git-init basic messages
- gettext tests: skip lib-gettext.sh tests under GETTEXT_POISON
- gettext tests: add GETTEXT_POISON=YesPlease Makefile parameter
- gettext.c: use libcharset.h instead of langinfo.h when available
- gettext.c: work around us not using setlocale(LC_CTYPE, "")
- builtin.h: Include gettext.h
- Makefile: use variables and shorter lines for xgettext
- Makefile: tell xgettext(1) that our source is in UTF-8
- Makefile: provide a --msgid-bugs-address to xgettext(1)
- Makefile: A variable for options used by xgettext(1) calls
- gettext tests: locate i18n lib&data correctly under --valgrind
- gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions
- gettext tests: rename test to work around GNU gettext bug
- gettext: add infrastructure for translating Git with gettext
- builtin: use builtin.h for all builtin commands
- tests: use test_cmp instead of piping to diff(1)
- t7004-tag.sh: re-arrange git tag comment for clarity
It is getting ridiculously painful to keep re-resolving the conflicts with
other topics in flight, even with the help with rerere.
Needs a bit more minor work to get the basic code structure right.
^ permalink raw reply
* Re: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin
From: Johannes Sixt @ 2010-12-17 7:34 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Eric Sunshine, Junio C Hamano, GIT Mailing-list, Pat Thoyts
In-Reply-To: <4D0A8250.5090403@ramsay1.demon.co.uk>
Am 12/16/2010 22:19, schrieb Ramsay Jones:
> Eric Sunshine wrote:
>> Your tool versions may indeed not be compatible with those of the
>> netinstall environment [3]:
>>
>> $ sed --version
>> GNU sed version 4.2.1
>>
>> Unfortunately, the old --nocr is not recognized by modern GNU sed:
>>
>> $ sed --nocr
>> sed: unrecognized option `--nocr'
>
> Yes. Like Johannes, I have sed version 3.02 on MinGW, but on cygwin
> I have sed version 4.1.5. See patch #14, where I introduce the
> SED_BIN_OPT variable to allow me to run the tests with SED_OPTIONS
> set to -c instead of -b.
>
> [I thought I was unusual in having such an old sed version, but
> apparently not... ;-) ]
As far as I'm concerned, I'm not married to this old version, and I'll
update to a recent msysgit/MinGW environment RSN. So, in the long run,
your setup might turn out to be unusal ;-)
-- Hannes
^ permalink raw reply
* Re: [ANNOUNCE] Git 1.7.3.4, 1.6.6.3 and others
From: Junio C Hamano @ 2010-12-17 7:23 UTC (permalink / raw)
To: git
In-Reply-To: <7v8vzqntl0.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> The Gitweb fix has also been backported to maintenance tracks of other
> earlier releases (1.7.2.5, 1.7.1.4, 1.7.0.9, 1.6.5.9, and 1.6.4.5) and are
> available from the main repository and shortly will be available from its
> mirrors:
>
> git://git.kernel.org/pub/scm/git/git.git/
> git://repo.or.cz/alt-git.git/
> git://git-core.git.sourceforge.net/gitroot/git-core/git-core/
> git://github.com/git/git.git/
I generated tarballs and rpm binary packages for these stale-maintenance
releases tonight. This is just to be thorough; I would not recommend
anybody to use 1.6.X series in 2011 when 1.7.4 series is just around the
corner ;-)
^ permalink raw reply
* Re: [PATCH] branch: do not attempt to track HEAD implicitly
From: Junio C Hamano @ 2010-12-17 5:55 UTC (permalink / raw)
To: Thomas Rast; +Cc: Martin von Zweigbergk, git
In-Reply-To: <201012151626.35366.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> Martin von Zweigbergk wrote:
>> On Tue, Dec 14, 2010 at 1:38 PM, Thomas Rast <trast@student.ethz.ch> wrote:
>> > Silently drop the HEAD candidate in the implicit (i.e. without -t
>> > flag) case, so that the branch starts out without an upstream.
>>
>> Thanks. This has been on my todo list for a while.
>>
>> Should it only check for HEAD? How about ORIG_HEAD and FETCH_HEAD?
>> Simply anything outside of refs/ maybe? Would that make sense?
I was tempted to say "limit to refs/heads/ and refs/remotes/" but perhaps
people have custom namespaces defined in refs/ hierarchy and for some of
them the tracking may make sense. How about ignoring the implicit track
if the ref does not begin with refs/ to cover the obvious ones like HEAD,
FETCH_HEAD, etc.?
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Elijah Newren @ 2010-12-17 5:39 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Ken Brownfield, git, David Barr, skimo, Eric Raymond
In-Reply-To: <20101217030855.GB7003@burratino>
On Thu, Dec 16, 2010 at 8:08 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Ken Brownfield wrote:
>
>> I had considered this approach (and the one mentioned by Jonathan)
>> but there are no git tools to actually perform the filter I wanted
>> on the export in this form.
>
> Keep in mind that the two suggestions were subtly different from one
> another.
>
> For the "filter fast-import stream" technique, apparently there is a
> tool called reposurgeon[1] to do that. git_fast_filter[2] has the
> same purpose, too, if I remember correctly.
Yes, git_fast_filter was written precisely because git-filter-branch
took waaaaaay too long. IIRC, git-filter-branch would have taken
about 2-3 months for our use case (there's no way we could have shut
down the repositories for that long), whereas git_fast_filter (serving
along with fast-export and fast-import) allowed us to drop that to
about an hour (we couldn't use --index-filter with filter-branch as we
needed to do a number of operations on the actual file contents as
well).
All git_fast_filter really does is parse the fast-export output into
some basic python data structures, making it easy for you to modify
those structures as necessary (assuming basic python skills, though if
you only need to do what one of the examples shows then you could even
get away without that), and then pipes the results back out in the
format fast-import expects. It has a few examples with it; removing
existing files is one of the simple examples.
I haven't really bothered keeping the public repository up-to-date
since there hasn't been any prior external interest in it, but we
haven't modified it much internally either, and most of those
modifications are likely for niche stuff that you wouldn't need.
Elijah
^ permalink raw reply
* Re: how to recover a repository
From: Jonathan Nieder @ 2010-12-17 4:45 UTC (permalink / raw)
To: david; +Cc: git
In-Reply-To: <alpine.DEB.2.00.1012162024020.22269@asgard.lang.hm>
Hi David,
david@lang.hm wrote:
> I managed to do a 'rm *' in the .git directory (the usual sort of
> fat-fingering when cleaning up after another mistake)
>
> the subdirectories are still there.
I'd suggest:
1. Make a backup!
2. From the worktree (i.e. parent to the .git directory),
run "git init".
3. git update-ref HEAD refs/heads/(branch you were on)
4. git reset; # (alas, the old index file is gone)
5. git diff; gitk --all
See gitrepository-layout(7) for details.
^ permalink raw reply
* how to recover a repository
From: david @ 2010-12-17 4:28 UTC (permalink / raw)
To: git
I managed to do a 'rm *' in the .git directory (the usual sort of
fat-fingering when cleaning up after another mistake)
the subdirectories are still there.
this is just a local repository, it won't kill me if I loose everything
(as I still have the most recent working files), but I'd like to recover
what I can.
what can I do to get things back in a usable state?
David Lang
^ permalink raw reply
* Re: 1.7.3.4 build regression
From: Jonathan Nieder @ 2010-12-17 4:17 UTC (permalink / raw)
To: Jeremy Huddleston; +Cc: git, Ævar Arnfjörð Bjarmason
In-Reply-To: <21774743-8BA8-4A1C-BDCF-1E3F7D85EFB5@apple.com>
Jeremy Huddleston wrote:
> On Dec 16, 2010, at 19:41, Jonathan Nieder wrote:
>> Jeremy Huddleston wrote:
>>> make
>>> (strip the built executables)
>>> make install
>>>
>>> During 'make install', the executables get remade even though they
>>> shouldn't be.
>>
>> Just a wild guess: do you pass CC on the "make" and not the "make
>> install" command line?
>
> Yes. Good guess. Why would that be affecting it?
See v1.7.3.3~28^2 (Makefile: add CC to TRACK_CFLAGS, 2010-09-12),
found with "git log --no-merges v1.7.3.2..v1.7.3.4 -- Makefile".
That is, now CC is tracked like $prefix and $CFLAGS are.
The idea of that change was presumably that if you switch CC from,
say, "gcc -m32" to "gcc -m64", then the build result will not be
correct unless you remake things. I have mixed feelings about it,
since from time to time I might want to switch between gcc-4.4 and
gcc-4.5 without rebuilding everything.
> "make" line is:
> /Developer/usr/bin/make -C /tmp/Git-16.roots/Git-16~obj/i386/ \
> -j`sysctl -n hw.activecpu` \
> prefix=/usr NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease \
> RUNTIME_PREFIX=YesPlease \
> GITGUI_VERSION=0.12.0 V=1 \
> CFLAGS='-ggdb3 -Os -pipe -Wall -Wformat-security -D_FORTIFY_SOURCE=2' \
> 'CC=cc -arch i386' 'uname_M=i386' 'uname_P=i386'
Interesting. It might be convenient to save these variables in
/tmp/Git-16.roots/Git-16~obj/i386/config.mak.
Thanks for reporting. Some thinking to do.
^ permalink raw reply
* Re: 1.7.3.4 build regression
From: Jeremy Huddleston @ 2010-12-17 4:02 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git
In-Reply-To: <20101217034123.GA7362@burratino>
On Dec 16, 2010, at 19:41, Jonathan Nieder wrote:
> Hi Jeremy,
>
> Jeremy Huddleston wrote:
>
>> 1.7.3.4 seems to have a regression (over 1.7.3.2 ... didn't try 1.7.3.3)
>> building. I do:
>>
>> make
>> (strip the built executables)
>> make install
>>
>> During 'make install', the executables get remade even though they
>> shouldn't be.
>
> Just a wild guess: do you pass CC on the "make" and not the "make
> install" command line?
Yes. Good guess. Why would that be affecting it?
Some updates:
It occurs with 1.7.3.3 as well.
"make" line is:
/Developer/usr/bin/make -C /tmp/Git-16.roots/Git-16~obj/i386/ -j`sysctl -n hw.activecpu` prefix=/usr NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease RUNTIME_PREFIX=YesPlease GITGUI_VERSION=0.12.0 V=1 CFLAGS='-ggdb3 -Os -pipe -Wall -Wformat-security -D_FORTIFY_SOURCE=2' 'CC=cc -arch i386' 'uname_M=i386' 'uname_P=i386' && touch /tmp/Git-16.roots/Git-16~obj/i386/build.timestamp
"make install" line is:
/Developer/usr/bin/make -C /tmp/Git-16.roots/Git-16~obj/i386 -j`sysctl -n hw.activecpu` prefix=/usr NO_FINK=YesPlease NO_DARWIN_PORTS=YesPlease RUNTIME_PREFIX=YesPlease GITGUI_VERSION=0.12.0 V=1 CFLAGS='-ggdb3 -Os -pipe -Wall -Wformat-security -D_FORTIFY_SOURCE=2' \ 'DESTDIR=/tmp/Git-16.roots/Git-16~dst' \
install
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Jonathan Nieder @ 2010-12-17 3:37 UTC (permalink / raw)
To: Ken Brownfield; +Cc: git, David Barr, Thomas Rast, Jakub Narebski
In-Reply-To: <20101217032232.GC7003@burratino>
Jonathan Nieder wrote:
> Ken Brownfield wrote:
>> The thread titled "git and larger trees, not so fast?".
>
> Here it is[1]. Sorry to say, the improvements discussed there
> were made right away and indeed had a dramatic effect.
Of course I missed your point. :)
filter-branch --index-filter works a little like this: for
each commit:
. find the underlying tree
. read-tree: unpack that tree and all of its subtrees into
the index file. That is, convert from a recursive structure
/:
COPYING
Documentation/
INSTALL
Makefile
...
Documentation/:
CodingGuidelines
Makefile
...
into a flat structure
COPYING
Documentation/CodingGuideLines
Documentation/Makefile
Documentation/RelNotes/1.5.0.txt
...
. rm: find entries matching certain patterns and remove them
from the index file. This takes two passes through the index:
first to find matching entries, second to write the result to
disk.
. write-tree: write new trees for the object store. That is,
convert from a flat structure back to a recursive structure.
This is convenient, but it does not sound to me like the most
efficient way to eliminate a few subtrees from each commit. That is
why I was suggesting a method that avoids unpacking some trees
altogether.
That said, speedups for read-tree, rm, and write-tree would certainly
be nice to have. One project of interest to some people is to give
the index file a recursive structure, so finding the entries to remove
in the "git rm" example could be faster.
^ permalink raw reply
* 1.7.3.4 build regression
From: Jeremy Huddleston @ 2010-12-17 3:31 UTC (permalink / raw)
To: git
1.7.3.4 seems to have a regression (over 1.7.3.2 ... didn't try 1.7.3.3) building. I do:
make
(strip the built executables)
make install
During 'make install', the executables get remade even though they shouldn't be. My guess is that a Makefile dependency cycle has been added, but I haven't looked into it in detail yet. Is this a known issue?
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Jonathan Nieder @ 2010-12-17 3:22 UTC (permalink / raw)
To: Ken Brownfield; +Cc: git, David Barr, Thomas Rast, Jakub Narebski
In-Reply-To: <1FBB24BF-6517-4906-99D5-A5DDBEA14D6D@irridia.com>
Ken Brownfield wrote:
> The thread titled "git and larger trees, not so fast?".
Here it is[1]. Sorry to say, the improvements discussed there
were made right away and indeed had a dramatic effect.
Jonathan
[1] http://thread.gmane.org/gmane.comp.version-control.git/55458/focus=55643
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Jonathan Nieder @ 2010-12-17 3:08 UTC (permalink / raw)
To: Ken Brownfield; +Cc: git, David Barr, Elijah Newren, skimo, Eric Raymond
In-Reply-To: <9A686258-A504-4CBB-9993-048B45B5EE6A@irridia.com>
Ken Brownfield wrote:
> I had considered this approach (and the one mentioned by Jonathan)
> but there are no git tools to actually perform the filter I wanted
> on the export in this form.
Keep in mind that the two suggestions were subtly different from one
another.
For the "filter fast-import stream" technique, apparently there is a
tool called reposurgeon[1] to do that. git_fast_filter[2] has the
same purpose, too, if I remember correctly.
For the unpack-trees avoidance technique, true, the only example I
know if is the one I mentioned[3]. The idea would be to sort the
commits you want in topological order and replay them, for each one
going like so:
M 040000 <old tree id> ""
D bad/directory/one
D bad/directory/two
using fast-import from git.git master. (Older versions of fast-import
do not properly handle replacing the root directory, so if that sort
of compatibility is important, you'd have to use a directory listing
and fill in all the _good_ directories instead.)
I'd be glad to look at any work in this direction. Something like it
would be useful for postprocessing when importing from svn repos.
Thanks,
Jonathan
[1] http://esr.ibiblio.org/?p=2718
[2] http://thread.gmane.org/gmane.comp.version-control.git/116028
and links therein
[3] http://thread.gmane.org/gmane.comp.version-control.git/158375
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Jakub Narebski @ 2010-12-17 2:51 UTC (permalink / raw)
To: Ken Brownfield; +Cc: git, Jakub Narebski
In-Reply-To: <9A686258-A504-4CBB-9993-048B45B5EE6A@irridia.com>
Please do not toppost.
Ken Brownfield <krb@irridia.com> writes:
> I had considered this approach (and the one mentioned by Jonathan)
> but there are no git tools to actually perform the filter I wanted
> on the export in this form. I could (and will) parse fast-export
> and make an attempt a filtering files/directories... my concern is
> that I won't do it right, and will introduce subtle corruption. But
> if there's no existing tool, I'll take a crack at it. :-)
You can try ESR's reposurgeon:
http://www.catb.org/~esr/reposurgeon/
It's limitation is that it loads structure of DAG of revisions (but
not blobs i.e. contents of file) to memory. IIRC. It is not
streaming, but "DOM" based, otherwise some commands would not work.
By the way, git-filter-branch documentation recomments to use
index-filter with git-update-index instead of tree-filter with git-rm,
and if tree-filter is needed, to use some fast filesystem, e.g. RAM
one.
But probably you know all that.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Ken Brownfield @ 2010-12-17 2:36 UTC (permalink / raw)
To: git
In-Reply-To: <201012170254.13005.trast@student.ethz.ch>
I had considered this approach (and the one mentioned by Jonathan) but there are no git tools to actually perform the filter I wanted on the export in this form. I could (and will) parse fast-export and make an attempt a filtering files/directories... my concern is that I won't do it right, and will introduce subtle corruption. But if there's no existing tool, I'll take a crack at it. :-)
Thanks for your suggestions so far,
Ken
PS: This was my exact first thought, since I was previously used to performing "svnadmin dump/svndumpfilter/svnadmin load" on this repository when it was in SVN.
On Dec 16, 2010, at 5:54 PM, Thomas Rast wrote:
> Ken Brownfield wrote:
>> git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch -- bigdirtree stuff/a stuff/b stuff/c stuff/dir/{a,b,c}' --prune-empty --tag-name-filter cat -- --all
> [...]
>> Now that the same repository has grown, this same filter-branch
>> process now takes 6.5 *days* at 100% CPU on the same machine (2x4
>> Xeon, x86_64) on git-1.7.3.2. There's no I/O, memory, or other
>> resource contention.
>
> If all you do is an index-filter for deletion, I think it should be
> rather easy to achieve good results by filtering the fast-export
> stream to remove these files, and then piping that back to
> fast-import.
>
> (It's just that AFAIK nobody has written that code yet.)
>
> --
> Thomas Rast
> trast@{inf,student}.ethz.ch
^ permalink raw reply
* Re: Performance issue exposed by git-filter-branch
From: Ken Brownfield @ 2010-12-17 2:31 UTC (permalink / raw)
To: git; +Cc: David Barr
In-Reply-To: <20101217014539.GA6775@burratino>
The thread titled "git and larger trees, not so fast?". Some of the history is lost, but here's the earliest post I can find:
http://lists-archives.org/git/627040-git-and-larger-trees-not-so-fast.html
On GMANE:
http://article.gmane.org/gmane.comp.version-control.git/55460/match=git+larger+trees+not+so+fast
But I can't figure out how to show the whole thread.
Sorry, that paragraph of my email disappeared. :-(
Ken
On Dec 16, 2010, at 5:45 PM, Jonathan Nieder wrote:
> Hi Ken,
>
> Ken Brownfield wrote:
>
>> Is there a way to apply the optimizations mentioned in that old
>> thread to the code paths used by git-filter-branch (mainly git-read
>> and git-rm, seemingly), or is there another way to investigate and
>> improve the performance of the filter?
>
> Which old thread?
>
> You might be able to get faster results using the approach of [1]
> (using "git cat-file --batch-check" to collect the trees you want
> and "git fast-import" to paste them together), which avoids unpacking
> trees when not needed.
>
> Hope that helps,
> Jonathan
>
> [1] http://repo.or.cz/w/git/barrbrain/github.git/commitdiff/db-svn-filter-root
^ 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