Git development
 help / color / mirror / Atom feed
* Re: [PATCH] http-push: refactor lock-related headers creation for curl  requests
From: Johannes Schindelin @ 2009-01-24  4:11 UTC (permalink / raw)
  To: Ray Chuan; +Cc: git
In-Reply-To: <be6fef0d0901231800t6943b01dwbca976d5e9f3397@mail.gmail.com>

Hi,

On Sat, 24 Jan 2009, Ray Chuan wrote:

> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Make that an Acked-by:

> +	if(options & DAV_HEADER_IF) {
> +		strbuf_addf(&buf, "If: (<%s>)", lock->token);
> +		dav_headers = curl_slist_append(dav_headers, buf.buf);
> +		strbuf_reset(&buf);

BTW in case anyone is puzzled (like I was): curl_slist_append() takes a 
"char *" as second parameter, but does not take custody of the buffer; 
instead, it strdup()s it.  See
http://cool.haxx.se/cvs.cgi/curl/lib/sendf.c?rev=1.155&content-type=text/vnd.viewcvs-markup
for details.

BTNW this should be mentioned in the commit message, too, to spare other 
people the puzzlement.

Ciao,
Dscho

^ permalink raw reply

* [PATCH] Use time_t for timestamps returned by approxidate() instead of unsigned
From: Tim Henigan @ 2009-01-22 23:07 UTC (permalink / raw)
  To: git; +Cc: gitster, Tim Henigan

Use time_t for timestamps returned by approxidate() instead of unsigned
long.  All references to approxidate were checked as well as references
to OPT_DATE.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
---

This is the first patch I have submitted, so please be brutal in your review so that I may learn ;).

This patch is intended to close one of the "Janitor" tasks listed in the GitWiki.  The change from unsigned long to time_t reached further than I originally anticipated as I looked into all the places where timestamps are used.  Please let me know if I should limit the scope of the changes to only the immediate consumers of values returned by approxidate().

There is at least one place in the code (builtin-for-each-ref.c:370) where what looks like a timestamp is compared against ULONG_MAX.  At first glance this sounds like a bad idea, but within the context of that function (grab_date) it appears to be safe.

-Tim

 Documentation/technical/api-parse-options.txt |    4 ++--
 builtin-gc.c                                  |    2 +-
 builtin-prune.c                               |    2 +-
 builtin-reflog.c                              |    4 ++--
 builtin-show-branch.c                         |    2 +-
 cache.h                                       |    2 +-
 date.c                                        |    2 +-
 parse-options.c                               |    2 +-
 reflog-walk.c                                 |    4 ++--
 refs.c                                        |    2 +-
 refs.h                                        |    2 +-
 revision.h                                    |    4 ++--
 sha1_name.c                                   |    2 +-
 test-parse-options.c                          |    2 +-
 14 files changed, 18 insertions(+), 18 deletions(-)
 mode change 100644 => 100755 builtin-gc.c
 mode change 100644 => 100755 builtin-reflog.c
 mode change 100644 => 100755 builtin-show-branch.c
 mode change 100644 => 100755 cache.h
 mode change 100644 => 100755 date.c
 mode change 100644 => 100755 parse-options.c
 mode change 100644 => 100755 reflog-walk.c
 mode change 100644 => 100755 refs.c
 mode change 100644 => 100755 refs.h
 mode change 100644 => 100755 revision.c
 mode change 100644 => 100755 revision.h
 mode change 100644 => 100755 sha1_name.c

diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt
index 539863b..c1dd29d 100644
--- a/Documentation/technical/api-parse-options.txt
+++ b/Documentation/technical/api-parse-options.txt
@@ -125,9 +125,9 @@ There are some macros to easily define options:
 	Introduce an option with integer argument.
 	The integer is put into `int_var`.
 
-`OPT_DATE(short, long, &int_var, description)`::
+`OPT_DATE(short, long, &time_var, description)`::
 	Introduce an option with date argument, see `approxidate()`.
-	The timestamp is put into `int_var`.
+	The timestamp is put into `time_var`.
 
 `OPT_CALLBACK(short, long, &var, arg_str, description, func_ptr)`::
 	Introduce an option with argument.
diff --git a/builtin-gc.c b/builtin-gc.c
old mode 100644
new mode 100755
index a201438..eea891b
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -58,7 +58,7 @@ static int gc_config(const char *var, const char *value, void *cb)
 	}
 	if (!strcmp(var, "gc.pruneexpire")) {
 		if (value && strcmp(value, "now")) {
-			unsigned long now = approxidate("now");
+			time_t now = approxidate("now");
 			if (approxidate(value) >= now)
 				return error("Invalid %s: '%s'", var, value);
 		}
diff --git a/builtin-prune.c b/builtin-prune.c
index 545e9c1..a0f1a63 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -13,7 +13,7 @@ static const char * const prune_usage[] = {
 };
 static int show_only;
 static int verbose;
-static unsigned long expire;
+static time_t expire;
 
 static int prune_tmp_object(const char *path, const char *filename)
 {
diff --git a/builtin-reflog.c b/builtin-reflog.c
old mode 100644
new mode 100755
index d95f515..bae0c3e
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -361,7 +361,7 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
 	return ent;
 }
 
-static int parse_expire_cfg_value(const char *var, const char *value, unsigned long *expire)
+static int parse_expire_cfg_value(const char *var, const char *value, time_t *expire)
 {
 	if (!value)
 		return config_error_nonbool(var);
@@ -380,7 +380,7 @@ static int parse_expire_cfg_value(const char *var, const char *value, unsigned l
 static int reflog_expire_config(const char *var, const char *value, void *cb)
 {
 	const char *lastdot = strrchr(var, '.');
-	unsigned long expire;
+	time_t expire;
 	int slot;
 	struct reflog_expire_cfg *ent;
 
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
old mode 100644
new mode 100755
index 306b850..695d553
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -716,7 +716,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 			base = strtoul(reflog_base, &ep, 10);
 			if (*ep) {
 				/* Ah, that is a date spec... */
-				unsigned long at;
+				time_t at;
 				at = approxidate(reflog_base);
 				read_ref_at(ref, at, -1, sha1, NULL,
 					    NULL, NULL, &base);
diff --git a/cache.h b/cache.h
old mode 100644
new mode 100755
index 8d965b8..397adf1
--- a/cache.h
+++ b/cache.h
@@ -699,7 +699,7 @@ enum date_mode {
 const char *show_date(unsigned long time, int timezone, enum date_mode mode);
 int parse_date(const char *date, char *buf, int bufsize);
 void datestamp(char *buf, int bufsize);
-unsigned long approxidate(const char *);
+time_t approxidate(const char *);
 enum date_mode parse_date_format(const char *format);
 
 #define IDENT_WARN_ON_NO_NAME  1
diff --git a/date.c b/date.c
old mode 100644
new mode 100755
index 950b88f..5971266
--- a/date.c
+++ b/date.c
@@ -841,7 +841,7 @@ static const char *approxidate_digit(const char *date, struct tm *tm, int *num)
 	return end;
 }
 
-unsigned long approxidate(const char *date)
+time_t approxidate(const char *date)
 {
 	int number = 0;
 	struct tm tm, now;
diff --git a/parse-options.c b/parse-options.c
old mode 100644
new mode 100755
index 9eb55cc..0501ee2
--- a/parse-options.c
+++ b/parse-options.c
@@ -480,7 +480,7 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset)
 int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
 			     int unset)
 {
-	*(unsigned long *)(opt->value) = approxidate(arg);
+	*(time_t *)(opt->value) = approxidate(arg);
 	return 0;
 }
 
diff --git a/reflog-walk.c b/reflog-walk.c
old mode 100644
new mode 100755
index f751fdc..73b4932
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -68,7 +68,7 @@ static struct complete_reflogs *read_complete_reflog(const char *ref)
 }
 
 static int get_reflog_recno_by_time(struct complete_reflogs *array,
-	unsigned long timestamp)
+	time_t timestamp)
 {
 	int i;
 	for (i = array->nr - 1; i >= 0; i--)
@@ -139,7 +139,7 @@ void init_reflog_walk(struct reflog_walk_info** info)
 int add_reflog_for_walk(struct reflog_walk_info *info,
 		struct commit *commit, const char *name)
 {
-	unsigned long timestamp = 0;
+	time_t timestamp = 0;
 	int recno = -1;
 	struct string_list_item *item;
 	struct complete_reflogs *reflogs;
diff --git a/refs.c b/refs.c
old mode 100644
new mode 100755
index 33ced65..63327b8
--- a/refs.c
+++ b/refs.c
@@ -1347,7 +1347,7 @@ static char *ref_msg(const char *line, const char *endp)
 	return xmemdupz(line, ep - line);
 }
 
-int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt)
+int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt)
 {
 	const char *logfile, *logdata, *logend, *rec, *lastgt, *lastrec;
 	char *tz_c;
diff --git a/refs.h b/refs.h
old mode 100644
new mode 100755
index 06ad260..262728c
--- a/refs.h
+++ b/refs.h
@@ -55,7 +55,7 @@ extern void unlock_ref(struct ref_lock *lock);
 extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
 
 /** Reads log for the value of ref during at_time. **/
-extern int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt);
+extern int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt);
 
 /* iterate over reflog entries */
 typedef int each_reflog_ent_fn(unsigned char *osha1, unsigned char *nsha1, const char *, unsigned long, int, const char *, void *);
