* Recorded talk on using git-svn
From: Thomas Ferris Nicolaisen @ 2011-09-11 22:14 UTC (permalink / raw)
To: git
Hi,
I just did a talk at JavaZone this week about using git-svn, and the
recording is now online:
http://vimeo.com/28762003
The demo features normal use of git-svn, plus setup of a git-svn
mirror, using Jenkins to automatically sync the git mirror, and then
putting the mirror on Github.
Maybe some here will find it useful.
^ permalink raw reply
* Re: [PATCH 2/2] obstack.c: Fix some sparse warnings
From: Sverre Rabbelier @ 2011-09-11 21:56 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list
In-Reply-To: <4E6D0B7D.9070602@ramsay1.demon.co.uk>
Heya,
On Sun, Sep 11, 2011 at 21:26, Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
> compat/obstack.c:399:1: error: symbol 'print_and_abort' redeclared with \
> different type (originally declared at compat/obstack.c:95) \
> - different modifiers
> @@ -395,7 +395,6 @@ _obstack_memory_used (struct obstack *h)
> # endif
>
> static void
> -__attribute__ ((noreturn))
> print_and_abort (void)
> {
> /* Don't change any of these strings. Yes, it would be possible to add
Wouldn't the better solution be to add noreturn to the declaration at
compat/obstack.c:95?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH 3/3] Makefile: Make dependency directory creation less noisy
From: Junio C Hamano @ 2011-09-11 21:45 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0EA2.5080406@ramsay1.demon.co.uk>
Thanks.
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: BJ Hargrave @ 2011-09-11 21:43 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vty8iolnj.fsf@alter.siamese.dyndns.org>
On Sep 11, 2011, at 16:43 , Junio C Hamano wrote:
> Funny.
>
> I am sure we fixed a similar breakage elsewhere a few years ago, by
> swapping the size and nmemb to the calls (i.e. instead of writing one
> block of "size" bytes, you could write "size" blocks of 1-byte) and making
> sure fwrite() reports the number of items. IOW
>
> if (buf && fwrite(buf, 1, size, f) != size)
> die_errno("Could not write '%s'", filename);
>
Do you want me to resubmit the patch using this technique instead of the size > 0 check?
--
BJ
^ permalink raw reply
* [PATCH 3/3] make-static: pu
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
This needs to be split into separate patches and squashed into each
individual commit that introduces these symbols.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
dir.c | 2 +-
dir.h | 1 -
metadata-cache.c | 8 ++++----
metadata-cache.h | 5 -----
refs.c | 2 +-
5 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dir.c b/dir.c
index fba6433..bee7ed1 100644
--- a/dir.c
+++ b/dir.c
@@ -34,7 +34,7 @@ static int fnmatch_icase(const char *pattern, const char *string, int flags)
return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
}
-size_t common_prefix_len(const char **pathspec)
+static size_t common_prefix_len(const char **pathspec)
{
const char *n, *first;
size_t max = 0;
diff --git a/dir.h b/dir.h
index 592ceca..9b7bfd4 100644
--- a/dir.h
+++ b/dir.h
@@ -64,7 +64,6 @@ struct dir_struct {
#define MATCHED_RECURSIVELY 1
#define MATCHED_FNMATCH 2
#define MATCHED_EXACTLY 3
-extern size_t common_prefix_len(const char **pathspec);
extern char *common_prefix(const char **pathspec);
extern int match_pathspec(const char **pathspec, const char *name, int namelen, int prefix, char *seen);
extern int match_pathspec_depth(const struct pathspec *pathspec,
diff --git a/metadata-cache.c b/metadata-cache.c
index 32d3c21..5f5ca4e 100644
--- a/metadata-cache.c
+++ b/metadata-cache.c
@@ -287,8 +287,8 @@ static void *lookup_disk(struct metadata_cache *c,
return c->disk_entries + (pos * record_size(c)) + 20;
}
-const void *metadata_cache_lookup(struct metadata_cache *c,
- const struct object *obj)
+static const void *metadata_cache_lookup(struct metadata_cache *c,
+ const struct object *obj)
{
void *r;
@@ -300,8 +300,8 @@ const void *metadata_cache_lookup(struct metadata_cache *c,
return r;
}
-void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
- const void *value)
+static void metadata_cache_add(struct metadata_cache *c, const struct object *obj,
+ const void *value)
{
metadata_cache_init(c);
add_decoration_value(&c->mem, obj, value, NULL);
diff --git a/metadata-cache.h b/metadata-cache.h
index 15484b5..4819563 100644
--- a/metadata-cache.h
+++ b/metadata-cache.h
@@ -24,11 +24,6 @@ struct metadata_cache {
#define METADATA_CACHE_INIT(name, width, validity) \
{ validity, { (name), (width) } }
-const void *metadata_cache_lookup(struct metadata_cache *,
- const struct object *);
-void metadata_cache_add(struct metadata_cache *, const struct object *,
- const void *value);
-
/* Convenience wrappers around metadata_cache_{lookup,add} */
int metadata_cache_lookup_uint32(struct metadata_cache *,
const struct object *,
diff --git a/refs.c b/refs.c
index 1c4aa33..6e9588b 100644
--- a/refs.c
+++ b/refs.c
@@ -185,7 +185,7 @@ static void clear_cached_refs(struct cached_refs *ca)
ca->did_loose = ca->did_packed = 0;
}
-struct cached_refs *create_cached_refs(const char *submodule)
+static struct cached_refs *create_cached_refs(const char *submodule)
{
int len;
struct cached_refs *refs;
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* [PATCH 2/3] make-static: next
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
This needs to be split into separate patches and queued on top of each
individual topic.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/revert.c | 2 +-
credential.c | 46 +++++++++++++++++++++++-----------------------
credential.h | 1 -
submodule.c | 4 ++--
4 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5e97622..515f3cc 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -659,7 +659,7 @@ static void read_and_refresh_cache(struct replay_opts *opts)
* assert(commit_list_count(list) == 2);
* return list;
*/
-struct commit_list **commit_list_append(struct commit *commit,
+static struct commit_list **commit_list_append(struct commit *commit,
struct commit_list **next)
{
struct commit_list *new = xmalloc(sizeof(struct commit_list));
diff --git a/credential.c b/credential.c
index 7a0c751..6243b03 100644
--- a/credential.c
+++ b/credential.c
@@ -171,6 +171,29 @@ static int credential_do(struct credential *c, const char *method,
return r;
}
+static int credential_fill_gently(struct credential *c,
+ const struct string_list *methods)
+{
+ int i;
+
+ if (c->username && c->password)
+ return 0;
+
+ if (!methods)
+ methods = &default_methods;
+
+ if (!methods->nr)
+ return credential_getpass(c);
+
+ for (i = 0; i < methods->nr; i++) {
+ if (!credential_do(c, methods->items[i].string, NULL) &&
+ c->username && c->password)
+ return 0;
+ }
+
+ return -1;
+}
+
void credential_fill(struct credential *c, const struct string_list *methods)
{
struct strbuf err = STRBUF_INIT;
@@ -195,29 +218,6 @@ void credential_fill(struct credential *c, const struct string_list *methods)
die("%s", err.buf);
}
-int credential_fill_gently(struct credential *c,
- const struct string_list *methods)
-{
- int i;
-
- if (c->username && c->password)
- return 0;
-
- if (!methods)
- methods = &default_methods;
-
- if (!methods->nr)
- return credential_getpass(c);
-
- for (i = 0; i < methods->nr; i++) {
- if (!credential_do(c, methods->items[i].string, NULL) &&
- c->username && c->password)
- return 0;
- }
-
- return -1;
-}
-
void credential_reject(struct credential *c, const struct string_list *methods)
{
int i;
diff --git a/credential.h b/credential.h
index 788ed8e..07541ad 100644
--- a/credential.h
+++ b/credential.h
@@ -13,7 +13,6 @@ struct string_list;
int credential_getpass(struct credential *);
void credential_from_config(struct credential *);
-int credential_fill_gently(struct credential *, const struct string_list *methods);
void credential_fill(struct credential *, const struct string_list *methods);
void credential_reject(struct credential *, const struct string_list *methods);
diff --git a/submodule.c b/submodule.c
index 38d9877..5a02890 100644
--- a/submodule.c
+++ b/submodule.c
@@ -318,7 +318,7 @@ static int has_remote(const char *refname, const unsigned char *sha1, int flags,
return 1;
}
-int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
+static int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
{
int *needs_pushing = data;
@@ -352,7 +352,7 @@ int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void
return 1;
}
-int push_submodule(const char *path, const unsigned char sha1[20], void *data)
+static int push_submodule(const char *path, const unsigned char sha1[20], void *data)
{
if (add_submodule_odb(path) || !lookup_commit_reference(sha1))
return 1;
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* [PATCH 1/3] make-static: master
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
Many symbols that are exported to the global scope do not have to be.
Signed-off-by: Junio C Hamano <junio@pobox.com>
---
* To be applied on top of 3793ac5 (RelNotes/1.7.7: minor fixes, 2011-09-07)
builtin.h | 2 --
builtin/notes.c | 4 ++--
cache.h | 2 --
convert.c | 2 +-
convert.h | 1 -
diff.c | 2 +-
diff.h | 1 -
dir.c | 4 ++--
dir.h | 2 --
git-compat-util.h | 5 -----
graph.c | 28 ++++++++++++++++++++++++++--
graph.h | 29 -----------------------------
notes.c | 15 +++++++++++++--
notes.h | 14 --------------
parse-options.c | 2 +-
parse-options.h | 1 -
rerere.c | 2 +-
rerere.h | 1 -
sha1-array.c | 2 +-
sha1-array.h | 1 -
trace.c | 2 +-
wrapper.c | 40 ++++++++++++++++++++--------------------
22 files changed, 69 insertions(+), 93 deletions(-)
diff --git a/builtin.h b/builtin.h
index 0e9da90..8f50a3a 100644
--- a/builtin.h
+++ b/builtin.h
@@ -16,7 +16,6 @@ extern const char git_more_info_string[];
extern void prune_packed_objects(int);
extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
int merge_title, int shortlog_len);
-extern void commit_notes(struct notes_tree *t, const char *msg);
struct notes_rewrite_cfg {
struct notes_tree **trees;
@@ -28,7 +27,6 @@ struct notes_rewrite_cfg {
int mode_from_env;
};
-combine_notes_fn parse_combine_notes_fn(const char *v);
struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd);
int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
const unsigned char *from_obj, const unsigned char *to_obj);
diff --git a/builtin/notes.c b/builtin/notes.c
index f8e437d..34b74ee 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -288,7 +288,7 @@ static int parse_reedit_arg(const struct option *opt, const char *arg, int unset
return parse_reuse_arg(opt, arg, unset);
}
-void commit_notes(struct notes_tree *t, const char *msg)
+static void commit_notes(struct notes_tree *t, const char *msg)
{
struct strbuf buf = STRBUF_INIT;
unsigned char commit_sha1[20];
@@ -312,7 +312,7 @@ void commit_notes(struct notes_tree *t, const char *msg)
strbuf_release(&buf);
}
-combine_notes_fn parse_combine_notes_fn(const char *v)
+static combine_notes_fn parse_combine_notes_fn(const char *v)
{
if (!strcasecmp(v, "overwrite"))
return combine_notes_overwrite;
diff --git a/cache.h b/cache.h
index 607c2ea..e1fc31e 100644
--- a/cache.h
+++ b/cache.h
@@ -709,7 +709,6 @@ int git_mkstemp(char *path, size_t n, const char *template);
int git_mkstemps(char *path, size_t n, const char *template, int suffix_len);
/* set default permissions by passing mode arguments to open(2) */
-int git_mkstemps_mode(char *pattern, int suffix_len, int mode);
int git_mkstemp_mode(char *pattern, int mode);
/*
@@ -1147,7 +1146,6 @@ extern void alloc_report(void);
/* trace.c */
__attribute__((format (printf, 1, 2)))
extern void trace_printf(const char *format, ...);
-extern void trace_vprintf(const char *key, const char *format, va_list ap);
__attribute__((format (printf, 2, 3)))
extern void trace_argv_printf(const char **argv, const char *format, ...);
extern void trace_repo_setup(const char *prefix);
diff --git a/convert.c b/convert.c
index 3bb5a4d..fc74a6e 100644
--- a/convert.c
+++ b/convert.c
@@ -867,7 +867,7 @@ static struct stream_filter null_filter_singleton = {
&null_vtbl,
};
-int is_null_stream_filter(struct stream_filter *filter)
+static int is_null_stream_filter(struct stream_filter *filter)
{
return filter == &null_filter_singleton;
}
diff --git a/convert.h b/convert.h
index d799a165..3d464eb 100644
--- a/convert.h
+++ b/convert.h
@@ -51,7 +51,6 @@ struct stream_filter; /* opaque */
extern struct stream_filter *get_stream_filter(const char *path, const unsigned char *);
extern void free_stream_filter(struct stream_filter *);
-extern int is_null_stream_filter(struct stream_filter *);
/*
* Use as much input up to *isize_p and fill output up to *osize_p;
diff --git a/diff.c b/diff.c
index fcc0078..bd4be32 100644
--- a/diff.c
+++ b/diff.c
@@ -25,7 +25,7 @@
static int diff_detect_rename_default;
static int diff_rename_limit_default = 400;
static int diff_suppress_blank_empty;
-int diff_use_color_default = -1;
+static int diff_use_color_default = -1;
static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
diff --git a/diff.h b/diff.h
index 8c66b59..985bed4 100644
--- a/diff.h
+++ b/diff.h
@@ -230,7 +230,6 @@ extern int parse_long_opt(const char *opt, const char **argv,
extern int git_diff_basic_config(const char *var, const char *value, void *cb);
extern int git_diff_ui_config(const char *var, const char *value, void *cb);
-extern int diff_use_color_default;
extern void diff_setup(struct diff_options *);
extern int diff_opt_parse(struct diff_options *, const char **, int);
extern int diff_setup_done(struct diff_options *);
diff --git a/dir.c b/dir.c
index 08281d2..ebf1de6 100644
--- a/dir.c
+++ b/dir.c
@@ -19,7 +19,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, in
static int get_dtype(struct dirent *de, const char *path, int len);
/* helper string functions with support for the ignore_case flag */
-int strcmp_icase(const char *a, const char *b)
+static int strcmp_icase(const char *a, const char *b)
{
return ignore_case ? strcasecmp(a, b) : strcmp(a, b);
}
@@ -29,7 +29,7 @@ int strncmp_icase(const char *a, const char *b, size_t count)
return ignore_case ? strncasecmp(a, b, count) : strncmp(a, b, count);
}
-int fnmatch_icase(const char *pattern, const char *string, int flags)
+static int fnmatch_icase(const char *pattern, const char *string, int flags)
{
return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
}
diff --git a/dir.h b/dir.h
index 433b5b4..640b18a 100644
--- a/dir.h
+++ b/dir.h
@@ -106,8 +106,6 @@ extern int remove_dir_recursively(struct strbuf *path, int flag);
/* tries to remove the path with empty directories along it, ignores ENOENT */
extern int remove_path(const char *path);
-extern int strcmp_icase(const char *a, const char *b);
extern int strncmp_icase(const char *a, const char *b, size_t count);
-extern int fnmatch_icase(const char *pattern, const char *string, int flags);
#endif
diff --git a/git-compat-util.h b/git-compat-util.h
index 5ef8ff7..3b5648d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -330,7 +330,6 @@ extern char *gitmkdtemp(char *);
#ifdef NO_MKSTEMPS
#define mkstemps gitmkstemps
-extern int gitmkstemps(char *, int);
#endif
#ifdef NO_UNSETENV
@@ -566,10 +565,6 @@ void git_qsort(void *base, size_t nmemb, size_t size,
*/
int unlink_or_warn(const char *path);
/*
- * Likewise for rmdir(2).
- */
-int rmdir_or_warn(const char *path);
-/*
* Calls the correct function out of {unlink,rmdir}_or_warn based on
* the supplied file mode.
*/
diff --git a/graph.c b/graph.c
index 7358416..e013289 100644
--- a/graph.c
+++ b/graph.c
@@ -62,7 +62,22 @@ enum graph_state {
static const char **column_colors;
static unsigned short column_colors_max;
-void graph_set_column_colors(const char **colors, unsigned short colors_max)
+/*
+ * Set up a custom scheme for column colors.
+ *
+ * The default column color scheme inserts ANSI color escapes to colorize
+ * the graph. The various color escapes are stored in an array of strings
+ * where each entry corresponds to a color, except for the last entry,
+ * which denotes the escape for resetting the color back to the default.
+ * When generating the graph, strings from this array are inserted before
+ * and after the various column characters.
+ *
+ * This function allows you to enable a custom array of color escapes.
+ * The 'colors_max' argument is the index of the last "reset" entry.
+ *
+ * This functions must be called BEFORE graph_init() is called.
+ */
+static void graph_set_column_colors(const char **colors, unsigned short colors_max)
{
column_colors = colors;
column_colors_max = colors_max;
@@ -1113,7 +1128,16 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf
graph_update_state(graph, GRAPH_PADDING);
}
-int graph_next_line(struct git_graph *graph, struct strbuf *sb)
+/*
+ * Output the next line for a graph.
+ * This formats the next graph line into the specified strbuf. It is not
+ * terminated with a newline.
+ *
+ * Returns 1 if the line includes the current commit, and 0 otherwise.
+ * graph_next_line() will return 1 exactly once for each time
+ * graph_update() is called.
+ */
+static int graph_next_line(struct git_graph *graph, struct strbuf *sb)
{
switch (graph->state) {
case GRAPH_PADDING:
diff --git a/graph.h b/graph.h
index aff960c..5ddbb1a 100644
--- a/graph.h
+++ b/graph.h
@@ -5,23 +5,6 @@
struct git_graph;
/*
- * Set up a custom scheme for column colors.
- *
- * The default column color scheme inserts ANSI color escapes to colorize
- * the graph. The various color escapes are stored in an array of strings
- * where each entry corresponds to a color, except for the last entry,
- * which denotes the escape for resetting the color back to the default.
- * When generating the graph, strings from this array are inserted before
- * and after the various column characters.
- *
- * This function allows you to enable a custom array of color escapes.
- * The 'colors_max' argument is the index of the last "reset" entry.
- *
- * This functions must be called BEFORE graph_init() is called.
- */
-void graph_set_column_colors(const char **colors, unsigned short colors_max);
-
-/*
* Create a new struct git_graph.
*/
struct git_graph *graph_init(struct rev_info *opt);
@@ -50,18 +33,6 @@ void graph_update(struct git_graph *graph, struct commit *commit);
int graph_is_commit_finished(struct git_graph const *graph);
/*
- * Output the next line for a graph.
- * This formats the next graph line into the specified strbuf. It is not
- * terminated with a newline.
- *
- * Returns 1 if the line includes the current commit, and 0 otherwise.
- * graph_next_line() will return 1 exactly once for each time
- * graph_update() is called.
- */
-int graph_next_line(struct git_graph *graph, struct strbuf *sb);
-
-
-/*
* graph_show_*: helper functions for printing to stdout
*/
diff --git a/notes.c b/notes.c
index 93e9868..d98243f 100644
--- a/notes.c
+++ b/notes.c
@@ -1196,8 +1196,19 @@ void free_notes(struct notes_tree *t)
memset(t, 0, sizeof(struct notes_tree));
}
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags)
+
+/*
+ * Fill the given strbuf with the notes associated with the given object.
+ *
+ * If the given notes_tree structure is not initialized, it will be auto-
+ * initialized to the default value (see documentation for init_notes() above).
+ * If the given notes_tree is NULL, the internal/default notes_tree will be
+ * used instead.
+ *
+ * 'flags' is a bitwise combination of the above formatting flags.
+ */
+static void format_note(struct notes_tree *t, const unsigned char *object_sha1,
+ struct strbuf *sb, const char *output_encoding, int flags)
{
static const char utf8[] = "utf-8";
const unsigned char *sha1;
diff --git a/notes.h b/notes.h
index c716694..3592b19 100644
--- a/notes.h
+++ b/notes.h
@@ -241,20 +241,6 @@ void free_notes(struct notes_tree *t);
#define NOTES_SHOW_HEADER 1
#define NOTES_INDENT 2
-/*
- * Fill the given strbuf with the notes associated with the given object.
- *
- * If the given notes_tree structure is not initialized, it will be auto-
- * initialized to the default value (see documentation for init_notes() above).
- * If the given notes_tree is NULL, the internal/default notes_tree will be
- * used instead.
- *
- * 'flags' is a bitwise combination of the above formatting flags.
- */
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags);
-
-
struct string_list;
struct display_notes_opt {
diff --git a/parse-options.c b/parse-options.c
index 503ab5d..db80155 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -11,7 +11,7 @@ static int parse_options_usage(struct parse_opt_ctx_t *ctx,
#define OPT_SHORT 1
#define OPT_UNSET 2
-int optbug(const struct option *opt, const char *reason)
+static int optbug(const struct option *opt, const char *reason)
{
if (opt->long_name)
return error("BUG: option '%s' %s", opt->long_name, reason);
diff --git a/parse-options.h b/parse-options.h
index 59e0b52..eed93cb 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -165,7 +165,6 @@ extern NORETURN void usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options);
-extern int optbug(const struct option *opt, const char *reason);
extern int opterror(const struct option *opt, const char *reason, int flags);
/*----- incremental advanced APIs -----*/
diff --git a/rerere.c b/rerere.c
index dcb525a..a2e36de 100644
--- a/rerere.c
+++ b/rerere.c
@@ -25,7 +25,7 @@ const char *rerere_path(const char *hex, const char *file)
return git_path("rr-cache/%s/%s", hex, file);
}
-int has_rerere_resolution(const char *hex)
+static int has_rerere_resolution(const char *hex)
{
struct stat st;
return !stat(rerere_path(hex, "postimage"), &st);
diff --git a/rerere.h b/rerere.h
index fcd8bc1..156d2aa 100644
--- a/rerere.h
+++ b/rerere.h
@@ -16,7 +16,6 @@ extern void *RERERE_RESOLVED;
extern int setup_rerere(struct string_list *, int);
extern int rerere(int);
extern const char *rerere_path(const char *hex, const char *file);
-extern int has_rerere_resolution(const char *hex);
extern int rerere_forget(const char **);
extern int rerere_remaining(struct string_list *);
extern void rerere_clear(struct string_list *);
diff --git a/sha1-array.c b/sha1-array.c
index b2f47f9..6f4a224 100644
--- a/sha1-array.c
+++ b/sha1-array.c
@@ -14,7 +14,7 @@ static int void_hashcmp(const void *a, const void *b)
return hashcmp(a, b);
}
-void sha1_array_sort(struct sha1_array *array)
+static void sha1_array_sort(struct sha1_array *array)
{
qsort(array->sha1, array->nr, sizeof(*array->sha1), void_hashcmp);
array->sorted = 1;
diff --git a/sha1-array.h b/sha1-array.h
index 4499b5d..72bb33b 100644
--- a/sha1-array.h
+++ b/sha1-array.h
@@ -11,7 +11,6 @@ struct sha1_array {
#define SHA1_ARRAY_INIT { NULL, 0, 0, 0 }
void sha1_array_append(struct sha1_array *array, const unsigned char *sha1);
-void sha1_array_sort(struct sha1_array *array);
int sha1_array_lookup(struct sha1_array *array, const unsigned char *sha1);
void sha1_array_clear(struct sha1_array *array);
diff --git a/trace.c b/trace.c
index d953416..5ec0e3b 100644
--- a/trace.c
+++ b/trace.c
@@ -62,7 +62,7 @@ static int get_trace_fd(const char *key, int *need_close)
static const char err_msg[] = "Could not trace into fd given by "
"GIT_TRACE environment variable";
-void trace_vprintf(const char *key, const char *fmt, va_list ap)
+static void trace_vprintf(const char *key, const char *fmt, va_list ap)
{
struct strbuf buf = STRBUF_INIT;
diff --git a/wrapper.c b/wrapper.c
index 85f09df..390a7ae 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -236,29 +236,12 @@ int git_mkstemp(char *path, size_t len, const char *template)
return mkstemp(path);
}
-/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
-int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
-{
- const char *tmp;
- size_t n;
-
- tmp = getenv("TMPDIR");
- if (!tmp)
- tmp = "/tmp";
- n = snprintf(path, len, "%s/%s", tmp, template);
- if (len <= n) {
- errno = ENAMETOOLONG;
- return -1;
- }
- return mkstemps(path, suffix_len);
-}
-
/* Adapted from libiberty's mkstemp.c. */
#undef TMP_MAX
#define TMP_MAX 16384
-int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
+static int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
{
static const char letters[] =
"abcdefghijklmnopqrstuvwxyz"
@@ -327,11 +310,28 @@ int git_mkstemp_mode(char *pattern, int mode)
return git_mkstemps_mode(pattern, 0, mode);
}
-int gitmkstemps(char *pattern, int suffix_len)
+static int gitmkstemps(char *pattern, int suffix_len)
{
return git_mkstemps_mode(pattern, suffix_len, 0600);
}
+/* git_mkstemps() - create tmp file with suffix honoring TMPDIR variable. */
+int git_mkstemps(char *path, size_t len, const char *template, int suffix_len)
+{
+ const char *tmp;
+ size_t n;
+
+ tmp = getenv("TMPDIR");
+ if (!tmp)
+ tmp = "/tmp";
+ n = snprintf(path, len, "%s/%s", tmp, template);
+ if (len <= n) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+ return mkstemps(path, suffix_len);
+}
+
int xmkstemp_mode(char *template, int mode)
{
int fd;
@@ -372,7 +372,7 @@ int unlink_or_warn(const char *file)
return warn_if_unremovable("unlink", file, unlink(file));
}
-int rmdir_or_warn(const char *file)
+static int rmdir_or_warn(const char *file)
{
return warn_if_unremovable("rmdir", file, rmdir(file));
}
--
1.7.7.rc0.188.g3793ac
^ permalink raw reply related
* Re: [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
From: Junio C Hamano @ 2011-09-11 21:38 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E3F.3090304@ramsay1.demon.co.uk>
There are many others that can be identified by running the attached
script after you build your git. I'll follow this message up with three
consolidated patches, but the latter two needs to be split into smaller
pieces to be either queued on top (for topics in next) or squashed into
(for topics in pu), which I am not going to do myself today (hint, hint).
#!/usr/bin/perl -w
my %defd = ();
my %used = ();
my %def_ok = map { $_ => 1 } qw(
main
alloc_report
have_git_dir
prepare_git_cmd
print_string_list
tm_to_time_t
unsorted_string_list_has_string
xdl_atol
xdl_cha_first
xdl_cha_next
xdl_mmfile_size
xdl_num_out
xdl_recs_cmp
);
for (<*.o>, <*/*.o>, <*/*/*.o>) {
my $obj = $_;
open(I, "-|", qw(nm -g), $obj) or die;
while (<I>) {
unless (/^[0-9a-f ]+([A-Z]) (\S*)$/) {
print STDERR "? $_";
next;
}
if (($1 eq "U") || $1 eq "C") {
$used{$2}++;
}
else {
push @{$defd{$obj}}, $2;
}
}
close I;
}
for my $obj (sort keys %defd) {
my $syms = $defd{$obj};
for my $sym (@$syms) {
next if exists $used{$sym} or exists $def_ok{$sym};
print "$obj - $sym\n";
}
}
^ permalink raw reply
* Re: [PATCH 2/3] Fix some "variable might be used uninitialized" warnings
From: Junio C Hamano @ 2011-09-11 20:48 UTC (permalink / raw)
To: Ramsay Jones; +Cc: GIT Mailing-list
In-Reply-To: <4E6D0E74.1020801@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> In particular, gcc complains as follows:
>
> CC tree-walk.o
> tree-walk.c: In function `traverse_trees':
> tree-walk.c:347: warning: 'e' might be used uninitialized in this \
> function
>
> CC builtin/revert.o
> builtin/revert.c: In function `verify_opt_mutually_compatible':
> builtin/revert.c:113: warning: 'opt2' might be used uninitialized in \
> this function
Could you also add something to this effect to the commit log message:
but I have verified that these are gcc being not careful
enough and they are never used uninitialized.
If that is what you indeed have done, that is.
Thanks.
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: Junio C Hamano @ 2011-09-11 20:43 UTC (permalink / raw)
To: BJ Hargrave; +Cc: git
In-Reply-To: <A3964281-B24B-46C0-AE73-0CCB4C12556F@bjhargrave.com>
BJ Hargrave <bj@bjhargrave.com> writes:
> diff --git a/builtin/fsck.c b/builtin/fsck.c
> index 5ae0366..ad6d713 100644
> --- a/builtin/fsck.c
> +++ b/builtin/fsck.c
> @@ -232,9 +232,10 @@ static void check_unreachable_object(struct object *obj)
> char *buf = read_sha1_file(obj->sha1,
> &type, &size);
> if (buf) {
> - if (fwrite(buf, size, 1, f) != 1)
> - die_errno("Could not write '%s'",
> - filename);
> + if (size > 0)
> + if (fwrite(buf, size, 1, f) != 1)
> + die_errno("Could not write '%s'",
> + filename);
Funny.
I am sure we fixed a similar breakage elsewhere a few years ago, by
swapping the size and nmemb to the calls (i.e. instead of writing one
block of "size" bytes, you could write "size" blocks of 1-byte) and making
sure fwrite() reports the number of items. IOW
if (buf && fwrite(buf, 1, size, f) != size)
die_errno("Could not write '%s'", filename);
^ permalink raw reply
* Re: How do I investigate apparently random git clone reports of "error: File ... has bad hash"?
From: Andreas Schwab @ 2011-09-11 20:13 UTC (permalink / raw)
To: Thorkil Naur; +Cc: git
In-Reply-To: <loom.20110911T210035-693@post.gmane.org>
Thorkil Naur <naur@post11.tele.dk> writes:
> I have looked for git options (debug, verbosity) for increasing the amount of
> information reported, but have not managed to find anything that seemed useful
> in this situation.
Try adding -v -v when cloning. That also shows you that the server does
not support smart-http, which is suboptimal.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: How do I investigate apparently random git clone reports of "error: File ... has bad hash"?
From: Andreas Schwab @ 2011-09-11 19:59 UTC (permalink / raw)
To: Thorkil Naur; +Cc: git
In-Reply-To: <loom.20110911T210035-693@post.gmane.org>
Thorkil Naur <naur@post11.tele.dk> writes:
>> $ git clone http://darcs.haskell.org/ghc.git/ build8
>> Cloning into build8...
>> error: File 42988feeeb76f5cb92b541e9dac277e073bcb3ef has bad hash
>> error: Unable to find 42988feeeb76f5cb92b541e9dac277e073bcb3ef under
> http://darcs.haskell.org/ghc.git
>> Cannot obtain needed blob 42988feeeb76f5cb92b541e9dac277e073bcb3ef
>> while processing commit ffb2e81c03a01e74825b3a0223e214df59241fab.
>> error: Fetch failed.
I just tried to clone it and got this error:
$ git clone http://darcs.haskell.org/ghc.git
Cloning into ghc...
error: Recv failure: Connection reset by peer (curl_result = 56, http_code = 0, sha1 = be6810bb027643bf0697b3d237426110f064aba1)
error: Unable to find be6810bb027643bf0697b3d237426110f064aba1 under http://darcs.haskell.org/ghc.git
Cannot obtain needed commit be6810bb027643bf0697b3d237426110f064aba1
while processing commit 6942b112082fbcdff5c66f06f56fdd336861da47.
error: Fetch failed.
It looks like this is just a network problem.
Btw, the repo is rather strange. It's not a bare repo, but does not
contain a .git directory. Instead the files that are normally under
.git are placed directly in the working tree.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* [PATCH 3/3] Makefile: Make dependency directory creation less noisy
From: Ramsay Jones @ 2011-09-11 19:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 0ea1a2b..a0f0faf 100644
--- a/Makefile
+++ b/Makefile
@@ -1909,7 +1909,7 @@ dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
ifdef COMPUTE_HEADER_DEPENDENCIES
$(dep_dirs):
- mkdir -p $@
+ @mkdir -p $@
missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
dep_file = $(dir $@).depend/$(notdir $@).d
--
1.7.6
^ permalink raw reply related
* [PATCH 2/3] Fix some "variable might be used uninitialized" warnings
From: Ramsay Jones @ 2011-09-11 19:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
In particular, gcc complains as follows:
CC tree-walk.o
tree-walk.c: In function `traverse_trees':
tree-walk.c:347: warning: 'e' might be used uninitialized in this \
function
CC builtin/revert.o
builtin/revert.c: In function `verify_opt_mutually_compatible':
builtin/revert.c:113: warning: 'opt2' might be used uninitialized in \
this function
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
builtin/revert.c | 2 +-
tree-walk.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5f1cee8..30538a1 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -110,7 +110,7 @@ static void verify_opt_compatible(const char *me, const char *base_opt, ...)
static void verify_opt_mutually_compatible(const char *me, ...)
{
- const char *opt1, *opt2;
+ const char *opt1, *opt2 = NULL;
va_list ap;
va_start(ap, me);
diff --git a/tree-walk.c b/tree-walk.c
index 808bb55..a8d8a66 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -344,7 +344,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
unsigned long mask, dirmask;
const char *first = NULL;
int first_len = 0;
- struct name_entry *e;
+ struct name_entry *e = NULL;
int len;
for (i = 0; i < n; i++) {
--
1.7.6
^ permalink raw reply related
* [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
From: Ramsay Jones @ 2011-09-11 19:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warning for the following symbols:
submodule.c:321:5: 'submodule_needs_pushing'
submodule.c:355:5: 'push_submodule'
builtin/revert.c:662:20: 'commit_list_append'
These symbols only require file scope, so we simply add the static
modifier to their declarations.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
builtin/revert.c | 4 ++--
submodule.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 5e97622..5f1cee8 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -659,8 +659,8 @@ static void read_and_refresh_cache(struct replay_opts *opts)
* assert(commit_list_count(list) == 2);
* return list;
*/
-struct commit_list **commit_list_append(struct commit *commit,
- struct commit_list **next)
+static struct commit_list **commit_list_append(struct commit *commit,
+ struct commit_list **next)
{
struct commit_list *new = xmalloc(sizeof(struct commit_list));
new->item = commit;
diff --git a/submodule.c b/submodule.c
index 38d9877..5a02890 100644
--- a/submodule.c
+++ b/submodule.c
@@ -318,7 +318,7 @@ static int has_remote(const char *refname, const unsigned char *sha1, int flags,
return 1;
}
-int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
+static int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void *data)
{
int *needs_pushing = data;
@@ -352,7 +352,7 @@ int submodule_needs_pushing(const char *path, const unsigned char sha1[20], void
return 1;
}
-int push_submodule(const char *path, const unsigned char sha1[20], void *data)
+static int push_submodule(const char *path, const unsigned char sha1[20], void *data)
{
if (add_submodule_odb(path) || !lookup_commit_reference(sha1))
return 1;
--
1.7.6
^ permalink raw reply related
* [PATCH 0/3] misc patches on next branch
From: Ramsay Jones @ 2011-09-11 19:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Hi Junio,
These patches are built on the next branch (from repo.or.cz)
@ 12850bec0c24b529c9a9df6a95ad4bdeea39373e
[PATCH 1/3] sparse: Fix some "symbol not declared" warnings
[PATCH 2/3] Fix some "variable might be used uninitialized" warnings
[PATCH 3/3] Makefile: Make dependency directory creation less noisy
Note that the next branch does not build on MinGW at the moment due
to the credentials-cache[--daemon] additions; rather the use of unix
sockets to be more precise. I had intended to fix this up by now (one
option being to emulate unix sockets with win32 named pipes) but I
haven't had time - sorry!
ATB,
Ramsay Jones
^ permalink raw reply
* [PATCH 2/2] obstack.c: Fix some sparse warnings
From: Ramsay Jones @ 2011-09-11 19:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
In particular, sparse issues the following warnings:
compat/obstack.c:176:17: warning: Using plain integer as NULL pointer
compat/obstack.c:224:17: warning: Using plain integer as NULL pointer
compat/obstack.c:324:16: warning: Using plain integer as NULL pointer
compat/obstack.c:329:16: warning: Using plain integer as NULL pointer
compat/obstack.c:347:16: warning: Using plain integer as NULL pointer
compat/obstack.c:362:19: warning: Using plain integer as NULL pointer
compat/obstack.c:379:29: warning: Using plain integer as NULL pointer
compat/obstack.c:399:1: error: symbol 'print_and_abort' redeclared with \
different type (originally declared at compat/obstack.c:95) \
- different modifiers
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
compat/obstack.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/compat/obstack.c b/compat/obstack.c
index a89ab5b..e276ccd 100644
--- a/compat/obstack.c
+++ b/compat/obstack.c
@@ -173,7 +173,7 @@ _obstack_begin (struct obstack *h,
alignment - 1);
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
- chunk->prev = 0;
+ chunk->prev = NULL;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
@@ -221,7 +221,7 @@ _obstack_begin_1 (struct obstack *h, int size, int alignment,
alignment - 1);
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
- chunk->prev = 0;
+ chunk->prev = NULL;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
@@ -321,12 +321,12 @@ _obstack_allocated_p (struct obstack *h, void *obj)
/* We use >= rather than > since the object cannot be exactly at
the beginning of the chunk but might be an empty object exactly
at the end of an adjacent chunk. */
- while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
+ while (lp != NULL && ((void *) lp >= obj || (void *) (lp)->limit < obj))
{
plp = lp->prev;
lp = plp;
}
- return lp != 0;
+ return lp != NULL;
}
\f
/* Free objects in obstack H, including OBJ and everything allocate
@@ -344,7 +344,7 @@ obstack_free (struct obstack *h, void *obj)
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
- while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
+ while (lp != NULL && ((void *) lp >= obj || (void *) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
@@ -359,7 +359,7 @@ obstack_free (struct obstack *h, void *obj)
h->chunk_limit = lp->limit;
h->chunk = lp;
}
- else if (obj != 0)
+ else if (obj != NULL)
/* obj is not in any of the chunks! */
abort ();
}
@@ -376,7 +376,7 @@ _obstack_memory_used (struct obstack *h)
register struct _obstack_chunk* lp;
register int nbytes = 0;
- for (lp = h->chunk; lp != 0; lp = lp->prev)
+ for (lp = h->chunk; lp != NULL; lp = lp->prev)
{
nbytes += lp->limit - (char *) lp;
}
@@ -395,7 +395,6 @@ _obstack_memory_used (struct obstack *h)
# endif
static void
-__attribute__ ((noreturn))
print_and_abort (void)
{
/* Don't change any of these strings. Yes, it would be possible to add
--
1.7.6
^ permalink raw reply related
* [PATCH 1/2] sparse: Fix an "Using plain integer as NULL pointer" warning
From: Ramsay Jones @ 2011-09-11 19:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
kwset.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kwset.c b/kwset.c
index 956ae72..51b2ab6 100644
--- a/kwset.c
+++ b/kwset.c
@@ -674,7 +674,7 @@ cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch)
copy of the preceding main search loops. */
if (lim - mch > kwset->maxd)
lim = mch + kwset->maxd;
- lmch = 0;
+ lmch = NULL;
d = 1;
while (lim - end >= d)
{
--
1.7.6
^ permalink raw reply related
* [PATCH 0/2] spare warnings on master
From: Ramsay Jones @ 2011-09-11 19:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Hi Junio,
These patches fix some sparse warnings on the master branch
(from repo.or.cz) @ 3793ac56b4c4f9bf0bddc306a0cec21118683728
[PATCH 1/2] sparse: Fix an "Using plain integer as NULL pointer"
[PATCH 2/2] obstack.c: Fix some sparse warnings
They could be squashed into one commit, if you prefer. The second
patch is not required on Linux, because *all* of the code in obstack.c
is #ifdef'd out, but it fixes things up on cygwin and MinGW.
ATB,
Ramsay Jones
^ permalink raw reply
* Re: t5800-*.sh: Intermittent test failures
From: Ramsay Jones @ 2011-09-11 19:14 UTC (permalink / raw)
To: Jeff King
Cc: Junio C Hamano, Sverre Rabbelier, GIT Mailing-list,
Jonathan Nieder
In-Reply-To: <20110908182055.GA16500@sigill.intra.peff.net>
Jeff King wrote:
> On Thu, Sep 08, 2011 at 06:42:11PM +0100, Ramsay Jones wrote:
>
>> When I run the tests with "make test >test-out", I see a failure rate of about
>> 1 in 10. If I then set the debug environment variables (GIT_TRANSPORT_HELPER_DEBUG,
>> GIT_TRANSLOOP_DEBUG and GIT_DEBUG_TESTGIT) and run the test script directly (-v),
>> then the failure rate goes up to about 1 in 3.
>
> Hmm. I can't reproduce a failure here, but I do get some weirdness. My
> recipe is:
Ah, sorry, ... I didn't make myself clear then, because ...
> -- >8 --
> cat >foo.sh <<\EOF
> #!/bin/sh
>
> exec >$1.out 2>&1
>
> n=0
> while test $n -lt 100; do
> n=$(($n+1))
> GIT_TRANSPORT_HELPER_DEBUG=1 \
> GIT_TRANSLOOP_DEBUG=1 \
> GIT_DEBUG_TESTGIT=1 \
> ./t5800-remote-helpers.sh --root=/run/shm/git-tests-$1 -v || {
> echo FAIL $n
> exit 1
> }
> echo OK $n
> done
> EOF
>
> # try to keep an 8-core machine busy
> for i in `seq 1 16`; do
> sh foo.sh $i &
> done
> -- 8< --
>
> I never see a test failure, but a few of the 16 end up hanging. The
> process tree for the hanged tests look like:
>
> t5800-remote-helper
> git push
> git-remote-testgit
> git fast-import
> git-fast-import
>
> All of them are blocked on wait(), except for the final fast-import,
> which is blocked trying to read() from stdin.
... these hangs *are* the failures of which I speak! Yes, the script
doesn't get to declare a failure, but AFAIAC a hanging test (and it
isn't the same test # each time) is a failing test. :-D
ATB,
Ramsay Jones
^ permalink raw reply
* Git new-feature-branch best practices
From: Zganyaiko Dmitry @ 2011-09-11 19:31 UTC (permalink / raw)
To: git
Hi all! I have a question about using branches.
For example, I make branch for some experimental feature. After some
time I have completed this feature. I'll checkout previous branch and
merge this new feature's branch to it.
And there is my question. If I know that this feature was implemented
very good and _will not be changed lately_, should I remove this new
feature branch (because it will be unused)?
Is there some best practice what to do in my case?
So, should I remove a branch for some new feature after its
implementation if I sure that I will not edit this feature's code later?
May be, there is answer for my question already and I missed it?
^ permalink raw reply
* How do I investigate apparently random git clone reports of "error: File ... has bad hash"?
From: Thorkil Naur @ 2011-09-11 19:03 UTC (permalink / raw)
To: git
Hello,
On a Mac OS X 10.5.8 with
> $ uname -a
> Darwin thorkil-naurs-intel-mac-mini.local 9.8.0 Darwin Kernel Version 9.8.0:
Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
> $ git --version
> git version 1.7.4.1
> $
that I use as a so-called buildbot slave (http://trac.buildbot.net/) for GHC
(http://www.haskell.org/ghc/), git clone is used repeatedly to fetch the main
repository and several other (library) repositories on which the main repository
depends. In recent months, I have experienced apparently random failures in
which git clone reports, for example:
> $ git clone http://darcs.haskell.org/ghc.git/ build8
> Cloning into build8...
> error: File 42988feeeb76f5cb92b541e9dac277e073bcb3ef has bad hash
> error: Unable to find 42988feeeb76f5cb92b541e9dac277e073bcb3ef under
http://darcs.haskell.org/ghc.git
> Cannot obtain needed blob 42988feeeb76f5cb92b541e9dac277e073bcb3ef
> while processing commit ffb2e81c03a01e74825b3a0223e214df59241fab.
> error: Fetch failed.
There are variations of this, such as
> $ git clone http://darcs.haskell.org/ghc.git/ build6
> Cloning into build6...
> error: inflate: data stream error (incorrect header check)
> error: inflate: data stream error (incorrect header check)
> error: inflate: data stream error (incorrect header check)
> error: inflate: data stream error (incorrect header check)
> error: inflate: data stream error (incorrect header check)
> error: File 280db842d43e7e68c09bf01695434fc0f8fff796
(http://darcs.haskell.org/ghc.git/objects/c8/ba6e77a6202e7df588c3b1fa3ada5142482036)
corrupt
> error: Unable to find c8ba6e77a6202e7df588c3b1fa3ada5142482036 under
http://darcs.haskell.org/ghc.git
> Cannot obtain needed blob c8ba6e77a6202e7df588c3b1fa3ada5142482036
> while processing commit ffb2e81c03a01e74825b3a0223e214df59241fab.
> error: Fetch failed.
In most cases, the git clone succeeds, but failure nevertheless happens
sufficiently often to break most builds. See, for example
http://darcs.haskell.org/ghcBuilder/builders/tn23/437/3.html.
I tried the clone of the main repository on my Ubuntu Linux machine that says
> $ uname -a
> Linux tn24 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686
GNU/Linux
> $ git --version
> git version 1.7.0.4
> $
(which is connected to the same network as the Mac) and was not able to
reproduce the error.
I have looked for git options (debug, verbosity) for increasing the amount of
information reported, but have not managed to find anything that seemed useful
in this situation. The apparent randomness of the failures points to some kind
of network problem, but I have not noticed other indications that my network
connection is unstable.
I am not a git expert at all, I am not using git for anything but GHC building.
I would very much appreciate some indication of how I might investigate this
problem.
Best regards
Thorkil
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: Sverre Rabbelier @ 2011-09-11 16:21 UTC (permalink / raw)
To: BJ Hargrave; +Cc: git, Junio C Hamano
In-Reply-To: <E6A02216-CA67-4B66-AA8F-6DDE8AF7DF3A@bjhargrave.com>
Heya,
On Sun, Sep 11, 2011 at 18:20, BJ Hargrave <bj@bjhargrave.com> wrote:
> You don't need to write anything to the 0-byte file. Just create it and
> close it and there are checks already that verify the fopen and fclose
> do not fail. So I don't think we are missing any error conditions here.
Works for me :).
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: BJ Hargrave @ 2011-09-11 16:20 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: git, Junio C Hamano
In-Reply-To: <CAGdFq_hqfqdFyLY=KdA_QW5kH8Kjhx8Y18mHEga_Pdv8yzB2wg@mail.gmail.com>
On Sep 11, 2011, at 12:03 , Sverre Rabbelier wrote:
> Heya,
>
> On Sun, Sep 11, 2011 at 17:40, BJ Hargrave <bj@bjhargrave.com> wrote:
>> fsck --lost-found died when attempting to write out the empty blob.
>> Avoid calling fwrite when the blob size is zero since the call to
>> fwrite returns 0 objects written which fails the check and caused
>> fsck to die.
>
> Now we don't die at all if a 0-byte file couldn't be written.
> Shouldn't we check errno or something?
>
You don't need to write anything to the 0-byte file. Just create it and close it and there are checks already that verify the fopen and fclose do not fail. So I don't think we are missing any error conditions here.
> --
> Cheers,
>
> Sverre Rabbelier
--
BJ Hargrave
^ permalink raw reply
* Re: [PATCH] Support empty blob in fsck --lost-found
From: Sverre Rabbelier @ 2011-09-11 16:03 UTC (permalink / raw)
To: BJ Hargrave; +Cc: git, Junio C Hamano
In-Reply-To: <A3964281-B24B-46C0-AE73-0CCB4C12556F@bjhargrave.com>
Heya,
On Sun, Sep 11, 2011 at 17:40, BJ Hargrave <bj@bjhargrave.com> wrote:
> fsck --lost-found died when attempting to write out the empty blob.
> Avoid calling fwrite when the blob size is zero since the call to
> fwrite returns 0 objects written which fails the check and caused
> fsck to die.
Now we don't die at all if a 0-byte file couldn't be written.
Shouldn't we check errno or something?
--
Cheers,
Sverre Rabbelier
^ 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