* Re: [PATCH] git mergetool: Don't repeat merge tool candidates
From: Junio C Hamano @ 2009-01-23 8:16 UTC (permalink / raw)
To: Johannes Gilger; +Cc: git, Theodore Ts'o
In-Reply-To: <1232569442-12480-1-git-send-email-heipei@hackvalue.de>
Johannes Gilger <heipei@hackvalue.de> writes:
> git mergetool listed some candidates for mergetools twice, depending on
> the environment.
>
> Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
> ---
> git-mergetool.sh | 13 +++++--------
> 1 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/git-mergetool.sh b/git-mergetool.sh
> index 00e1337..8f09e4a 100755
> --- a/git-mergetool.sh
> +++ b/git-mergetool.sh
> @@ -390,21 +390,18 @@ 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"
> + merge_tool_candidates="$merge_tool_candidates emerge opendiff vimdiff"
> 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 vimdiff opendiff emerge"
> 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
Doesn't this change the order of the tools listed in the variable,
affecting which one ends up being used? I think that is a worse
regression than repeating the same name twice in an otherwise no-op
informational message.
Please spend a few minutes to see if there are active developers who are
familiar with the area of code you are touching and Cc them to ask their
input.
git blame -L390,+20 git-mergetool.sh
tells me that most of this came from 301ac38 (git-mergetool: Make default
selection of merge-tool more intelligent, 2007-06-10), so I am Cc'ing Ted.
^ permalink raw reply
* Re: how to force a commit date matching info from a mbox ?
From: Nanako Shiraishi @ 2009-01-23 8:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git list, Christian MICHON
In-Reply-To: <7vwscm1nic.fsf@gitster.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>:
> Nanako Shiraishi <nanako3@lavabit.com> writes:
>
>> Quoting Junio C Hamano <gitster@pobox.com>:
>>
>>> Perhaps something like this totally untested patch.
>>
>> You have test scripts already, but you say it is untested?
>
> Correct. I did not run that new test, let alone existing ones ;-)
I applied your patch and run the test suite, including the new one, and they passed.
I tried to write a new option I said that I wanted in my previous message. Here is a patch.
--->8---
Subject: [PATCH] git-am: Add --ignore-date option
This new option makes the command 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>
---
git-am.sh | 12 +++++++++++-
t/t4150-am.sh | 9 +++++++++
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index e96071d..eb88d90 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 ;;
*)
@@ -379,7 +383,13 @@ do
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
- GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
+ case "$ignore_date" in
+ t)
+ GIT_AUTHOR_DATE="$(date -R)"
+ ;;
+ '')
+ GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
+ esac
if test -z "$GIT_AUTHOR_EMAIL"
then
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8d3fb00..5ecf456 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -277,4 +277,13 @@ test_expect_success 'am without --committer-date-is-author-date' '
test "$at" != "$ct"
'
+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.224.gb56c7
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply related
* Re: RFC: git diff colorization idea
From: Nanako Shiraishi @ 2009-01-23 8:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Wincent Colaiuta, git
In-Reply-To: <7vhc3q6evi.fsf@gitster.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>:
> If you were to go this route, I suspect that showing the unchanged part on
> the preimage line in light gray might make sense, like:
>
> | _git_remote ()
> | {
> |- <gray>local subcommands="add rm show prune<gray> <red>update</red>"
> |+ local subcommands="add <green>rename</green> rm show prune"
> | local subcommand=$(__git_find_subcommand "$subcommands")"
> | if ...
>
> because there will be the same chars/words on the postimage line anyway.
I think this makes a lot more sense than any of the screenshot
WIncent prepared on his web pages, and it is a much easier output
for users to spot which word is different by not coloring the
unchanged word at all.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: how to force a commit date matching info from a mbox ?
From: Christian MICHON @ 2009-01-23 8:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git list
In-Reply-To: <46d6db660901230008q418f3d3bsc68ca4e9d675cb36@mail.gmail.com>
On Fri, Jan 23, 2009 at 9:08 AM, Christian MICHON
<christian.michon@gmail.com> wrote:
>> A patch to butcher "git-am" to copy GIT_COMMITTER_DATE from
>> GIT_AUTHOR_DATE and export it should be trivial to implement, though.
>>
>> Perhaps something like this totally untested patch.
>>
>
> I love this idea. I'll try to test it asap. Thanks!
>
working fine! I've predictable/reproducible commits with this patch!
many thanks and kudos!
--
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* Re: git-svn fails to fetch repository
From: Petr Baudis @ 2009-01-23 8:52 UTC (permalink / raw)
To: B.Steinbrink; +Cc: Vladimir Pouzanov, git
In-Reply-To: <loom.20090113T204616-845@post.gmane.org>
On Tue, Jan 13, 2009 at 08:46:55PM +0000, Vladimir Pouzanov wrote:
> Björn Steinbrink <B.Steinbrink <at> gmx.de> writes:
> > Is that Linux box using Gentoo? If so, try emerging subversion with -dso
> > in your build flags.
>
> Yeah, that's gentoo. Will try rebuilding svn now.
I have hit the same issue (segfault on Gentoo) and this fixed it for me.
But do you have any details on why is the segfault caused and how to
prevent it? USE=dso is the default on Gentoo. :-(
--
Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr
^ permalink raw reply
* [PATCH 1/7] refs: add a "for_each_replace_ref" function
From: Christian Couder @ 2009-01-23 9:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This is some preparation work for the following patches that are using
the "refs/replace/" ref namespace.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
refs.c | 5 +++++
refs.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
Here is a new patch series. I only fixed what Junio reported
as bugs (thanks) and added a global switch to forbid the
replacement for connectivity walkers. I added a few test
cases for the latter, but I may be missing a lot of things.
diff --git a/refs.c b/refs.c
index 33ced65..042106d 100644
--- a/refs.c
+++ b/refs.c
@@ -632,6 +632,11 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data)
return do_for_each_ref("refs/remotes/", fn, 13, cb_data);
}
+int for_each_replace_ref(each_ref_fn fn, void *cb_data)
+{
+ return do_for_each_ref("refs/replace/", fn, 13, cb_data);
+}
+
/*
* Make sure "ref" is something reasonable to have under ".git/refs/";
* We do not like it if:
diff --git a/refs.h b/refs.h
index 06ad260..8d2ee5a 100644
--- a/refs.h
+++ b/refs.h
@@ -23,6 +23,7 @@ extern int for_each_ref(each_ref_fn, void *);
extern int for_each_tag_ref(each_ref_fn, void *);
extern int for_each_branch_ref(each_ref_fn, void *);
extern int for_each_remote_ref(each_ref_fn, void *);
+extern int for_each_replace_ref(each_ref_fn, void *);
/*
* Extra refs will be listed by for_each_ref() before any actual refs
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 2/7] replace_object: add mechanism to replace objects found in "refs/replace/"
From: Christian Couder @ 2009-01-23 9:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
The code implementing this mechanism has been copied from the commit
graft code.
This mechanism is used in "read_sha1_file". sha1 passed to this
function that match a ref name in "refs/replace/" are replaced by
the sha1 that has been read in the ref.
We "die" if the replacement recursion depth is too high or if we
can't read the replacement object.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Makefile | 1 +
commit.h | 2 +
replace_object.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
sha1_file.c | 14 +++++-
4 files changed, 131 insertions(+), 3 deletions(-)
create mode 100644 replace_object.c
diff --git a/Makefile b/Makefile
index fa6c51c..953638f 100644
--- a/Makefile
+++ b/Makefile
@@ -471,6 +471,7 @@ LIB_OBJS += read-cache.o
LIB_OBJS += reflog-walk.o
LIB_OBJS += refs.o
LIB_OBJS += remote.o
+LIB_OBJS += replace_object.o
LIB_OBJS += rerere.o
LIB_OBJS += revision.o
LIB_OBJS += run-command.o
diff --git a/commit.h b/commit.h
index 3a7b06a..37aa763 100644
--- a/commit.h
+++ b/commit.h
@@ -122,6 +122,8 @@ struct commit_graft *read_graft_line(char *buf, int len);
int register_commit_graft(struct commit_graft *, int);
struct commit_graft *lookup_commit_graft(const unsigned char *sha1);
+const unsigned char *lookup_replace_object(const unsigned char *sha1);
+
extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup);
extern struct commit_list *get_merge_bases_many(struct commit *one, int n, struct commit **twos, int cleanup);
extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
diff --git a/replace_object.c b/replace_object.c
new file mode 100644
index 0000000..5b973ba
--- /dev/null
+++ b/replace_object.c
@@ -0,0 +1,117 @@
+#include "cache.h"
+#include "refs.h"
+
+static struct replace_object {
+ unsigned char sha1[2][20];
+} **replace_object;
+
+static int replace_object_alloc, replace_object_nr;
+
+static int replace_object_pos(const unsigned char *sha1)
+{
+ int lo, hi;
+ lo = 0;
+ hi = replace_object_nr;
+ while (lo < hi) {
+ int mi = (lo + hi) / 2;
+ struct replace_object *rep = replace_object[mi];
+ int cmp = hashcmp(sha1, rep->sha1[0]);
+ if (!cmp)
+ return mi;
+ if (cmp < 0)
+ hi = mi;
+ else
+ lo = mi + 1;
+ }
+ return -lo - 1;
+}
+
+static int register_replace_object(struct replace_object *replace,
+ int ignore_dups)
+{
+ int pos = replace_object_pos(replace->sha1[0]);
+
+ if (0 <= pos) {
+ if (ignore_dups)
+ free(replace);
+ else {
+ free(replace_object[pos]);
+ replace_object[pos] = replace;
+ }
+ return 1;
+ }
+ pos = -pos - 1;
+ if (replace_object_alloc <= ++replace_object_nr) {
+ replace_object_alloc = alloc_nr(replace_object_alloc);
+ replace_object = xrealloc(replace_object,
+ sizeof(*replace_object) *
+ replace_object_alloc);
+ }
+ if (pos < replace_object_nr)
+ memmove(replace_object + pos + 1,
+ replace_object + pos,
+ (replace_object_nr - pos - 1) *
+ sizeof(*replace_object));
+ replace_object[pos] = replace;
+ return 0;
+}
+
+static int register_replace_ref(const char *refname,
+ const unsigned char *sha1,
+ int flag, void *cb_data)
+{
+ /* Get sha1 from refname */
+ const char *slash = strrchr(refname, '/');
+ const char *hash = slash ? slash + 1 : refname;
+ struct replace_object *repl_obj = xmalloc(sizeof(*repl_obj));
+
+ if (strlen(hash) != 40 || get_sha1_hex(hash, repl_obj->sha1[0])) {
+ free(repl_obj);
+ warning("bad replace ref name: %s", refname);
+ return 0;
+ }
+
+ /* Copy sha1 from the read ref */
+ hashcpy(repl_obj->sha1[1], sha1);
+
+ /* Register new object */
+ if (register_replace_object(repl_obj, 1))
+ die("duplicate replace ref: %s", refname);
+
+ return 0;
+}
+
+static void prepare_replace_object(void)
+{
+ static int replace_object_prepared;
+
+ if (replace_object_prepared)
+ return;
+
+ for_each_replace_ref(register_replace_ref, NULL);
+ replace_object_prepared = 1;
+}
+
+/* We allow "recursive" replacement. Only within reason, though */
+#define MAXREPLACEDEPTH 5
+
+const unsigned char *lookup_replace_object(const unsigned char *sha1)
+{
+ int pos, depth = MAXREPLACEDEPTH;
+ const unsigned char *cur = sha1;
+
+ prepare_replace_object();
+
+ /* Try to recursively replace the object */
+ do {
+ if (--depth < 0)
+ die("replace depth too high for object %s",
+ sha1_to_hex(sha1));
+
+ pos = replace_object_pos(cur);
+ if (0 <= pos)
+ cur = replace_object[pos]->sha1[1];
+ } while (0 <= pos);
+
+ return cur;
+}
diff --git a/sha1_file.c b/sha1_file.c
index f08493f..4f2fd10 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2163,10 +2163,18 @@ static void *read_object(const unsigned char *sha1, enum object_type *type,
void *read_sha1_file(const unsigned char *sha1, enum object_type *type,
unsigned long *size)
{
- void *data = read_object(sha1, type, size);
+ const unsigned char *repl = lookup_replace_object(sha1);
+ void *data = read_object(repl, type, size);
+
+ /* die if we replaced an object with one that does not exist */
+ if (!data && repl != sha1)
+ die("replacement %s not found for %s",
+ sha1_to_hex(repl), sha1_to_hex(sha1));
+
/* legacy behavior is to die on corrupted objects */
- if (!data && (has_loose_object(sha1) || has_packed_and_bad(sha1)))
- die("object %s is corrupted", sha1_to_hex(sha1));
+ if (!data && (has_loose_object(repl) || has_packed_and_bad(repl)))
+ die("object %s is corrupted", sha1_to_hex(repl));
+
return data;
}
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 3/7] sha1_file: add a "read_sha1_file_repl" function
From: Christian Couder @ 2009-01-23 9:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This new function will replace "read_sha1_file". This latter function
becoming just a stub to call the former will a NULL "replacement"
argument.
This new function is needed because sometimes we need to use the
replacement sha1.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
cache.h | 6 +++++-
sha1_file.c | 9 +++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/cache.h b/cache.h
index 8e1af26..1b34381 100644
--- a/cache.h
+++ b/cache.h
@@ -625,7 +625,11 @@ int longest_ancestor_length(const char *path, const char *prefix_list);
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
extern int sha1_object_info(const unsigned char *, unsigned long *);
-extern void * read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size);
+extern void *read_sha1_file_repl(const unsigned char *sha1, enum object_type *type, unsigned long *size, const unsigned char **replacement);
+static inline void *read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size)
+{
+ return read_sha1_file_repl(sha1, type, size, NULL);
+}
extern int hash_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *sha1);
extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
diff --git a/sha1_file.c b/sha1_file.c
index 4f2fd10..ea89ce5 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2160,8 +2160,10 @@ static void *read_object(const unsigned char *sha1, enum object_type *type,
return read_packed_sha1(sha1, type, size);
}
-void *read_sha1_file(const unsigned char *sha1, enum object_type *type,
- unsigned long *size)
+void *read_sha1_file_repl(const unsigned char *sha1,
+ enum object_type *type,
+ unsigned long *size,
+ const unsigned char **replacement)
{
const unsigned char *repl = lookup_replace_object(sha1);
void *data = read_object(repl, type, size);
@@ -2175,6 +2177,9 @@ void *read_sha1_file(const unsigned char *sha1, enum object_type *type,
if (!data && (has_loose_object(repl) || has_packed_and_bad(repl)))
die("object %s is corrupted", sha1_to_hex(repl));
+ if (replacement)
+ *replacement = repl;
+
return data;
}
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 4/7] object: call "check_sha1_signature" with the replacement sha1
From: Christian Couder @ 2009-01-23 9:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Otherwise we get a "sha1 mismatch" error for replaced objects.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
object.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/object.c b/object.c
index 50b6528..217bee9 100644
--- a/object.c
+++ b/object.c
@@ -187,17 +187,18 @@ struct object *parse_object(const unsigned char *sha1)
unsigned long size;
enum object_type type;
int eaten;
- void *buffer = read_sha1_file(sha1, &type, &size);
+ const unsigned char *repl;
+ void *buffer = read_sha1_file_repl(sha1, &type, &size, &repl);
if (buffer) {
struct object *obj;
- if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) {
+ if (check_sha1_signature(repl, buffer, size, typename(type)) < 0) {
free(buffer);
- error("sha1 mismatch %s\n", sha1_to_hex(sha1));
+ error("sha1 mismatch %s\n", sha1_to_hex(repl));
return NULL;
}
- obj = parse_object_buffer(sha1, type, size, buffer, &eaten);
+ obj = parse_object_buffer(repl, type, size, buffer, &eaten);
if (!eaten)
free(buffer);
return obj;
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 6/7] mktag: call "check_sha1_signature" with the replacement sha1
From: Christian Couder @ 2009-01-23 9:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Otherwise we get a "sha1 mismatch" error for replaced objects.
Note that I am not sure at all that this is a good change.
It may be that we should just refuse to tag a replaced object. But
in this case we should probably give a meaningfull error message
instead of "sha1 mismatch".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
mktag.c | 7 ++++---
t/t6050-replace.sh | 12 ++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/mktag.c b/mktag.c
index ba3d495..ac812e5 100644
--- a/mktag.c
+++ b/mktag.c
@@ -18,16 +18,17 @@
/*
* We refuse to tag something we can't verify. Just because.
*/
-static int verify_object(unsigned char *sha1, const char *expected_type)
+static int verify_object(const unsigned char *sha1, const char *expected_type)
{
int ret = -1;
enum object_type type;
unsigned long size;
- void *buffer = read_sha1_file(sha1, &type, &size);
+ const unsigned char *repl;
+ void *buffer = read_sha1_file_repl(sha1, &type, &size, &repl);
if (buffer) {
if (type == type_from_string(expected_type))
- ret = check_sha1_signature(sha1, buffer, size, expected_type);
+ ret = check_sha1_signature(repl, buffer, size, expected_type);
free(buffer);
}
return ret;
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 0a585ec..334aed6 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -70,6 +70,18 @@ test_expect_success 'replace the author' '
git show $HASH2 | grep "O Thor"
'
+cat >tag.sig <<EOF
+object $HASH2
+type commit
+tag mytag
+tagger T A Gger <> 0 +0000
+
+EOF
+
+test_expect_success 'tag replaced commit' '
+ git mktag <tag.sig >.git/refs/tags/mytag 2>message
+'
+
#
#
test_done
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 5/7] replace_object: add a test case
From: Christian Couder @ 2009-01-23 9:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In this patch the setup code is very big, but this will be used in
test cases that will be added later.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
t/t6050-replace.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
create mode 100755 t/t6050-replace.sh
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
new file mode 100755
index 0000000..0a585ec
--- /dev/null
+++ b/t/t6050-replace.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 Christian Couder
+#
+test_description='Tests replace refs functionality'
+
+exec </dev/null
+
+. ./test-lib.sh
+
+add_and_commit_file()
+{
+ _file="$1"
+ _msg="$2"
+
+ git add $_file || return $?
+ test_tick || return $?
+ git commit --quiet -m "$_file: $_msg"
+}
+
+HASH1=
+HASH2=
+HASH3=
+HASH4=
+HASH5=
+HASH6=
+HASH7=
+
+test_expect_success 'set up buggy branch' '
+ echo "line 1" >> hello &&
+ echo "line 2" >> hello &&
+ echo "line 3" >> hello &&
+ echo "line 4" >> hello &&
+ add_and_commit_file hello "4 lines" &&
+ HASH1=$(git rev-parse --verify HEAD) &&
+ echo "line BUG" >> hello &&
+ echo "line 6" >> hello &&
+ echo "line 7" >> hello &&
+ echo "line 8" >> hello &&
+ add_and_commit_file hello "4 more lines with a BUG" &&
+ HASH2=$(git rev-parse --verify HEAD) &&
+ echo "line 9" >> hello &&
+ echo "line 10" >> hello &&
+ add_and_commit_file hello "2 more lines" &&
+ HASH3=$(git rev-parse --verify HEAD) &&
+ echo "line 11" >> hello &&
+ add_and_commit_file hello "1 more line" &&
+ HASH4=$(git rev-parse --verify HEAD) &&
+ sed -e "s/BUG/5/" hello > hello.new &&
+ mv hello.new hello &&
+ add_and_commit_file hello "BUG fixed" &&
+ HASH5=$(git rev-parse --verify HEAD) &&
+ echo "line 12" >> hello &&
+ echo "line 13" >> hello &&
+ add_and_commit_file hello "2 more lines" &&
+ HASH6=$(git rev-parse --verify HEAD)
+ echo "line 14" >> hello &&
+ echo "line 15" >> hello &&
+ echo "line 16" >> hello &&
+ add_and_commit_file hello "again 3 more lines" &&
+ HASH7=$(git rev-parse --verify HEAD)
+'
+
+test_expect_success 'replace the author' '
+ git cat-file commit $HASH2 | grep "author A U Thor" &&
+ R=$(git cat-file commit $HASH2 | sed -e "s/A U/O/" | git hash-object -t commit --stdin -w) &&
+ git cat-file commit $R | grep "author O Thor" &&
+ git update-ref refs/replace/$HASH2 $R &&
+ git show HEAD~5 | grep "O Thor" &&
+ git show $HASH2 | grep "O Thor"
+'
+
+#
+#
+test_done
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCH 7/7] environment: add global variable to disable replacement
From: Christian Couder @ 2009-01-23 9:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This new "read_replace_refs" global variable is set to 1 by
default, so that replace refs are used by default. But
reachability traversal and packing commands ("cmd_fsck",
"cmd_prune", "cmd_pack_objects", "upload_pack",
"cmd_unpack_objects") set it to 0, as they must work with the
original DAG.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin-fsck.c | 1 +
builtin-pack-objects.c | 2 ++
builtin-prune.c | 1 +
builtin-unpack-objects.c | 2 ++
cache.h | 1 +
environment.c | 1 +
replace_object.c | 3 +++
t/t6050-replace.sh | 23 +++++++++++++++++++++++
upload-pack.c | 2 ++
9 files changed, 36 insertions(+), 0 deletions(-)
Note that I tried a little to test this, but I don't know much
about packing and reachability traversal commands, so I may be
very wrong on this patch. There may also be many other
commands where "read_replace_refs" should be set to 0.
Please check.
diff --git a/builtin-fsck.c b/builtin-fsck.c
index aecc828..67356fb 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -586,6 +586,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
int i, heads;
errors_found = 0;
+ read_replace_refs = 0;
argc = parse_options(argc, argv, fsck_opts, fsck_usage, 0);
if (write_lost_and_found) {
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index e851534..8e161a3 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -2080,6 +2080,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
int rp_ac_alloc = 64;
int rp_ac;
+ read_replace_refs = 0;
+
rp_av = xcalloc(rp_ac_alloc, sizeof(*rp_av));
rp_av[0] = "pack-objects";
diff --git a/builtin-prune.c b/builtin-prune.c
index 545e9c1..c0a26fe 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -140,6 +140,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
char *s;
save_commit_buffer = 0;
+ read_replace_refs = 0;
init_revisions(&revs, prefix);
argc = parse_options(argc, argv, options, prune_usage, 0);
diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index 47ed610..1a4d51b 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -495,6 +495,8 @@ int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
int i;
unsigned char sha1[20];
+ read_replace_refs = 0;
+
git_config(git_default_config, NULL);
quiet = !isatty(2);
diff --git a/cache.h b/cache.h
index 1b34381..48fa12a 100644
--- a/cache.h
+++ b/cache.h
@@ -510,6 +510,7 @@ extern size_t packed_git_window_size;
extern size_t packed_git_limit;
extern size_t delta_base_cache_limit;
extern int auto_crlf;
+extern int read_replace_refs;
extern int fsync_object_files;
extern int core_preload_index;
diff --git a/environment.c b/environment.c
index e278bce..d11dde1 100644
--- a/environment.c
+++ b/environment.c
@@ -38,6 +38,7 @@ int pager_use_color = 1;
const char *editor_program;
const char *excludes_file;
int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */
+int read_replace_refs = 1;
enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
diff --git a/replace_object.c b/replace_object.c
index 5b973ba..1227214 100644
--- a/replace_object.c
+++ b/replace_object.c
@@ -100,6 +100,9 @@ const unsigned char *lookup_replace_object(const unsigned char *sha1)
int pos, depth = MAXREPLACEDEPTH;
const unsigned char *cur = sha1;
+ if (!read_replace_refs)
+ return sha1;
+
prepare_replace_object();
/* Try to recursively replace the object */
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 334aed6..17f6063 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -82,6 +82,29 @@ test_expect_success 'tag replaced commit' '
git mktag <tag.sig >.git/refs/tags/mytag 2>message
'
+test_expect_success '"git fsck" works' '
+ git fsck master > fsck_master.out &&
+ grep "dangling commit $R" fsck_master.out &&
+ grep "dangling tag $(cat .git/refs/tags/mytag)" fsck_master.out &&
+ test -z "$(git fsck)"
+'
+
+test_expect_success 'repack, clone and fetch work' '
+ git repack -a -d &&
+ git clone --no-hardlinks . clone_dir &&
+ cd clone_dir &&
+ git show HEAD~5 | grep "A U Thor" &&
+ git show $HASH2 | grep "A U Thor" &&
+ git cat-file commit $R &&
+ git repack -a -d &&
+ test_must_fail git cat-file commit $R &&
+ git fetch ../ "refs/replace/*:refs/replace/*" &&
+ git show HEAD~5 | grep "O Thor" &&
+ git show $HASH2 | grep "O Thor" &&
+ git cat-file commit $R &&
+ cd ..
+'
+
#
#
test_done
diff --git a/upload-pack.c b/upload-pack.c
index e5adbc0..186e338 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -616,6 +616,8 @@ int main(int argc, char **argv)
int i;
int strict = 0;
+ read_replace_refs = 0;
+
for (i = 1; i < argc; i++) {
char *arg = argv[i];
--
1.6.1.231.g9c286
^ permalink raw reply related
* [PATCHv2] git mergetool: Don't repeat merge tool candidates
From: Johannes Gilger @ 2009-01-23 9:14 UTC (permalink / raw)
To: gitster; +Cc: git, tytso, Johannes Gilger
In-Reply-To: <7v7i4m1lq4.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>
---
The first patch had the fatal flaw that it listed nothing when DISPLAY
and EDITOR/VISUAL were unset, we fixed that.
The order in which merge-candidates appear is still exactly the same,
only duplicates have been stripped. The check for KDE_FULL_SESSION was
removed since kdiff3 was added as long as DISPLAY was set and we weren't
running gnome.
git-mergetool.sh | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 00e1337..acdcffb 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -390,21 +390,21 @@ 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"
+ merge_tool_candidates="$merge_tool_candidates emerge opendiff vimdiff"
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 vimdiff opendiff emerge"
+ fi
+ if test -z "$merge_tool_candidates" ; then
+ 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] Fix Documentation for git-describe
From: Junio C Hamano @ 2009-01-23 9:36 UTC (permalink / raw)
To: Boyd Stephen Smith Jr.; +Cc: Tomas Carnecky, Martin Pirker, git
In-Reply-To: <200901221226.25342.bss@iguanasuicide.net>
Thanks.
^ permalink raw reply
* Re: how to force a commit date matching info from a mbox ?
From: Junio C Hamano @ 2009-01-23 9:39 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: git list, Christian MICHON
In-Reply-To: <20090123172646.6117@nanako3.lavabit.com>
Nanako Shiraishi <nanako3@lavabit.com> writes:
> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Correct. I did not run that new test, let alone existing ones ;-)
>
> I applied your patch and run the test suite, including the new one, and they passed.
Thanks.
> I tried to write a new option I said that I wanted in my previous message. Here is a patch.
>
> --->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.
> This new option makes the command 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.
LOL. A slacker option is a tough sell to a serious management, though.
I think it would work equally well if you somehow manage to pass this
through "git-rebase", but this won't work with "git-rebase --interactive".
> @@ -379,7 +383,13 @@ do
>
> GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
> GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
> - GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
> + case "$ignore_date" in
> + t)
> + GIT_AUTHOR_DATE="$(date -R)"
> + ;;
> + '')
> + GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
> + esac
Please align case arm labels with case/esac; iow, do not indent t) and '')
by four spaces, when you write your next case/esac statement.
"date -R" is a GNU extension; avoid it (I'll show you how at the end).
> diff --git a/t/t4150-am.sh b/t/t4150-am.sh
> index 8d3fb00..5ecf456 100755
> --- a/t/t4150-am.sh
> +++ b/t/t4150-am.sh
> @@ -277,4 +277,13 @@ test_expect_success 'am without --committer-date-is-author-date' '
> test "$at" != "$ct"
> '
>
> +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"
> +'
This is a convoluted logic.
The committer and author dates are set to -0700 timezone by test_tick,
while TZ is set to UTC (+0000) by test-lib.sh, and you are taking
advantage of them to see which one is being used.
But I do not think of a better way to do this offhand, so I'll let it
pass.
Regarding the "date -R" thing, I think we can take advantage of the fact
that an empty GIT_AUTHOR_DATE (and GIT_COMMITTER_DATE) means "do not use
this environment variable, but use the current date instead". Something
like this patch on top of yours, whose first hunk reverts your change to
use "date -R", and sets GIT_AUTHOR_DATE to empty when --ignore-date is
asked for.
No, I didn't test it.
diff --git i/git-am.sh w/git-am.sh
index eb88d90..f935178 100755
--- i/git-am.sh
+++ w/git-am.sh
@@ -383,13 +383,7 @@ do
GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
- case "$ignore_date" in
- t)
- GIT_AUTHOR_DATE="$(date -R)"
- ;;
- '')
- GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
- esac
+ GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
if test -z "$GIT_AUTHOR_EMAIL"
then
@@ -536,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"
^ permalink raw reply related
* Re: how to force a commit date matching info from a mbox ?
From: Nanako Shiraishi @ 2009-01-23 9:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git list, Christian MICHON
In-Reply-To: <20090123172646.6117@nanako3.lavabit.com>
Quoting Junio C Hamano <gitster@pobox.com>:
>> --->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.
I am sorry to ask you a stupid question, but do you mean you want to have
"Subject: " there, or do you mean you want me to leave that word out?
> I think it would work equally well if you somehow manage to pass this
> through "git-rebase", but this won't work with "git-rebase --interactive".
I can try to change git-rebase if you want, but I do not think I can
modify git-rebase --interactive. The script looked very scary last time I
looked at it (^_^;;;).
>> +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"
>> +'
>
> This is a convoluted logic.
>
> The committer and author dates are set to -0700 timezone by test_tick,
> while TZ is set to UTC (+0000) by test-lib.sh, and you are taking
> advantage of them to see which one is being used.
>
> But I do not think of a better way to do this offhand, so I'll let it
> pass.
>
> Regarding the "date -R" thing, I think we can take advantage of the fact
> that an empty GIT_AUTHOR_DATE (and GIT_COMMITTER_DATE) means "do not use
> this environment variable, but use the current date instead". Something
> like this patch on top of yours, whose first hunk reverts your change to
> use "date -R", and sets GIT_AUTHOR_DATE to empty when --ignore-date is
> asked for.
>
> No, I didn't test it.
I did, and it works.
Thank you very much.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: Merging adjacent deleted lines?
From: Robin Rosenberg @ 2009-01-23 10:32 UTC (permalink / raw)
To: Jay Soffian; +Cc: Jonathan del Strother, Junio C Hamano, Git Mailing List
In-Reply-To: <76718490901222318l7c3559ecje4a627fe2ff2ad12@mail.gmail.com>
fredag 23 januari 2009 08:18:15 skrev Jay Soffian:
> On Thu, Jan 22, 2009 at 3:13 PM, Robin Rosenberg
> <robin.rosenberg.lists@dewire.com> wrote:
[...]
> > Try a three-way merge tool instead like, e.g. xxdiff.
>
> opendiff (aka FileMerge) *is* a three-way merge tool. If the
> screenshot above is not clear, I'm not sure what would be. The left
> pane shows your copy of the file with only line1, line3, and line4.
> The right pane shows the other copy, with only line1, line2, and
> line4.
Where's the ancestor? I'm used to having four panes for doing three-way
merges, but your screenshot showed only three.
>
> Shrug.
You have the option to ignore me....
-- robin
^ permalink raw reply
* Re: [PATCH 3/3] git commit: pathspec without -i/-o implies -i semantics during a merge
From: Pieter de Bie @ 2009-01-23 9:51 UTC (permalink / raw)
To: Junio C Hamano
Cc: Nanako Shiraishi, Johannes Sixt, Nathan Yergler, Michael J Gruber,
Asheesh Laroia, git
In-Reply-To: <7vy6x235ky.fsf_-_@gitster.siamese.dyndns.org>
On 23 jan 2009, at 06:21, Junio C Hamano wrote:
> This makes "git commit paths..." form default to "git commit -i paths"
> semantics only during a merge, restoring the pre-v1.3.0 behaviour.
> The
> codepath to create a non-merge commit is not affected and still
> defaults
> to the "--only" semantics.
Do you really want to do this? I think this is a pretty large change
that can bite users if they don't know about this -- for example,
because
they forgot that they are in a merge (it happens..).
FWIW, I'd much rather see a useful error message than this change. If
this change does get in, I think it should be well-documented in the
man pages as well as in the release notes.
- Pieter
^ permalink raw reply
* Re: How to prefix existing svn remotes?
From: Michael J Gruber @ 2009-01-23 11:13 UTC (permalink / raw)
To: Sébastien Mazy; +Cc: git
In-Reply-To: <20090122173211.GB21798@locahost>
Sébastien Mazy venit, vidit, dixit 22.01.2009 18:32:
> Hi all,
>
>
> I created a few months ago a git-svn repository using:
> git svn clone -s https://my_svn_repo .
>
> wich also created the following remotes:
> git branch -r
> branch0
> tags/tag0
> trunk
>
> I would like to prefix theses remotes, so that it shows:
> git branch -r
> prefix/branch0
> prefix/tags/tag0
> prefix/trunk
>
> Of course I should have used the -prefix back when creating the repo but
> it's too late. 'git help svn' doesn't explain how to achieve that and
> simply editing .git/config to add the missing prefix will cause the next
> 'git svn fetch' to download again the whole history (which in my case is
> huge).
>
>
> Is it possible? Did I miss something obvious?
Yes! Depends!
The following works for me:
0) fetch to make sure you're current (optional)
1) edit .git/config and add the prefix (right hand side of the
refpsecs), or really rename in any way you want
2) rename the existing remote branches in the same way
The next git svn fetch will rebuild the map file (which is fast) but not
refetch any svn revisions you already have.
Regarding the renaming: Either I'm dumb or current git branch can't
rename git svn branches. I guess it's because they are remotes but not
really. I had to resort to git update-ref. I'll look into that.
Michael
^ permalink raw reply
* git blame: two "-C"s versus just a single -C
From: Sitaram Chamarty @ 2009-01-23 11:28 UTC (permalink / raw)
To: git
I seem to recall (and the docs indicate) that when you
*copy* (not move, just copy) a function from file1.c to
file2.c, commit, and then do a "git blame -C -C file2.c", it
should tell you that those lines came from file1.c
Is this not true? Git 1.6.1, I tried this on a dummy branch
where I just copied a good sized function (about 45 lines)
from one C program and dumped it at the bottom of a second
one, and neither the gui blame nor the CLI blame show me
that the lines came from elsewhere.
What am I doing wrong?
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2009, #02; Sun, 11)
From: Jakub Narebski @ 2009-01-23 12:04 UTC (permalink / raw)
To: Sebastien Cevey; +Cc: Junio C Hamano, git, Giuseppe Bilotta
In-Reply-To: <1232548106.4977310a95d8f@mail.nimag.net>
On Wed, 21 Jan 09, Sebastien Cevey wrote:
>>>>> ----------------------------------------------------------------
>>>>> [Actively cooking]
>>>>>
>>>>> * sc/gitweb-category (Fri Dec 12 00:45:12 2008 +0100) 3 commits
>>>>> - gitweb: Optional grouping of projects by category
>>>>> - gitweb: Split git_project_list_body in two functions
>>>>> - gitweb: Modularized git_get_project_description to be more generic
>>>>
>>>> This I think needs some further cooking. I guess with addition of one
>>>> more patch to series categories could be sorted together with projects
>>>> they contain, and not always have to be in fixed ordering.
>>>
>>> These should be moved to the Stalled category; nobody seems to be
>>> discussing improvements and sending updates to the series as far as I
>>> recall.
>>
>> I think it is just the author being slow moving; there was quite
>> a bit of time between subsequent versions of this patch series.
>
> I don't recall what was left to do on top of the series of patches I submitted,
> could you refresh my mind on that if it still needs to be done? I remember the
> discussion trailing off as categorized ordering was being discussed..
I'd have to take a fresh look at discussion but I remember two things:
first, that the code dealing with filtering out projects (e.g. removing
forks) is high incompatibile with introducing later limiting number of
projects per page, as it currently filters out paths _during printing_.
So we might want to have this cleanup before your series (which now
include a bit unnecessary preparation for projects_list view pagination).
Second, there was IMHO one unnecessary sorting, as with one more commit
we can have quite simply categories sorted in order of sorting project
they contain, which means that if we sort projects by age (youngest or
rather most recently changed first) then with one more commit we can
have category containing freshest project first.
I'll try to review this series soon, and if you don't have time I'll
resend them with those minor corrections.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] git-am: Add --ignore-date option
From: Johannes Schindelin @ 2009-01-23 12:38 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: Junio C Hamano, git list, Christian MICHON
In-Reply-To: <20090123172646.6117@nanako3.lavabit.com>
Hi,
[if you would have given a new mail subject to your mail, gitweb would
stand a chance to find it]
On Fri, 23 Jan 2009, Nanako Shiraishi wrote:
> Subject: [PATCH] git-am: Add --ignore-date option
>
> This new option makes the command 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.
FWIW I have that problem in one of my workflows, and I do this:
grep -v "^Date:" < $MBOX | git am
Of course, this assumes that none of my commit messages has the string
"Date:" at the beginning of the line...
Ciao,
Dscho
^ permalink raw reply
* Re: How to prefix existing svn remotes?
From: Sébastien Mazy @ 2009-01-23 12:42 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
In-Reply-To: <4979A64E.6030608@drmicha.warpmail.net>
Hi Michael,
Thanks for your reply.
On Fri, Jan 23, 2009 at 12:13:18PM +0100, Michael J Gruber wrote:
> The following works for me:
>
> 0) fetch to make sure you're current (optional)
> 1) edit .git/config and add the prefix (right hand side of the
> refpsecs), or really rename in any way you want
OK.
> 2) rename the existing remote branches in the same way
I'm not sure how I can do it. 'trunk' is the only remote-tracking svn
branches under .git/refs/. Here is how it looks:
ls -R .git/refs
.git/refs: heads remotes tags
.git/refs/heads: master
.git/refs/remotes: trunk
Still, a 'branch0' remote exist:
git show-ref
refs/heads/master
refs/remotes/branch0
refs/remotes/trunk
--
Sébastien Mazy
^ permalink raw reply
* bug: transform a binary file into a symlink in one commit => invalid binary patch
From: Pixel @ 2009-01-23 12:25 UTC (permalink / raw)
To: git
hi,
i hit a bug (git 1.6.1): when you transform a binary file into a
symlink in one commit, the binary patch can't be used in "git apply".
Is it a known issue?
reproducer:
----------
#!/bin/sh -e
# the bug: if you transform a binary file into a symlink in one commit,
# the binary patch can't be used in "git apply"
#
# nb: if you uncomment the "##" lines, the problem disappears
# since the first patch will empty the binary file then the non-binary file
# will be transformed into a symlink
rm -rf t t2
mkdir t
dd if=/dev/urandom of=t/a count=10
cp -r t t2
cd t
git init
git add .
git commit -m initial
##echo -n > a
##git commit -a -m foo
ln -sf zzz a
git commit -a -m foo2
git format-patch :/initial
cd ../t2
git apply ../t/*.patch
cd ..
rm -rf t t2
----------
^ permalink raw reply
* Re: How to prefix existing svn remotes?
From: Michael J Gruber @ 2009-01-23 13:02 UTC (permalink / raw)
To: Sébastien Mazy; +Cc: git
In-Reply-To: <20090123124231.GA17616@locahost>
Sébastien Mazy venit, vidit, dixit 23.01.2009 13:42:
> Hi Michael,
>
> Thanks for your reply.
>
> On Fri, Jan 23, 2009 at 12:13:18PM +0100, Michael J Gruber wrote:
>> The following works for me:
>>
>> 0) fetch to make sure you're current (optional)
>> 1) edit .git/config and add the prefix (right hand side of the
>> refpsecs), or really rename in any way you want
>
> OK.
>
>> 2) rename the existing remote branches in the same way
>
> I'm not sure how I can do it. 'trunk' is the only remote-tracking svn
> branches under .git/refs/. Here is how it looks:
>
> ls -R .git/refs
> .git/refs: heads remotes tags
> .git/refs/heads: master
> .git/refs/remotes: trunk
>
> Still, a 'branch0' remote exist:
>
> git show-ref
> refs/heads/master
> refs/remotes/branch0
> refs/remotes/trunk
You can do (bash)
for b in trunk branch0
do
git update-ref refs/remotes/yournewprefix/$b refs/remotes/$b
git update-ref -d refs/remotes/$b
done
OTOH, any incarnation of "git -m" (with or without "-r", specifying
refs/remotes/trunk, remotes/trunk or trunk) failed.
Michael
^ 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