diff --git a/revision.c b/revision.c
old mode 100644
new mode 100755
diff --git a/revision.h b/revision.h
old mode 100644
new mode 100755
index 7cf8487..660607b
--- a/revision.h
+++ b/revision.h
@@ -106,8 +106,8 @@ struct rev_info {
 	/* special limits */
 	int skip_count;
 	int max_count;
-	unsigned long max_age;
-	unsigned long min_age;
+	time_t max_age;
+	time_t min_age;
 
 	/* diff info for patches and for paths limiting */
 	struct diff_options diffopt;
diff --git a/sha1_name.c b/sha1_name.c
old mode 100644
new mode 100755
index 159c2ab..fe915c8
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -339,7 +339,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 
 	if (reflog_len) {
 		int nth, i;
-		unsigned long at_time;
+		time_t at_time;
 		unsigned long co_time;
 		int co_tz, co_cnt;
 
diff --git a/test-parse-options.c b/test-parse-options.c
index 61d2c39..c8d110d 100644
--- a/test-parse-options.c
+++ b/test-parse-options.c
@@ -3,7 +3,7 @@
 
 static int boolean = 0;
 static int integer = 0;
-static unsigned long timestamp;
+static time_t timestamp;
 static int abbrev = 7;
 static int verbose = 0, dry_run = 0, quiet = 0;
 static char *string = NULL;
-- 
1.6.0.6


>From 22354d185e5c89a5b492898b9b5eba429fed85d3 Mon Sep 17 00:00:00 2001
From: Tim Henigan <tim.henigan@gmail.com>
Date: Thu, 22 Jan 2009 16:08:42 -0500
Subject: [PATCH] Further changes to migrate timestamp vars in the code from type unsigned long to time_t.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
---
 builtin-cat-file.c    |    2 +-
 builtin-reflog.c      |   18 +++++++++---------
 builtin-show-branch.c |    2 +-
 date.c                |    4 ++--
 refs.c                |    6 +++---
 refs.h                |    2 +-
 sha1_name.c           |    2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 8fad19d..1d7a361 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -42,7 +42,7 @@ static void pprint_tag(const unsigned char *sha1, const char *buf, unsigned long
 					 */
 					const char *sp = tagger;
 					char *ep;
-					unsigned long date;
+					time_t date;
 					long tz;
 					while (sp < cp && *sp != '>')
 						sp++;
diff --git a/builtin-reflog.c b/builtin-reflog.c
index bae0c3e..74284af 100755
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -17,8 +17,8 @@ static const char reflog_expire_usage[] =
 static const char reflog_delete_usage[] =
 "git reflog delete [--verbose] [--dry-run] [--rewrite] [--updateref] <refs>...";
 
-static unsigned long default_reflog_expire;
-static unsigned long default_reflog_expire_unreachable;
+static time_t default_reflog_expire;
+static time_t default_reflog_expire_unreachable;
 
 struct cmd_reflog_expire_cb {
 	struct rev_info revs;
@@ -27,8 +27,8 @@ struct cmd_reflog_expire_cb {
 	int rewrite;
 	int updateref;
 	int verbose;
-	unsigned long expire_total;
-	unsigned long expire_unreachable;
+	time_t expire_total;
+	time_t expire_unreachable;
 	int recno;
 };
 
@@ -210,7 +210,7 @@ static int keep_entry(struct commit **it, unsigned char *sha1)
 }
 
 static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
-		const char *email, unsigned long timestamp, int tz,
+		const char *email, time_t timestamp, int tz,
 		const char *message, void *cb_data)
 {
 	struct expire_reflog_cb *cb = cb_data;
@@ -335,8 +335,8 @@ static int collect_reflog(const char *ref, const unsigned char *sha1, int unused
 
 static struct reflog_expire_cfg {
 	struct reflog_expire_cfg *next;
-	unsigned long expire_total;
-	unsigned long expire_unreachable;
+	time_t expire_total;
+	time_t expire_unreachable;
 	size_t len;
 	char pattern[FLEX_ARRAY];
 } *reflog_expire_cfg, **reflog_expire_cfg_tail;
@@ -462,7 +462,7 @@ static void set_reflog_expiry_param(struct cmd_reflog_expire_cb *cb, int slot, c
 static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
 {
 	struct cmd_reflog_expire_cb cb;
-	unsigned long now = time(NULL);
+	time_t now = time(NULL);
 	int i, status, do_all;
 	int explicit_expiry = 0;
 
@@ -554,7 +554,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
 }
 
 static int count_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
-		const char *email, unsigned long timestamp, int tz,
+		const char *email, time_t timestamp, int tz,
 		const char *message, void *cb_data)
 {
 	struct cmd_reflog_expire_cb *cb = cb_data;
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 695d553..73b3dc0 100755
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -726,7 +726,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 		for (i = 0; i < reflog; i++) {
 			char *logmsg, *m;
 			const char *msg;
-			unsigned long timestamp;
+			time_t timestamp;
 			int tz;
 
 			if (read_ref_at(ref, 0, base+i, sha1, &logmsg,
diff --git a/date.c b/date.c
index 5971266..d185ea6 100755
--- a/date.c
+++ b/date.c
@@ -84,13 +84,13 @@ static int local_tzoffset(unsigned long time)
 	return offset * eastwest;
 }
 
-const char *show_date(unsigned long time, int tz, enum date_mode mode)
+const char *show_date(time_t time, int tz, enum date_mode mode)
 {
 	struct tm *tm;
 	static char timebuf[200];
 
 	if (mode == DATE_RELATIVE) {
-		unsigned long diff;
+		time_t diff;
 		struct timeval now;
 		gettimeofday(&now, NULL);
 		if (now.tv_sec < time)
diff --git a/refs.c b/refs.c
index 63327b8..159d136 100755
--- a/refs.c
+++ b/refs.c
@@ -1347,13 +1347,13 @@ static char *ref_msg(const char *line, const char *endp)
 	return xmemdupz(line, ep - line);
 }
 
-int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt)
+int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, time_t *cutoff_time, int *cutoff_tz, int *cutoff_cnt)
 {
 	const char *logfile, *logdata, *logend, *rec, *lastgt, *lastrec;
 	char *tz_c;
 	int logfd, tz, reccnt = 0;
 	struct stat st;
-	unsigned long date;
+	time_t date;
 	unsigned char logged_sha1[20];
 	void *log_mapped;
 	size_t mapsz;
@@ -1467,7 +1467,7 @@ int for_each_reflog_ent(const char *ref, each_reflog_ent_fn fn, void *cb_data)
 	while (fgets(buf, sizeof(buf), logfp)) {
 		unsigned char osha1[20], nsha1[20];
 		char *email_end, *message;
-		unsigned long timestamp;
+		time_t timestamp;
 		int len, tz;
 
 		/* old SP new SP name <email> SP time TAB msg LF */
diff --git a/refs.h b/refs.h
index 262728c..604d5a3 100755
--- a/refs.h
+++ b/refs.h
@@ -55,7 +55,7 @@ extern void unlock_ref(struct ref_lock *lock);
 extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
 
 /** Reads log for the value of ref during at_time. **/
-extern int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, unsigned long *cutoff_time, int *cutoff_tz, int *cutoff_cnt);
+extern int read_ref_at(const char *ref, time_t at_time, int cnt, unsigned char *sha1, char **msg, time_t *cutoff_time, int *cutoff_tz, int *cutoff_cnt);
 
 /* iterate over reflog entries */
 typedef int each_reflog_ent_fn(unsigned char *osha1, unsigned char *nsha1, const char *, unsigned long, int, const char *, void *);
diff --git a/sha1_name.c b/sha1_name.c
index fe915c8..8a65def 100755
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -340,7 +340,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
 	if (reflog_len) {
 		int nth, i;
 		time_t at_time;
-		unsigned long co_time;
+		time_t co_time;
 		int co_tz, co_cnt;
 
 		/* Is it asking for N-th entry, or approxidate? */
-- 
1.6.0.6


>From 7fb1e3d6390d46433e7ce10841bf11cab3b1d0ff Mon Sep 17 00:00:00 2001
From: Tim Henigan <tim.henigan@gmail.com>
Date: Thu, 22 Jan 2009 17:08:06 -0500
Subject: [PATCH] Final changes to convert unsigned longs to time_t

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
---
 cache.h       |    2 +-
 date.c        |    8 ++++----
 pretty.c      |    4 ++--
 reflog-walk.c |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/cache.h b/cache.h
index 397adf1..a18730c 100755
--- a/cache.h
+++ b/cache.h
@@ -696,7 +696,7 @@ enum date_mode {
 	DATE_RFC2822
 };
 
-const char *show_date(unsigned long time, int timezone, enum date_mode mode);
+const char *show_date(time_t time, int timezone, enum date_mode mode);
 int parse_date(const char *date, char *buf, int bufsize);
 void datestamp(char *buf, int bufsize);
 time_t approxidate(const char *);
diff --git a/date.c b/date.c
index d185ea6..59b4426 100755
--- a/date.c
+++ b/date.c
@@ -37,7 +37,7 @@ static const char *weekday_names[] = {
 	"Sundays", "Mondays", "Tuesdays", "Wednesdays", "Thursdays", "Fridays", "Saturdays"
 };
 
-static time_t gm_time_t(unsigned long time, int tz)
+static time_t gm_time_t(time_t time, int tz)
 {
 	int minutes;
 
@@ -52,7 +52,7 @@ static time_t gm_time_t(unsigned long time, int tz)
  * thing, which means that tz -0100 is passed in as the integer -100,
  * even though it means "sixty minutes off"
  */
-static struct tm *time_to_tm(unsigned long time, int tz)
+static struct tm *time_to_tm(time_t time, int tz)
 {
 	time_t t = gm_time_t(time, tz);
 	return gmtime(&t);
@@ -62,7 +62,7 @@ static struct tm *time_to_tm(unsigned long time, int tz)
  * What value of "tz" was in effect back then at "time" in the
  * local timezone?
  */
-static int local_tzoffset(unsigned long time)
+static int local_tzoffset(time_t time)
 {
 	time_t t, t_local;
 	struct tm tm;
@@ -632,7 +632,7 @@ void datestamp(char *buf, int bufsize)
 	date_string(now, offset, buf, bufsize);
 }
 
-static void update_tm(struct tm *tm, unsigned long sec)
+static void update_tm(struct tm *tm, time_t sec)
 {
 	time_t n = mktime(tm) - sec;
 	localtime_r(&n, tm);
diff --git a/pretty.c b/pretty.c
index cc460b5..6ab3222 100644
--- a/pretty.c
+++ b/pretty.c
@@ -126,7 +126,7 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,
 {
 	char *date;
 	int namelen;
-	unsigned long time;
+	time_t time;
 	int tz;
 	const char *filler = "    ";
 
@@ -330,7 +330,7 @@ static size_t format_person_part(struct strbuf *sb, char part,
 	/* currently all placeholders have same length */
 	const int placeholder_len = 2;
 	int start, end, tz = 0;
-	unsigned long date = 0;
+	time_t date = 0;
 	char *ep;
 
 	/* advance 'end' to point to email start delimiter */
diff --git a/reflog-walk.c b/reflog-walk.c
index 73b4932..1bc9675 100755
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -11,7 +11,7 @@ struct complete_reflogs {
 	struct reflog_info {
 		unsigned char osha1[20], nsha1[20];
 		char *email;
-		unsigned long timestamp;
+		time_t timestamp;
 		int tz;
 		char *message;
 	} *items;
-- 
1.6.0.6

^ permalink raw reply related

* Re: [RFC PATCH (GIT-GUI/CORE BUG)] git-gui: Avoid an infinite rescan loop in handle_empty_diff.
From: Junio C Hamano @ 2009-01-24  3:29 UTC (permalink / raw)
  To: Alexander Gavrilov; +Cc: git, Shawn O. Pearce, Andy Davey, kbro
In-Reply-To: <200901240052.58259.angavrilov@gmail.com>

Alexander Gavrilov <angavrilov@gmail.com> writes:

>     $ git config core.autocrlf true

This operation, when done in an already populated work tree, invalidates
all the state that is cached in the index, and you would need to adjust
things to the altered reality caused by this operation before doing
anything else.  There are different reasons you would want to flip the
configuration after you have files in your work tree, and depending on the
situation, the correct adjustment would differ.

You may have started a project in this repository, your work tree files
all have CRLF endings that is your platform convention, and after adding
the files to the index (but before making a commit) you may have realized
that you would want to keep your project cross platform, and that may be
the reason you are flipping the configuration.  If that is the case, your
index is already contaminated with CRLF, but your files have the line
ending that is correct (for you).  You would want to remove the index and
"add ." to stage everything again before proceeding, to have the autocrlf
mechanism to correct the line endings in the repository objects.

This would be the best case in one extreme.

On the other hand, you may have cloned a cross platform project from
elsewhere (in other words, your objects and the index have the correct
line ending), the checkout was done without autocrlf and it does not match
the local filesystem convention to use CRLF, and that may be the reason
you are flipping the configuration.  If that is the case, before making
any changes to the work tree files, the right adjustment would be to
remove the index, and "reset --hard" to force a checkout that follows your
autocrlf settings, so that the work tree files are corrected.

This would be the best case in the other end of the extreme.

And there will be different cases in between these extremes.

I think clueful users who flips the configuration from the command line
would know all of the above, know what they want and can tell what the
best course of action would be, but I at the same time wonder if git-gui
should (and if so, can) offer a simple and safe way to help this process
from others.

^ permalink raw reply

* Re: how to force a commit date matching info from a mbox ?
From: Jeff King @ 2009-01-24  2:35 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON
In-Reply-To: <alpine.DEB.1.00.0901240242270.3586@pacific.mpi-cbg.de>

On Sat, Jan 24, 2009 at 02:43:47AM +0100, Johannes Schindelin wrote:

> > I think that is not a new problem. Quite a few patches are "how about
> > this" patches in the middle of a thread, and leave the old subject.
> > IMHO, that is a failing of the tool in not tracking common practice, not
> > the other way around.
> 
> You know exactly what "fixing the tool" would mean.

Yes, I know. I think Pasky's tool is a clever hack, but I never expected
it to be comprehensive in its results. At the GitTogether, we discussed
some interesting ideas for tracking the mailing list and showing a more
patch-oriented view, but those would be a lot of work, and I am not
volunteering to do it right now.

What I meant by my comment was that I am not too concerned with tweaking
my workflow to help Pasky's tool.

-Peff

^ permalink raw reply

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
From: malc @ 2009-01-24  2:01 UTC (permalink / raw)
  To: git
In-Reply-To: <874ozp79y4.fsf@Astalo.kon.iki.fi>

Kalle Olavi Niemitalo <kon@iki.fi> writes:

> Vassili Karpov <av1474@comtv.ru> writes:
>
>> #ooctal syntax on the other hand produces integers everywhere.
>
> GNU Emacs 20.7 doesn't support #o, but neither does it include

Bummer

> the ewoc and log-edit libraries required by the current git.el.

ewoc and log-edit are not part of XEmacs 21.4.20 (the version i am
using), furthermore make-temp-file is not available either, but those
problems, unlike the case/eql/literals issue, can be resolved without
touching git.el (One might argue that case can be fixed with defadvice
or other hackery, but that's a bit too much)

> It would be nice to have a comment in git.el saying which
> versions of Emacs and XEmacs it is supposed to support, but I
> guess people wouldn't bother testing those on every commit.

Well it doesn't "support" XEmacs at all.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply

* [PATCH] http-push: refactor lock-related headers creation for curl  requests
From: Ray Chuan @ 2009-01-24  2:00 UTC (permalink / raw)
  To: git, Johannes Schindelin

Currently, DAV-related headers (more specifically, headers related to
the lock token, namely, If, Lock-Token, and Timeout) for curl requests
are created and allocated individually, eg a "if_header" variable for
the "If: " header, a "timeout_header" variable for the "Timeout: "
header.

This patch provides a new function ("get_dav_token_headers") that
creates these header, saving methods from allocating memory, and from
issuing a "curl_slist_append" call.

In part, this patch also addresses the fact that commit 753bc91
(Remove the requirement opaquelocktoken uri scheme) did not update
memory allocations for DAV-related headers.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 http-push.c |   68 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/http-push.c b/http-push.c
index cb5bf95..eca4a8e 100644
--- a/http-push.c
+++ b/http-push.c
@@ -177,6 +177,37 @@ struct remote_ls_ctx
 	struct remote_ls_ctx *parent;
 };

+/* get_dav_token_headers options */
+enum dav_header_flag {
+	DAV_HEADER_IF = (1u << 0),
+	DAV_HEADER_LOCK = (1u << 1),
+	DAV_HEADER_TIMEOUT = (1u << 2)
+};
+
+static struct curl_slist *get_dav_token_headers(struct remote_lock
*lock, enum dav_header_flag options) {
+	struct strbuf buf = STRBUF_INIT;
+	struct curl_slist *dav_headers = NULL;
+
+	if(options & DAV_HEADER_IF) {
+		strbuf_addf(&buf, "If: (<%s>)", lock->token);
+		dav_headers = curl_slist_append(dav_headers, buf.buf);
+		strbuf_reset(&buf);
+	}
+	if(options & DAV_HEADER_LOCK) {
+		strbuf_addf(&buf, "Lock-Token: <%s>", lock->token);
+		dav_headers = curl_slist_append(dav_headers, buf.buf);
+		strbuf_reset(&buf);
+	}
+	if(options & DAV_HEADER_TIMEOUT) {
+		strbuf_addf(&buf, "Timeout: Second-%ld", lock->timeout);
+		dav_headers = curl_slist_append(dav_headers, buf.buf);
+		strbuf_reset(&buf);
+	}
+	strbuf_release(&buf);
+
+	return dav_headers;
+}
+
 static void finish_request(struct transfer_request *request);
 static void release_request(struct transfer_request *request);

@@ -588,18 +619,12 @@ static int refresh_lock(struct remote_lock *lock)
 {
 	struct active_request_slot *slot;
 	struct slot_results results;
-	char *if_header;
-	char timeout_header[25];
-	struct curl_slist *dav_headers = NULL;
+	struct curl_slist *dav_headers;
 	int rc = 0;

 	lock->refreshing = 1;

-	if_header = xmalloc(strlen(lock->token) + 25);
-	sprintf(if_header, "If: (<%s>)", lock->token);
-	sprintf(timeout_header, "Timeout: Second-%ld", lock->timeout);
-	dav_headers = curl_slist_append(dav_headers, if_header);
-	dav_headers = curl_slist_append(dav_headers, timeout_header);
+	dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF | DAV_HEADER_TIMEOUT);

 	slot = get_active_slot();
 	slot->results = &results;
@@ -622,7 +647,6 @@ static int refresh_lock(struct remote_lock *lock)

 	lock->refreshing = 0;
 	curl_slist_free_all(dav_headers);
-	free(if_header);

 	return rc;
 }
@@ -1303,14 +1327,10 @@ static int unlock_remote(struct remote_lock *lock)
 	struct active_request_slot *slot;
 	struct slot_results results;
 	struct remote_lock *prev = remote->locks;
-	char *lock_token_header;
-	struct curl_slist *dav_headers = NULL;
+	struct curl_slist *dav_headers;
 	int rc = 0;

-	lock_token_header = xmalloc(strlen(lock->token) + 31);
-	sprintf(lock_token_header, "Lock-Token: <%s>",
-		lock->token);
-	dav_headers = curl_slist_append(dav_headers, lock_token_header);
+	dav_headers = get_dav_token_headers(lock, DAV_HEADER_LOCK);

 	slot = get_active_slot();
 	slot->results = &results;
@@ -1331,7 +1351,6 @@ static int unlock_remote(struct remote_lock *lock)
 	}

 	curl_slist_free_all(dav_headers);
-	free(lock_token_header);

 	if (remote->locks == lock) {
 		remote->locks = lock->next;
@@ -1731,13 +1750,10 @@ static int update_remote(unsigned char *sha1,
struct remote_lock *lock)
 {
 	struct active_request_slot *slot;
 	struct slot_results results;
-	char *if_header;
 	struct buffer out_buffer = { STRBUF_INIT, 0 };
-	struct curl_slist *dav_headers = NULL;
+	struct curl_slist *dav_headers;

-	if_header = xmalloc(strlen(lock->token) + 25);
-	sprintf(if_header, "If: (<%s>)", lock->token);
-	dav_headers = curl_slist_append(dav_headers, if_header);
+	dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF);

 	strbuf_addf(&out_buffer.buf, "%s\n", sha1_to_hex(sha1));

@@ -1756,7 +1772,6 @@ static int update_remote(unsigned char *sha1,
struct remote_lock *lock)
 	if (start_active_slot(slot)) {
 		run_active_slot(slot);
 		strbuf_release(&out_buffer.buf);
-		free(if_header);
 		if (results.curl_result != CURLE_OK) {
 			fprintf(stderr,
 				"PUT error: curl result=%d, HTTP code=%ld\n",
@@ -1766,7 +1781,6 @@ static int update_remote(unsigned char *sha1,
struct remote_lock *lock)
 		}
 	} else {
 		strbuf_release(&out_buffer.buf);
-		free(if_header);
 		fprintf(stderr, "Unable to start PUT request\n");
 		return 0;
 	}
@@ -1948,15 +1962,12 @@ static void update_remote_info_refs(struct
remote_lock *lock)
 	struct buffer buffer = { STRBUF_INIT, 0 };
 	struct active_request_slot *slot;
 	struct slot_results results;
-	char *if_header;
-	struct curl_slist *dav_headers = NULL;
+	struct curl_slist *dav_headers;

 	remote_ls("refs/", (PROCESS_FILES | RECURSIVE),
 		  add_remote_info_ref, &buffer.buf);
 	if (!aborted) {
-		if_header = xmalloc(strlen(lock->token) + 25);
-		sprintf(if_header, "If: (<%s>)", lock->token);
-		dav_headers = curl_slist_append(dav_headers, if_header);
+		dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF);

 		slot = get_active_slot();
 		slot->results = &results;
@@ -1978,7 +1989,6 @@ static void update_remote_info_refs(struct
remote_lock *lock)
 					results.curl_result, results.http_code);
 			}
 		}
-		free(if_header);
 	}
 	strbuf_release(&buffer.buf);
 }
-- 
1.6.0.4

^ permalink raw reply related

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
From: Kalle Olavi Niemitalo @ 2009-01-24  1:46 UTC (permalink / raw)
  To: git
In-Reply-To: <Pine.LNX.4.64.0901240219530.19590@linmac.oyster.ru>

Vassili Karpov <av1474@comtv.ru> writes:

> #ooctal syntax on the other hand produces integers everywhere.

GNU Emacs 20.7 doesn't support #o, but neither does it include
the ewoc and log-edit libraries required by the current git.el.

It would be nice to have a comment in git.el saying which
versions of Emacs and XEmacs it is supposed to support, but I
guess people wouldn't bother testing those on every commit.

^ permalink raw reply

* [PATCH v2] Change octal literals to be XEmacs friendly
From: malc @ 2009-01-24  1:52 UTC (permalink / raw)
  To: git


The type-of ?\octal in XEmacs is character while in FSF Emacs it is
integer. Case expression using this syntax will not work correctly on
XEmacs. #ooctal syntax on the other hand produces integers everywhere.

Signed-off-by: Vassili Karpov <av1474@comtv.ru>
---
 contrib/emacs/git.el |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 09e8bae..715580a 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -562,29 +562,29 @@ the process output as a string, or nil if the git command failed."
   (let* ((old-type (lsh (or old-perm 0) -9))
 	 (new-type (lsh (or new-perm 0) -9))
 	 (str (case new-type
-		(?\100  ;; file
+		(#o100  ;; file
 		 (case old-type
-		   (?\100 nil)
-		   (?\120 "   (type change symlink -> file)")
-		   (?\160 "   (type change subproject -> file)")))
-		 (?\120  ;; symlink
+		   (#o100 nil)
+		   (#o120 "   (type change symlink -> file)")
+		   (#o160 "   (type change subproject -> file)")))
+		 (#o120  ;; symlink
 		  (case old-type
-		    (?\100 "   (type change file -> symlink)")
-		    (?\160 "   (type change subproject -> symlink)")
+		    (#o100 "   (type change file -> symlink)")
+		    (#o160 "   (type change subproject -> symlink)")
 		    (t "   (symlink)")))
-		  (?\160  ;; subproject
+		  (#o160  ;; subproject
 		   (case old-type
-		     (?\100 "   (type change file -> subproject)")
-		     (?\120 "   (type change symlink -> subproject)")
+		     (#o100 "   (type change file -> subproject)")
+		     (#o120 "   (type change symlink -> subproject)")
 		     (t "   (subproject)")))
-                  (?\110 nil)  ;; directory (internal, not a real git state)
-		  (?\000  ;; deleted or unknown
+                  (#o110 nil)  ;; directory (internal, not a real git state)
+		  (#o000  ;; deleted or unknown
 		   (case old-type
-		     (?\120 "   (symlink)")
-		     (?\160 "   (subproject)")))
+		     (#o120 "   (symlink)")
+		     (#o160 "   (subproject)")))
 		  (t (format "   (unknown type %o)" new-type)))))
     (cond (str (propertize str 'face 'git-status-face))
-          ((eq new-type ?\110) "/")
+          ((eq new-type #o110) "/")
           (t ""))))
 
 (defun git-rename-as-string (info)
-- 
1.6.0.2.GIT


-- 
mailto:av1474@comtv.ru

^ permalink raw reply related

* Re: [RFC PATCH (GIT-GUI/CORE BUG)] git-gui: Avoid an infinite rescan loop in handle_empty_diff.
From: Keith Cascio @ 2009-01-24  1:46 UTC (permalink / raw)
  To: Alexander Gavrilov; +Cc: git, Shawn O Pearce, Junio C Hamano, Andy Davey, kbro
In-Reply-To: <200901240052.58259.angavrilov@gmail.com>

Teach git-gui to check diff's exit code
in order to know whether a file actually
changed or not.

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
---
Alexander,
I encountered the same problem and I tried a different way
to prevent it.  Could you please try this alternative patch
and see if it works in your setup?  If so, it might be
a lower-impact solution.  Even if it doesn't solve your
problem, I think it is still an improvement over what
exists and could co-exist with your patch.
                                     -- Keith Cascio

 git-gui/lib/diff.tcl |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index bbbf15c..94faf95 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -276,6 +276,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
 	}
 
 	lappend cmd -p
+	lappend cmd --exit-code
 	lappend cmd --no-color
 	if {$repo_config(gui.diffcontext) >= 1} {
 		lappend cmd "-U$repo_config(gui.diffcontext)"
@@ -310,6 +311,7 @@ proc read_diff {fd cont_info} {
 	global ui_diff diff_active
 	global is_3way_diff is_conflict_diff current_diff_header
 	global current_diff_queue
+	global errorCode
 
 	$ui_diff conf -state normal
 	while {[gets $fd line] >= 0} {
@@ -397,7 +399,9 @@ proc read_diff {fd cont_info} {
 	$ui_diff conf -state disabled
 
 	if {[eof $fd]} {
-		close $fd
+		fconfigure $fd -blocking 1
+		catch { close $fd } err
+		set diff_exit_status $errorCode
 
 		if {$current_diff_queue ne {}} {
 			advance_diff_queue $cont_info
@@ -413,7 +417,7 @@ proc read_diff {fd cont_info} {
 		}
 		ui_ready
 
-		if {[$ui_diff index end] eq {2.0}} {
+		if {$diff_exit_status eq "NONE"} {
 			handle_empty_diff
 		}
 		set callback [lindex $cont_info 1]
-- 
1.6.1

^ permalink raw reply related

* Re: how to force a commit date matching info from a mbox ?
From: Johannes Schindelin @ 2009-01-24  1:43 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON
In-Reply-To: <20090124005225.GA9864@sigill.intra.peff.net>

Hi,

On Fri, 23 Jan 2009, Jeff King wrote:

> On Sat, Jan 24, 2009 at 01:34:41AM +0100, Johannes Schindelin wrote:
> 
> > > So good to know, and I will start generating my patches differently.
> > 
> > Note that your patches will not be found using Pasky's "mail" link in 
> > gitweb, if you do not put the commit subject into the _real_ mail subject.
> > 
> > Dunno if I like that.
> 
> I think that is not a new problem. Quite a few patches are "how about
> this" patches in the middle of a thread, and leave the old subject.
> IMHO, that is a failing of the tool in not tracking common practice, not
> the other way around.

You know exactly what "fixing the tool" would mean.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
From: Junio C Hamano @ 2009-01-24  1:31 UTC (permalink / raw)
  To: Vassili Karpov; +Cc: git, Alexandre Julliard
In-Reply-To: <Pine.LNX.4.64.0901240219530.19590@linmac.oyster.ru>

Vassili Karpov <av1474@comtv.ru> writes:

Please don't use "format=flowed"; your patch is whitespace damaged and
does not apply.

> The type-of ?\octal in XEmacs is character while in FSF Emacs it is
> integer. Case expression using this syntax will not work correctly on
> XEmacs. #ooctal syntax on the other hand produces integers everywhere.
>
> Signed-off-by: Vassili Karpov <av1474@comtv.ru>
> ---
>  contrib/emacs/git.el |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
> index 09e8bae..715580a 100644
> --- a/contrib/emacs/git.el
> +++ b/contrib/emacs/git.el
> @@ -562,29 +562,29 @@ the process output as a string, or nil if the
> git command failed."
>    (let* ((old-type (lsh (or old-perm 0) -9))
>  	 (new-type (lsh (or new-perm 0) -9))
>  	 (str (case new-type
> -		(?\100  ;; file
> +		(#o100  ;; file
>  		 (case old-type
> -		   (?\100 nil)
> -		   (?\120 "   (type change symlink -> file)")
> -		   (?\160 "   (type change subproject -> file)")))
> -		 (?\120  ;; symlink
> +		   (#o100 nil)
> +		   (#o120 "   (type change symlink -> file)")
> +		   (#o160 "   (type change subproject -> file)")))
> +		 (#o120  ;; symlink
>  		  (case old-type
> -		    (?\100 "   (type change file -> symlink)")
> -		    (?\160 "   (type change subproject -> symlink)")
> +		    (#o100 "   (type change file -> symlink)")
> +		    (#o160 "   (type change subproject -> symlink)")
>  		    (t "   (symlink)")))
> -		  (?\160  ;; subproject
> +		  (#o160  ;; subproject
>  		   (case old-type
> -		     (?\100 "   (type change file -> subproject)")
> -		     (?\120 "   (type change symlink -> subproject)")
> +		     (#o100 "   (type change file -> subproject)")
> +		     (#o120 "   (type change symlink -> subproject)")
>  		     (t "   (subproject)")))
> -                  (?\110 nil)  ;; directory (internal, not a real git
> state)
> -		  (?\000  ;; deleted or unknown
> +                  (#o110 nil)  ;; directory (internal, not a real git
> state)
> +		  (#o000  ;; deleted or unknown
>  		   (case old-type
> -		     (?\120 "   (symlink)")
> -		     (?\160 "   (subproject)")))
> +		     (#o120 "   (symlink)")
> +		     (#o160 "   (subproject)")))
>  		  (t (format "   (unknown type %o)" new-type)))))
>      (cond (str (propertize str 'face 'git-status-face))
> -          ((eq new-type ?\110) "/")
> +          ((eq new-type #o110) "/")
>            (t ""))))
>
>  (defun git-rename-as-string (info)
> -- 
> 1.6.0.2.GIT
>
>
>
> -- 
> mailto:av1474@comtv.ru
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 2/2 (v2)] git-am: Add --ignore-date option
From: Nanako Shiraishi @ 2009-01-24  1:18 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

This new option tells 'git-am' to ignore the date header field
recorded in the format-patch output. The commits will have the
timestamp when they are created instead.

You can work a lot in one day to accumulate many changes, but
apply and push to the public repository only some of them at
the end of the first day. Then next day you can spend all your
working hours reading comics or chatting with your coworkers,
and apply your remaining patches from the previous day using
this option to pretend that you have been working at the end
of the day.

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
---

Added documentation and copied your response about the new
test as a comment.

 Documentation/git-am.txt |   17 ++++++++++++++++-
 git-am.sh                |    8 ++++++++
 t/t4150-am.sh            |   13 +++++++++++++
 3 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 5cbbe76..c10c91b 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -10,7 +10,8 @@ SYNOPSIS
 --------
 [verse]
 'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
-	 [--3way] [--interactive]
+	 [--3way] [--interactive] [--committer-date-is-author-date]
+	 [--ignore-date]
 	 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
 	 [<mbox> | <Maildir>...]
 'git am' (--skip | --resolved | --abort)
@@ -71,6 +72,20 @@ default.   You could use `--no-utf8` to override this.
 --interactive::
 	Run interactively.
 
+--committer-date-is-author-date::
+	By default the command records the date from the e-mail
+	message as the commit author date, and uses the time of
+	commit creation as the committer date. This allows the
+	user to lie about the committer date by using the same
+	timestamp as the author date.
+
+--ignore-date::
+	By default the command records the date from the e-mail
+	message as the commit author date, and uses the time of
+	commit creation as the committer date. This allows the
+	user to lie about author timestamp by using the same
+	timestamp as the committer date.
+
 --skip::
 	Skip the current patch.  This is only meaningful when
 	restarting an aborted patch.
diff --git a/git-am.sh b/git-am.sh
index e96071d..f935178 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -24,6 +24,7 @@ r,resolved      to be used after a patch failure
 skip            skip the current patch
 abort           restore the original branch and abort the patching operation.
 committer-date-is-author-date    lie about committer date
+ignore-date     use current timestamp for author date
 rebasing        (internal use for git-rebase)"
 
 . git-sh-setup
@@ -135,6 +136,7 @@ sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
 committer_date_is_author_date=
+ignore_date=
 
 while test $# != 0
 do
@@ -172,6 +174,8 @@ do
 		git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
 	--committer-date-is-author-date)
 		committer_date_is_author_date=t ;;
+	--ignore-date)
+		ignore_date=t ;;
 	--)
 		shift; break ;;
 	*)
@@ -526,6 +530,10 @@ do
 	tree=$(git write-tree) &&
 	parent=$(git rev-parse --verify HEAD) &&
 	commit=$(
+		if test -n "$ignore_date"
+		then
+			GIT_AUTHOR_DATE=
+		fi
 		if test -n "$committer_date_is_author_date"
 		then
 			GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8d3fb00..2ad9048 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -277,4 +277,17 @@ test_expect_success 'am without --committer-date-is-author-date' '
 	test "$at" != "$ct"
 '
 
+# This checks for +0000 because TZ is set to UTC and that should
+# show up when the current time is used. The date in message is set
+# by test_tick that uses -0700 timezone; if this feature does not
+# work, we will see that instead of +0000.
+test_expect_success 'am --ignore-date' '
+	git checkout first &&
+	test_tick &&
+	git am --ignore-date patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	echo "$at" | grep "+0000"
+'
+
 test_done
-- 
1.6.1

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply related

* [PATCH 1/2] am: Add --committer-date-is-author-date option
From: Nanako Shiraishi @ 2009-01-24  1:17 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

From: Junio C Hamano <gitster@pobox.com>
Date: Thu, 22 Jan 2009 16:14:58 -0800

This new option tells 'git-am' to use the timestamp recorded
in the Email message as both author and committer date.

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
---
 git-am.sh     |   13 ++++++++++++-
 t/t4150-am.sh |   20 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index e20dd88..e96071d 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -23,6 +23,7 @@ resolvemsg=     override error message when patch failure occurs
 r,resolved      to be used after a patch failure
 skip            skip the current patch
 abort           restore the original branch and abort the patching operation.
+committer-date-is-author-date    lie about committer date
 rebasing        (internal use for git-rebase)"
 
 . git-sh-setup
@@ -133,6 +134,7 @@ dotest="$GIT_DIR/rebase-apply"
 sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
+committer_date_is_author_date=
 
 while test $# != 0
 do
@@ -168,6 +170,8 @@ do
 		git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;;
 	-C|-p)
 		git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
+	--committer-date-is-author-date)
+		committer_date_is_author_date=t ;;
 	--)
 		shift; break ;;
 	*)
@@ -521,7 +525,14 @@ do
 
 	tree=$(git write-tree) &&
 	parent=$(git rev-parse --verify HEAD) &&
-	commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
+	commit=$(
+		if test -n "$committer_date_is_author_date"
+		then
+			GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+			export GIT_COMMITTER_DATE
+		fi &&
+		git commit-tree $tree -p $parent <"$dotest/final-commit"
+	) &&
 	git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
 	stop_here $this
 
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 796f795..8d3fb00 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -257,4 +257,24 @@ test_expect_success 'am works from file (absolute path given) in subdirectory' '
 	test -z "$(git diff second)"
 '
 
+test_expect_success 'am --committer-date-is-author-date' '
+	git checkout first &&
+	test_tick &&
+	git am --committer-date-is-author-date patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	ct=$(sed -ne "/^committer /s/.*> //p" head1) &&
+	test "$at" = "$ct"
+'
+
+test_expect_success 'am without --committer-date-is-author-date' '
+	git checkout first &&
+	test_tick &&
+	git am patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	ct=$(sed -ne "/^committer /s/.*> //p" head1) &&
+	test "$at" != "$ct"
+'
+
 test_done
-- 
1.6.1

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply related

* Re: [PATCH] git-am: implement --reject option passed to git-apply
From: Junio C Hamano @ 2009-01-24  0:59 UTC (permalink / raw)
  To: martin f. krafft; +Cc: git, penny leach
In-Reply-To: <1232670681-25781-1-git-send-email-madduck@madduck.net>

"martin f. krafft" <madduck@madduck.net> writes:

> The patch does not touch t/t4252-am-options.sh (yet) because I do not really
> understand how the testing system works.

I'll squash this in, then.

Thanks.

 t/t4252-am-options.sh |   11 ++++++++++-
 t/t4252/am-test-6-1   |   21 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git c/t/t4252-am-options.sh i/t/t4252-am-options.sh
index 5fdd188..f603c1b 100755
--- c/t/t4252-am-options.sh
+++ i/t/t4252-am-options.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='git am not losing options'
+test_description='git am with options and not losing them'
 . ./test-lib.sh
 
 tm="$TEST_DIRECTORY/t4252"
@@ -66,4 +66,13 @@ test_expect_success 'apply to a funny path' '
 	test -f "$with_sq/file-5"
 '
 
+test_expect_success 'am --reject' '
+	rm -rf .git/rebase-apply &&
+	git reset --hard initial &&
+	test_must_fail git am --reject "$tm"/am-test-6-1 &&
+	grep "@@ -1,3 +1,3 @@" file-2.rej &&
+	test_must_fail git diff-files --exit-code --quiet file-2 &&
+	grep "[-]-reject" .git/rebase-apply/apply-opt
+'
+
 test_done
diff --git c/t/t4252/am-test-6-1 i/t/t4252/am-test-6-1
new file mode 100644
index 0000000..a8859e9
--- /dev/null
+++ i/t/t4252/am-test-6-1
@@ -0,0 +1,21 @@
+From: A U Thor <au.thor@example.com>
+Date: Thu Dec 4 16:00:00 2008 -0800
+Subject: Huh
+
+Should fail and leave rejects
+
+diff --git i/file-2 w/file-2
+index 06e567b..b6f3a16 100644
+--- i/file-2
++++ w/file-2
+@@ -1,3 +1,3 @@
+-0
++One
+ 2
+ 3
+@@ -4,4 +4,4 @@
+ 4
+ 5
+-6
++Six
+ 7

^ permalink raw reply related

* Re: how to force a commit date matching info from a mbox ?
From: Jeff King @ 2009-01-24  0:52 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON
In-Reply-To: <alpine.DEB.1.00.0901240133510.3586@pacific.mpi-cbg.de>

On Sat, Jan 24, 2009 at 01:34:41AM +0100, Johannes Schindelin wrote:

> > So good to know, and I will start generating my patches differently.
> 
> Note that your patches will not be found using Pasky's "mail" link in 
> gitweb, if you do not put the commit subject into the _real_ mail subject.
> 
> Dunno if I like that.

I think that is not a new problem. Quite a few patches are "how about
this" patches in the middle of a thread, and leave the old subject.
IMHO, that is a failing of the tool in not tracking common practice, not
the other way around.

-Peff

^ permalink raw reply

* Re: [PATCH] Allow cloning an empty repository
From: Sverre Rabbelier @ 2009-01-24  0:42 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Miklos Vajna, Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0901240131570.3586@pacific.mpi-cbg.de>

On Sat, Jan 24, 2009 at 01:33, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> On Sat, 24 Jan 2009, Miklos Vajna wrote:
>> I'm not familiar with the HTTP code, either, but here is the call stack
>> I see:
>>
>> - builtin-clone calls transport_get_remote_refs()
>> - that will call transport->get_refs_list()
>> - that will call get_refs_via_curl()
>> - that die()s on error, does not use return error()

Which means all protocols actually die?

> Only after writing my email (and just before sending) did I remember that
> I have Mike's HTTP cleanups applied in my Git checkout.  So I was
> analyzing the wrong code.

Hmmm, can't blame you considering it was around 4am ;).

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply

* Re: how to force a commit date matching info from a mbox ?
From: Johannes Schindelin @ 2009-01-24  0:34 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON
In-Reply-To: <20090123222906.GC11328@coredump.intra.peff.net>

Hi,

On Fri, 23 Jan 2009, Jeff King wrote:

> On Fri, Jan 23, 2009 at 01:39:27AM -0800, Junio C Hamano wrote:
> 
> > > --->8---
> > > Subject: [PATCH] git-am: Add --ignore-date option
> > 
> > Good.
> > 
> > Leaving "Subject: " in saves me typing, because I do not have to insert it
> > manually when editing the submitted patch in my MUA to chop off everything
> > before the scissors.
> 
> Interesting to know. I have intentionally _not_ been including them,
> because I assumed you marked up _after_ git-am (i.e., via "git commit
> --amend) in which case you would have to delete it manually. I suppose
> it makes more sense to do so before git-am, though, since then it will
> respect From: fields and the like (which it would otherwise ignore,
> since they are blocked by all of the cover letter cruft that you will
> end up deleting).
> 
> So good to know, and I will start generating my patches differently.

Note that your patches will not be found using Pasky's "mail" link in 
gitweb, if you do not put the commit subject into the _real_ mail subject.

Dunno if I like that.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] Allow cloning an empty repository
From: Johannes Schindelin @ 2009-01-24  0:33 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Sverre Rabbelier, Junio C Hamano, git
In-Reply-To: <20090123230520.GL21473@genesis.frugalware.org>

Hi,

On Sat, 24 Jan 2009, Miklos Vajna wrote:

> On Fri, Jan 23, 2009 at 03:42:24AM +0100, Johannes Schindelin 
> <Johannes.Schindelin@gmx.de> wrote:
> > > > I am mostly worried about a failure case (connected but couldn't 
> > > > get the refs, or perhaps connection failed to start).  If you get 
> > > > a NULL in such a case you may end up saying "oh you cloned a void" 
> > > > when you should say "nah, such a remote repository does not 
> > > > exist".
> > > 
> > > Yes, this was my concern as well.
> > 
> > From what I can see in get_remote_heads(), the native protocols would 
> > die(), as would rsync().
> > 
> > HTTP transport, however, would not die() on connection errors, from my 
> > cursory look.
> 
> I'm not familiar with the HTTP code, either, but here is the call stack 
> I see:
> 
> - builtin-clone calls transport_get_remote_refs()
> - that will call transport->get_refs_list()
> - that will call get_refs_via_curl()
> - that die()s on error, does not use return error()
> 
> Have I missed something?

Not really.

Only after writing my email (and just before sending) did I remember that 
I have Mike's HTTP cleanups applied in my Git checkout.  So I was 
analyzing the wrong code.

Thanks for analyzing the right code.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH] Allow cloning an empty repository
From: Johannes Schindelin @ 2009-01-24  0:28 UTC (permalink / raw)
  To: Jeff King; +Cc: Sverre Rabbelier, Junio C Hamano, git
In-Reply-To: <20090123223740.GA11527@coredump.intra.peff.net>

Hi,

On Fri, 23 Jan 2009, Jeff King wrote:

> But I thought the issue at hand was that for some instances, we would 
> report that we successfully created an empty repository, when in fact 
> what happened was that we failed to clone a non-empty repository. And 
> that that was fixable, but it was a problem with our code interfaces 
> (which should be fixable) and not some fundamental limitation.

It appears that the HTTP code (at least after the first round of Mike's 
patches) has issues there, yes, but I think it would not be fair to stop 
Sverre's patch because of that: the HTTP code needs fixing anyway, and 
this fix is orthogonal to the empty clones.

Ciao,
Dscho

^ permalink raw reply

* http fixes, was Re: [PATCH] Allow cloning an empty repository
From: Johannes Schindelin @ 2009-01-24  0:26 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git
In-Reply-To: <20090123215559.GA5561@glandium.org>

Hi,

On Fri, 23 Jan 2009, Mike Hommey wrote:

> As I said when posting my patch batch, I don't have much time nor 
> motivation to work on this series. But let's make a deal: if someone 
> writes a good enough http test suite, I'll polish the http code.

I already said in my replied to your patch that I will add the http test 
suite if you fix your patches.

Ciao,
Dscho

^ permalink raw reply

* [PATCH v2] Change octal literals to be XEmacs friendly
From: Vassili Karpov @ 2009-01-23 23:20 UTC (permalink / raw)
  To: git, Alexandre Julliard


The type-of ?\octal in XEmacs is character while in FSF Emacs it is
integer. Case expression using this syntax will not work correctly on
XEmacs. #ooctal syntax on the other hand produces integers everywhere.

Signed-off-by: Vassili Karpov <av1474@comtv.ru>
---
  contrib/emacs/git.el |   30 +++++++++++++++---------------
  1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 09e8bae..715580a 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -562,29 +562,29 @@ the process output as a string, or nil if the git 
command failed."
    (let* ((old-type (lsh (or old-perm 0) -9))
  	 (new-type (lsh (or new-perm 0) -9))
  	 (str (case new-type
-		(?\100  ;; file
+		(#o100  ;; file
  		 (case old-type
-		   (?\100 nil)
-		   (?\120 "   (type change symlink -> file)")
-		   (?\160 "   (type change subproject -> file)")))
-		 (?\120  ;; symlink
+		   (#o100 nil)
+		   (#o120 "   (type change symlink -> file)")
+		   (#o160 "   (type change subproject -> file)")))
+		 (#o120  ;; symlink
  		  (case old-type
-		    (?\100 "   (type change file -> symlink)")
-		    (?\160 "   (type change subproject -> symlink)")
+		    (#o100 "   (type change file -> symlink)")
+		    (#o160 "   (type change subproject -> symlink)")
  		    (t "   (symlink)")))
-		  (?\160  ;; subproject
+		  (#o160  ;; subproject
  		   (case old-type
-		     (?\100 "   (type change file -> subproject)")
-		     (?\120 "   (type change symlink -> subproject)")
+		     (#o100 "   (type change file -> subproject)")
+		     (#o120 "   (type change symlink -> subproject)")
  		     (t "   (subproject)")))
-                  (?\110 nil)  ;; directory (internal, not a real git 
state)
-		  (?\000  ;; deleted or unknown
+                  (#o110 nil)  ;; directory (internal, not a real git 
state)
+		  (#o000  ;; deleted or unknown
  		   (case old-type
-		     (?\120 "   (symlink)")
-		     (?\160 "   (subproject)")))
+		     (#o120 "   (symlink)")
+		     (#o160 "   (subproject)")))
  		  (t (format "   (unknown type %o)" new-type)))))
      (cond (str (propertize str 'face 'git-status-face))
-          ((eq new-type ?\110) "/")
+          ((eq new-type #o110) "/")
            (t ""))))

  (defun git-rename-as-string (info)
-- 
1.6.0.2.GIT



-- 
mailto:av1474@comtv.ru

^ permalink raw reply related

* [PATCHv3] git mergetool: Don't repeat merge tool candidates
From: Johannes Gilger @ 2009-01-23 23:12 UTC (permalink / raw)
  To: gitster; +Cc: git, Johannes Gilger
In-Reply-To: <7vpridr7vb.fsf@gitster.siamese.dyndns.org>

git mergetool listed some candidates for mergetools twice, depending on
the environment.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
---
This improves on v2 of this patch as it appends non-gui merge-tools even 
if $DISPLAY is set. It still makes the assumption that KDE_FULL_SESSION 
and GNOME_DESKTOP_SESSION_ID are never set at the same time. If this 
were to happen the tool would simply prefer meld over kdiff3.

 git-mergetool.sh |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/git-mergetool.sh b/git-mergetool.sh
index 00e1337..09f3a10 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -390,21 +390,19 @@ fi
 
 if test -z "$merge_tool" ; then
     if test -n "$DISPLAY"; then
-        merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
         if test -n "$GNOME_DESKTOP_SESSION_ID" ; then
-            merge_tool_candidates="meld $merge_tool_candidates"
-        fi
-        if test "$KDE_FULL_SESSION" = "true"; then
-            merge_tool_candidates="kdiff3 $merge_tool_candidates"
+            merge_tool_candidates="meld kdiff3 tkdiff xxdiff gvimdiff"
+        else
+            merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
         fi
     fi
     if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
-        merge_tool_candidates="$merge_tool_candidates emerge"
-    fi
-    if echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
-        merge_tool_candidates="$merge_tool_candidates vimdiff"
+        merge_tool_candidates="$merge_tool_candidates emerge opendiff vimdiff"
+    elif echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
+        merge_tool_candidates="$merge_tool_candidates vimdiff opendiff emerge"
+    else
+        merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
     fi
-    merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
     echo "merge tool candidates: $merge_tool_candidates"
     for i in $merge_tool_candidates; do
         init_merge_tool_path $i
-- 
1.6.1.40.g8ea6a

^ permalink raw reply related

* Re: [PATCH] Allow cloning an empty repository
From: Miklos Vajna @ 2009-01-23 23:05 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Sverre Rabbelier, Junio C Hamano, git
In-Reply-To: <alpine.DEB.1.00.0901230333060.3586@pacific.mpi-cbg.de>

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

On Fri, Jan 23, 2009 at 03:42:24AM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > I am mostly worried about a failure case (connected but couldn't get 
> > > the refs, or perhaps connection failed to start).  If you get a NULL 
> > > in such a case you may end up saying "oh you cloned a void" when you 
> > > should say "nah, such a remote repository does not exist".
> > 
> > Yes, this was my concern as well.
> 
> From what I can see in get_remote_heads(), the native protocols would 
> die(), as would rsync().
> 
> HTTP transport, however, would not die() on connection errors, from my 
> cursory look.

I'm not familiar with the HTTP code, either, but here is the call stack
I see:

- builtin-clone calls transport_get_remote_refs()
- that will call transport->get_refs_list()
- that will call get_refs_via_curl()
- that die()s on error, does not use return error()

Have I missed something?

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply

* Re: [PATCH 2/3] Make has_commit non-static
From: Jake Goulding @ 2009-01-23 22:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7i4m6cz0.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> Jake Goulding <goulding@vivisimo.com> writes:
> 
>> Moving has_commit from branch to a common location in preparation for
>> using it in tag.
> 
> has_commit() may have been a good enough name when it was a static in
> builtin-branch.c but with much wider visibility, it is not specific
> enough.
> 
> Perhaps you would want to rename it to something more descriptive.

Sure - any suggestions?

The best I could come up with was "commit_has_any_in_commit_list"

> Also it seems that your patch is garbled and won't apply.  A blank
> context line lost the leading (and only) SP, and long lines are wrapped.

Yes - adventures in sending patches. Hopefully I'll have it fixed by the
next round of patches. :-)

> 
>> Signed-off-by: Jake Goulding <goulding@vivisimo.com>
>> ---
>>  builtin-branch.c |   15 ---------------
>>  commit.c         |   15 +++++++++++++++
>>  commit.h         |    1 +
>>  3 files changed, 16 insertions(+), 15 deletions(-)
>>
>> diff --git a/builtin-branch.c b/builtin-branch.c
>> index 82d6fb2..bb42911 100644
>> --- a/builtin-branch.c
>> +++ b/builtin-branch.c
>> @@ -193,21 +193,6 @@ struct ref_list {
>>  	int kinds;
>>  };
>>
>> -static int has_commit(struct commit *commit, struct commit_list
>> *with_commit)
>> -{
>> -	if (!with_commit)
>> -		return 1;
>> -	while (with_commit) {
>> -		struct commit *other;
>> -
>> -		other = with_commit->item;
>> -		with_commit = with_commit->next;
>> -		if (in_merge_bases(other, &commit, 1))
>> -			return 1;
>> -	}
>> -	return 0;
>> -}
>> -
>>  static int append_ref(const char *refname, const unsigned char *sha1,
>> int flags, void *cb_data)
>>  {
>>  	struct ref_list *ref_list = (struct ref_list*)(cb_data);
>> diff --git a/commit.c b/commit.c
>> index c99db16..5ccb338 100644
>> --- a/commit.c
>> +++ b/commit.c
>> @@ -705,6 +705,21 @@ struct commit_list *get_merge_bases(struct commit
>> *one, struct commit *two,
>>  	return get_merge_bases_many(one, 1, &two, cleanup);
>>  }
>>
>> +int has_commit(struct commit *commit, struct commit_list *with_commit)
>> +{
>> +	if (!with_commit)
>> +		return 1;
>> +	while (with_commit) {
>> +		struct commit *other;
>> +
>> +		other = with_commit->item;
>> +		with_commit = with_commit->next;
>> +		if (in_merge_bases(other, &commit, 1))
>> +			return 1;
>> +	}
>> +	return 0;
>> +}
>> +
>>  int in_merge_bases(struct commit *commit, struct commit **reference,
>> int num)
>>  {
>>  	struct commit_list *bases, *b;
>> diff --git a/commit.h b/commit.h
>> index 3a7b06a..1b8444f 100644
>> --- a/commit.h
>> +++ b/commit.h
>> @@ -133,6 +133,7 @@ extern int is_repository_shallow(void);
>>  extern struct commit_list *get_shallow_commits(struct object_array *heads,
>>  		int depth, int shallow_flag, int not_shallow_flag);
>>
>> +int has_commit(struct commit *, struct commit_list *);
>>  int in_merge_bases(struct commit *, struct commit **, int);
>>
>>  extern int interactive_add(int argc, const char **argv, const char
>> *prefix);
>> -- 
>> 1.6.0.4

^ permalink raw reply

* Re: [PATCH] Allow cloning an empty repository
From: Sverre Rabbelier @ 2009-01-23 22:39 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin, Junio C Hamano, git
In-Reply-To: <20090123223740.GA11527@coredump.intra.peff.net>

On Fri, Jan 23, 2009 at 23:37, Jeff King <peff@peff.net> wrote:
> No, I don't mind success on cloning an empty repository. But I thought
> the issue at hand was that for some instances, we would report that we
> successfully created an empty repository, when in fact what happened was
> that we failed to clone a non-empty repository. And that that was
> fixable, but it was a problem with our code interfaces (which should be
> fixable) and not some fundamental limitation.

Ah, mhh, if that is the case then I'm afraid that's beyond me (at
least for now), someone else would have to do said refactoring first
:(.

> Or am I misunderstanding the situation?

I think you summarized it pretty well, if that is indeed what Junio meant.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox