* Re: [PATCH] Teach --text option to diff
From: Junio C Hamano @ 2006-07-07 11:06 UTC (permalink / raw)
To: Stephan Feder; +Cc: git
In-Reply-To: <11522684373987-git-send-email-sf@b-i-t.de>
Stephan Feder <sf@b-i-t.de> writes:
> I have to send patches of binary data to a customer but the builtin diff
> was no help in this case.
Given the previous patch, and also your point #2 below, I would
have expected you to introduce an option to force files to be
treated as binary even when they are otherwise misidentified as
text, but this patch is going the other way.
Interesting.
> 1. The shorthand -a for --text is not implemented. Is there a conflicting
> shorthand?
I do not think of one offhand, but it's the responsibility for
the party to propose such an enhancement to do the study ;-)
> 2. For diffstat --text is ignored. It seems pointless because binary
> patch data is not for human consumption anyway.
> 3. No documentation yet. If the patch is accepted I will add a short
> description. To Documentation/diff-options.txt?
Most likely that would be the place.
^ permalink raw reply
* [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly
From: Peter Baumann @ 2006-07-07 10:55 UTC (permalink / raw)
To: git; +Cc: Martin Langhoff, Junio C Hamano
git-cvsexportcommit should check if the parent (supplied on the cmdline) to use
for a merge commit is one of the real parents of the merge.
But it errors out if the _first_ parent doesn't match and never checks
the other parents.
Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
---
This is a resend with an improved description, because my first attempt
didn't generate enough attention :-)
git-cvsexportcommit.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index d1051d0..5dcb2f9 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -63,15 +63,15 @@ foreach my $p (@commit) {
}
if ($parent) {
+ my $found;
# double check that it's a valid parent
foreach my $p (@parents) {
- my $found;
if ($p eq $parent) {
$found = 1;
last;
}; # found it
- die "Did not find $parent in the parents for this commit!";
}
+ die "Did not find $parent in the parents for this commit!" if !$found;
} else { # we don't have a parent from the cmdline...
if (@parents == 1) { # it's safe to get it from the commit
$parent = $parents[0];
--
1.4.0
^ permalink raw reply related
* Re: [PATCH] Do not drop data from '\0' until eol in patch output
From: Junio C Hamano @ 2006-07-07 10:52 UTC (permalink / raw)
To: Stephan Feder; +Cc: git
In-Reply-To: <1152268424350-git-send-email-sf@b-i-t.de>
Stephan Feder <sf@b-i-t.de> writes:
> The binary file detection is just a heuristic which can well fail.
> Do not produce garbage patches in these cases.
>
> Signed-off-by: Stephan Feder <sf@b-i-t.de>
Thanks.
I do not think this patch is _wrong_ per se, but I wonder what
you would use a patch like that for. Specifically, do you apply
such a patch with NUL and other binary data in it, and if so
what tool do you use?
^ permalink raw reply
* Re: [PATCH] builtin-log: respect diff configuration options
From: Junio C Hamano @ 2006-07-07 10:43 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <11522670482020-git-send-email-normalperson@yhbt.net>
Eric Wong <normalperson@yhbt.net> writes:
> The log commands are all capable of generating diffs, so we
> should respect those configuration options for diffs here.
>
> Signed-off-by: Eric Wong <normalperson@yhbt.net>
Makes sense. This makes "git log -p" more colorful ;-).
^ permalink raw reply
* [PATCH] Teach --text option to diff
From: Stephan Feder @ 2006-07-07 10:33 UTC (permalink / raw)
To: git
Add new item text to struct diff_options.
If set then do not try to detect binary files.
Signed-off-by: Stephan Feder <sf@b-i-t.de>
---
I have to send patches of binary data to a customer but the builtin diff
was no help in this case.
Notes:
1. The shorthand -a for --text is not implemented. Is there a conflicting
shorthand?
2. For diffstat --text is ignored. It seems pointless because binary
patch data is not for human consumption anyway.
3. No documentation yet. If the patch is accepted I will add a short
description. To Documentation/diff-options.txt?
Regards
Stephan
diff.c | 5 ++++-
diff.h | 1 +
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index f0450a8..1f0219d 100644
--- a/diff.c
+++ b/diff.c
@@ -723,7 +723,7 @@ static void builtin_diff(const char *nam
if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0)
die("unable to read files to diff");
- if (mmfile_is_binary(&mf1) || mmfile_is_binary(&mf2)) {
+ if (!o->text && (mmfile_is_binary(&mf1) || mmfile_is_binary(&mf2))) {
/* Quite common confusing case */
if (mf1.size == mf2.size &&
!memcmp(mf1.ptr, mf2.ptr, mf1.size))
@@ -1561,6 +1561,9 @@ int diff_opt_parse(struct diff_options *
options->output_format |= DIFF_FORMAT_PATCH;
options->full_index = options->binary = 1;
}
+ else if (!strcmp(arg, "--text")) {
+ options->text = 1;
+ }
else if (!strcmp(arg, "--name-only"))
options->output_format |= DIFF_FORMAT_NAME;
else if (!strcmp(arg, "--name-status"))
diff --git a/diff.h b/diff.h
index d557394..f80f646 100644
--- a/diff.h
+++ b/diff.h
@@ -42,6 +42,7 @@ struct diff_options {
unsigned recursive:1,
tree_in_recursive:1,
binary:1,
+ text:1,
full_index:1,
silent_on_remove:1,
find_copies_harder:1,
--
1.4.1.gbc483
^ permalink raw reply related
* [PATCH] Do not drop data from '\0' until eol in patch output
From: Stephan Feder @ 2006-07-07 10:33 UTC (permalink / raw)
To: git
The binary file detection is just a heuristic which can well fail.
Do not produce garbage patches in these cases.
Signed-off-by: Stephan Feder <sf@b-i-t.de>
---
diff.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index 507e401..f0450a8 100644
--- a/diff.c
+++ b/diff.c
@@ -329,7 +329,9 @@ static void fn_out_consume(void *priv, c
}
if (len > 0 && line[len-1] == '\n')
len--;
- printf("%s%.*s%s\n", set, (int) len, line, reset);
+ fputs (set, stdout);
+ fwrite (line, len, 1, stdout);
+ puts (reset);
}
static char *pprint_rename(const char *a, const char *b)
--
1.4.1.gbc483
^ permalink raw reply related
* Re: [PATCH] diff.c: respect diff.renames config option
From: Junio C Hamano @ 2006-07-07 10:22 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <11522670473116-git-send-email-normalperson@yhbt.net>
Eric Wong <normalperson@yhbt.net> writes:
> diff.renames is mentioned several times in the documentation,
> but to my surprise it didn't do anything before this patch.
I am really reluctant to do this at this low-level, especially
since there is no way to defeat the settings from the command
line.
> @@ -120,6 +121,16 @@ int git_diff_config(const char *var, con
> diff_use_color_default = git_config_bool(var, value);
> return 0;
> }
> + if (!strcmp(var, "diff.renames")) {
> + if (!value)
> + diff_detect_rename_default = DIFF_DETECT_RENAME;
> + else if (!strcasecmp(value, "copies") ||
> + !strcasecmp(value, "copy"))
> + diff_detect_rename_default = DIFF_DETECT_COPY;
> + else
> + diff_detect_rename_default = git_config_bool(var,value);
> + return 0;
> + }
I suspect this works only because DIFF_DETECT_RENAME happens to
be 1?
^ permalink raw reply
* [PATCH] builtin-log: respect diff configuration options
From: Eric Wong @ 2006-07-07 10:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
In-Reply-To: <11522670473116-git-send-email-normalperson@yhbt.net>
The log commands are all capable of generating diffs, so we
should respect those configuration options for diffs here.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
builtin-log.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 864c6cd..698b71e 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -47,6 +47,7 @@ int cmd_whatchanged(int argc, const char
{
struct rev_info rev;
+ git_config(git_diff_config);
init_revisions(&rev);
rev.diff = 1;
rev.diffopt.recursive = 1;
@@ -61,6 +62,7 @@ int cmd_show(int argc, const char **argv
{
struct rev_info rev;
+ git_config(git_diff_config);
init_revisions(&rev);
rev.diff = 1;
rev.diffopt.recursive = 1;
@@ -77,6 +79,7 @@ int cmd_log(int argc, const char **argv,
{
struct rev_info rev;
+ git_config(git_diff_config);
init_revisions(&rev);
rev.always_show_header = 1;
cmd_log_init(argc, argv, envp, &rev);
@@ -102,7 +105,7 @@ static int git_format_config(const char
strcat(extra_headers, value);
return 0;
}
- return git_default_config(var, value);
+ return git_diff_config(var, value);
}
@@ -234,6 +237,7 @@ int cmd_format_patch(int argc, const cha
struct diff_options patch_id_opts;
char *add_signoff = NULL;
+ git_config(git_format_config);
init_revisions(&rev);
rev.commit_format = CMIT_FMT_EMAIL;
rev.verbose_header = 1;
@@ -243,7 +247,6 @@ int cmd_format_patch(int argc, const cha
rev.diffopt.msg_sep = "";
rev.diffopt.recursive = 1;
- git_config(git_format_config);
rev.extra_headers = extra_headers;
/*
--
1.4.1.g3dc65
^ permalink raw reply related
* [PATCH 0/1] I forgot to run format-patch with the -M flag
From: Eric Wong @ 2006-07-07 10:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
Now I can forget more often :) Unless the similarity is too low.
I'm not too sure if I'd want to set similarity or find-copies-harder
into my config just yet, since they depend on the situation. But I
usually want renames in my diffs.
--
Eric Wong
^ permalink raw reply
* [PATCH] diff.c: respect diff.renames config option
From: Eric Wong @ 2006-07-07 10:10 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
In-Reply-To: <11522670452824-git-send-email-normalperson@yhbt.net>
diff.renames is mentioned several times in the documentation,
but to my surprise it didn't do anything before this patch.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
Documentation/config.txt | 5 +++++
diff.c | 12 ++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index f075f19..5290a8f 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -114,6 +114,11 @@ diff.renameLimit::
The number of files to consider when performing the copy/rename
detection; equivalent to the git diff option '-l'.
+diff.renames::
+ Tells git to detect renames. If set to any boolean value, it
+ will enable basic rename detection. If set to "copies" or
+ "copy", it will detect copies, as well.
+
format.headers::
Additional email headers to include in a patch to be submitted
by mail. See gitlink:git-format-patch[1].
diff --git a/diff.c b/diff.c
index 507e401..223622a 100644
--- a/diff.c
+++ b/diff.c
@@ -13,6 +13,7 @@ #include "xdiff-interface.h"
static int use_size_cache;
+static int diff_detect_rename_default = 0;
static int diff_rename_limit_default = -1;
static int diff_use_color_default = 0;
@@ -120,6 +121,16 @@ int git_diff_config(const char *var, con
diff_use_color_default = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "diff.renames")) {
+ if (!value)
+ diff_detect_rename_default = DIFF_DETECT_RENAME;
+ else if (!strcasecmp(value, "copies") ||
+ !strcasecmp(value, "copy"))
+ diff_detect_rename_default = DIFF_DETECT_COPY;
+ else
+ diff_detect_rename_default = git_config_bool(var,value);
+ return 0;
+ }
if (!strncmp(var, "diff.color.", 11)) {
int slot = parse_diff_color_slot(var, 11);
diff_colors[slot] = parse_diff_color_value(value, var);
@@ -1429,6 +1440,7 @@ void diff_setup(struct diff_options *opt
options->change = diff_change;
options->add_remove = diff_addremove;
options->color_diff = diff_use_color_default;
+ options->detect_rename = diff_detect_rename_default;
}
int diff_setup_done(struct diff_options *options)
--
1.4.1.g3dc65
^ permalink raw reply related
* [PATCH] git-svn: migrate out of contrib
From: Eric Wong @ 2006-07-07 10:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8xn64658.fsf@assigned-by-dhcp.cox.net>
Allow NO_SVN_TESTS to be defined to skip git-svn tests. These
tests are time-consuming due to SVN being slow, and even more so
if SVN Perl libraries are not available.
Also added a check for SVN::Core so test 910[45] don't fail
if the user doesn't have those installed, thanks to Junio for
noticing this.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
Junio C Hamano <junkio@cox.net> wrote:
> Overall it looks good.
>
> 9104 and 9105 fail when GIT_SVN_NO_LIB is unset and the
> libsvn-*-perl is not available. Maybe check this just like you
> check and omit tests when svn or svnadmin is unavailable?
Done. While I was at it, I changed the test != to test -eq
and brought the similarity below the threshold, which may
make me want to expand on another patch...
.gitignore | 1
{contrib/git-svn => Documentation}/git-svn.txt | 0
Makefile | 6 ++-
contrib/git-svn/.gitignore | 4 --
contrib/git-svn/Makefile | 44 --------------------
contrib/git-svn/git-svn.perl => git-svn.perl | 2 -
t/Makefile | 10 +++++
{contrib/git-svn/t => t}/lib-git-svn.sh | 29 ++++++++-----
.../t9100-git-svn-basic.sh | 4 ++
.../t9101-git-svn-props.sh | 0
.../t9102-git-svn-deep-rmdir.sh | 0
.../t9103-git-svn-graft-branches.sh | 0
.../t9104-git-svn-follow-parent.sh | 0
.../t9105-git-svn-commit-diff.sh | 0
14 files changed, 37 insertions(+), 63 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2bcc604..52d61f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,6 +107,7 @@ git-ssh-push
git-ssh-upload
git-status
git-stripspace
+git-svn
git-svnimport
git-symbolic-ref
git-tag
diff --git a/contrib/git-svn/git-svn.txt b/Documentation/git-svn.txt
similarity index 100%
rename from contrib/git-svn/git-svn.txt
rename to Documentation/git-svn.txt
diff --git a/Makefile b/Makefile
index 202f261..a0e90c0 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,10 @@ #
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
# Enable it on Windows. By default, symrefs are still used.
#
+# Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability
+# tests. These tests take up a significant amount of the total test time
+# but are not needed unless you plan to talk to SVN repos.
+#
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
@@ -134,7 +138,7 @@ SCRIPT_PERL = \
git-shortlog.perl git-rerere.perl \
git-annotate.perl git-cvsserver.perl \
git-svnimport.perl git-mv.perl git-cvsexportcommit.perl \
- git-send-email.perl
+ git-send-email.perl git-svn.perl
SCRIPT_PYTHON = \
git-merge-recursive.py
diff --git a/contrib/git-svn/.gitignore b/contrib/git-svn/.gitignore
deleted file mode 100644
index d8d87e3..0000000
--- a/contrib/git-svn/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-git-svn
-git-svn.xml
-git-svn.html
-git-svn.1
diff --git a/contrib/git-svn/Makefile b/contrib/git-svn/Makefile
deleted file mode 100644
index 7c20946..0000000
--- a/contrib/git-svn/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-all: git-svn
-
-prefix?=$(HOME)
-bindir=$(prefix)/bin
-mandir=$(prefix)/man
-man1=$(mandir)/man1
-INSTALL?=install
-doc_conf=../../Documentation/asciidoc.conf
--include ../../config.mak
-
-git-svn: git-svn.perl
- cp $< $@
- chmod +x $@
-
-install: all
- $(INSTALL) -d -m755 $(DESTDIR)$(bindir)
- $(INSTALL) git-svn $(DESTDIR)$(bindir)
-
-install-doc: doc
- $(INSTALL) git-svn.1 $(DESTDIR)$(man1)
-
-doc: git-svn.1
-git-svn.1 : git-svn.xml
- xmlto man git-svn.xml
-git-svn.xml : git-svn.txt
- asciidoc -b docbook -d manpage \
- -f ../../Documentation/asciidoc.conf $<
-git-svn.html : git-svn.txt
- asciidoc -b xhtml11 -d manpage \
- -f ../../Documentation/asciidoc.conf $<
-test: git-svn
- cd t && for i in t????-*.sh; do $(SHELL) ./$$i $(TEST_FLAGS); done
-
-# we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
-full-test:
- $(MAKE) test GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
- $(MAKE) test GIT_SVN_NO_LIB=0 GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
- $(MAKE) test GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
- LC_ALL=en_US.UTF-8
- $(MAKE) test GIT_SVN_NO_LIB=0 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
- LC_ALL=en_US.UTF-8
-
-clean:
- rm -f git-svn *.xml *.html *.1
diff --git a/contrib/git-svn/git-svn.perl b/git-svn.perl
similarity index 100%
rename from contrib/git-svn/git-svn.perl
rename to git-svn.perl
index 8bc4188..145eaa8 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/git-svn.perl
@@ -8,7 +8,7 @@ use vars qw/ $AUTHOR $VERSION
$GIT_SVN_INDEX $GIT_SVN
$GIT_DIR $GIT_SVN_DIR $REVDB/;
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
-$VERSION = '1.1.1-broken';
+$VERSION = '@@GIT_VERSION@@';
use Cwd qw/abs_path/;
$GIT_DIR = abs_path($ENV{GIT_DIR} || '.git');
diff --git a/t/Makefile b/t/Makefile
index 632c55f..8983509 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -11,6 +11,7 @@ # Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
+TSVN = $(wildcard t91[0-9][0-9]-*.sh)
ifdef NO_PYTHON
GIT_TEST_OPTS += --no-python
@@ -24,6 +25,15 @@ all: $(T) clean
clean:
rm -fr trash
+# we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
+full-svn-test:
+ $(MAKE) $(TSVN) GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
+ $(MAKE) $(TSVN) GIT_SVN_NO_LIB=0 GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
+ $(MAKE) $(TSVN) GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
+ LC_ALL=en_US.UTF-8
+ $(MAKE) $(TSVN) GIT_SVN_NO_LIB=0 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
+ LC_ALL=en_US.UTF-8
+
.PHONY: $(T) clean
.NOTPARALLEL:
diff --git a/contrib/git-svn/t/lib-git-svn.sh b/t/lib-git-svn.sh
similarity index 49%
rename from contrib/git-svn/t/lib-git-svn.sh
rename to t/lib-git-svn.sh
index d7f972a..29a1e72 100644
--- a/contrib/git-svn/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -1,30 +1,35 @@
-PATH=$PWD/../:$PATH
-if test -d ../../../t
+. ./test-lib.sh
+
+if test -n "$NO_SVN_TESTS"
then
- cd ../../../t
-else
- echo "Must be run in contrib/git-svn/t" >&2
- exit 1
+ test_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :
+ test_done
+ exit
fi
-. ./test-lib.sh
-
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree
+perl -e 'use SVN::Core' >/dev/null 2>&1
+if test $? -ne 0
+then
+ echo 'Perl SVN libraries not found, tests requiring those will be skipped'
+ GIT_SVN_NO_LIB=1
+fi
+
svnadmin >/dev/null 2>&1
-if test $? != 1
+if test $? -ne 1
then
- test_expect_success 'skipping contrib/git-svn test' :
+ test_expect_success 'skipping git-svn tests, svnadmin not found' :
test_done
exit
fi
svn >/dev/null 2>&1
-if test $? != 1
+if test $? -ne 1
then
- test_expect_success 'skipping contrib/git-svn test' :
+ test_expect_success 'skipping git-svn tests, svn not found' :
test_done
exit
fi
diff --git a/contrib/git-svn/t/t0000-contrib-git-svn.sh b/t/t9100-git-svn-basic.sh
old mode 100644
new mode 100755
similarity index 98%
rename from contrib/git-svn/t/t0000-contrib-git-svn.sh
rename to t/t9100-git-svn-basic.sh
index b482bb6..bf1d638
--- a/contrib/git-svn/t/t0000-contrib-git-svn.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -3,7 +3,7 @@ #
# Copyright (c) 2006 Eric Wong
#
-test_description='git-svn tests'
+test_description='git-svn basic tests'
GIT_SVN_LC_ALL=$LC_ALL
case "$LC_ALL" in
@@ -17,6 +17,8 @@ esac
. ./lib-git-svn.sh
+echo 'define NO_SVN_TESTS to skip git-svn tests'
+
mkdir import
cd import
diff --git a/contrib/git-svn/t/t0001-contrib-git-svn-props.sh b/t/t9101-git-svn-props.sh
old mode 100644
new mode 100755
similarity index 100%
rename from contrib/git-svn/t/t0001-contrib-git-svn-props.sh
rename to t/t9101-git-svn-props.sh
diff --git a/contrib/git-svn/t/t0002-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh
old mode 100644
new mode 100755
similarity index 100%
rename from contrib/git-svn/t/t0002-deep-rmdir.sh
rename to t/t9102-git-svn-deep-rmdir.sh
diff --git a/contrib/git-svn/t/t0003-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh
old mode 100644
new mode 100755
similarity index 100%
rename from contrib/git-svn/t/t0003-graft-branches.sh
rename to t/t9103-git-svn-graft-branches.sh
diff --git a/contrib/git-svn/t/t0004-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
old mode 100644
new mode 100755
similarity index 100%
rename from contrib/git-svn/t/t0004-follow-parent.sh
rename to t/t9104-git-svn-follow-parent.sh
diff --git a/contrib/git-svn/t/t0005-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh
old mode 100644
new mode 100755
similarity index 100%
rename from contrib/git-svn/t/t0005-commit-diff.sh
rename to t/t9105-git-svn-commit-diff.sh
--
1.4.1.g3dc65
^ permalink raw reply related
* Re: A note on merging conflicts..
From: Junio C Hamano @ 2006-07-07 8:26 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0606301927260.12404@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> One thing that is _very_ useful to do is to do when you have a conflict is
> this:
>
> git log -p HEAD MERGE_BASE..MERGE_HEAD -- conflicting-filename
>
> so that I wouldn't have to type that by hand ever again, and doing a
>
> git log -p --merge drivers/
>
> would automatically give me exactly that for all the unmerged files in
> drivers/.
>
> Anybody want to try to make me happy, and learn some git internals at the
> same time?
I was hoping somebody else would come forward, but it's been a
week, so here it is.
-- >8 --
[PATCH] git log -p --merge [[--] paths...]
This adds Linus's wish, "--merge" flag, which makes the above
expand to a rough equivalent to:
git log -p HEAD MERGE_HEAD ^$(git-merge-base HEAD MERGE_HEAD) \
-- $(git-ls-files -u [paths...] | cut -f2 | uniq)
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
revision.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/revision.c b/revision.c
index 27fc1e3..e7128f2 100644
--- a/revision.c
+++ b/revision.c
@@ -548,6 +548,49 @@ static void add_pending_commit_list(stru
}
}
+static void prepare_show_merge(struct rev_info *revs)
+{
+ struct commit_list *bases;
+ struct commit *head, *other;
+ unsigned char sha1[20];
+ const char **prune = NULL;
+ int i, prune_num = 1; /* counting terminating NULL */
+
+ if (get_sha1("HEAD", sha1) || !(head = lookup_commit(sha1)))
+ die("--merge without HEAD?");
+ if (get_sha1("MERGE_HEAD", sha1) || !(other = lookup_commit(sha1)))
+ die("--merge without MERGE_HEAD?");
+ add_pending_object(revs, &head->object, "HEAD");
+ add_pending_object(revs, &other->object, "MERGE_HEAD");
+ bases = get_merge_bases(head, other, 1);
+ while (bases) {
+ struct commit *it = bases->item;
+ struct commit_list *n = bases->next;
+ free(bases);
+ bases = n;
+ it->object.flags |= UNINTERESTING;
+ add_pending_object(revs, &it->object, "(merge-base)");
+ }
+
+ if (!active_nr)
+ read_cache();
+ for (i = 0; i < active_nr; i++) {
+ struct cache_entry *ce = active_cache[i];
+ if (!ce_stage(ce))
+ continue;
+ if (ce_path_match(ce, revs->prune_data)) {
+ prune_num++;
+ prune = xrealloc(prune, sizeof(*prune) * prune_num);
+ prune[prune_num-2] = ce->name;
+ prune[prune_num-1] = NULL;
+ }
+ while ((i+1 < active_nr) &&
+ ce_same_name(ce, active_cache[i+1]))
+ i++;
+ }
+ revs->prune_data = prune;
+}
+
/*
* Parse revision information, filling in the "rev_info" structure,
* and removing the used arguments from the argument list.
@@ -557,7 +600,7 @@ static void add_pending_commit_list(stru
*/
int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
{
- int i, flags, seen_dashdash;
+ int i, flags, seen_dashdash, show_merge;
const char **unrecognized = argv + 1;
int left = 1;
@@ -574,7 +617,7 @@ int setup_revisions(int argc, const char
break;
}
- flags = 0;
+ flags = show_merge = 0;
for (i = 1; i < argc; i++) {
struct object *object;
const char *arg = argv[i];
@@ -641,6 +684,10 @@ int setup_revisions(int argc, const char
def = argv[i];
continue;
}
+ if (!strcmp(arg, "--merge")) {
+ show_merge = 1;
+ continue;
+ }
if (!strcmp(arg, "--topo-order")) {
revs->topo_order = 1;
continue;
@@ -861,6 +908,8 @@ int setup_revisions(int argc, const char
object = get_reference(revs, arg, sha1, flags ^ local_flags);
add_pending_object(revs, object, arg);
}
+ if (show_merge)
+ prepare_show_merge(revs);
if (def && !revs->pending.nr) {
unsigned char sha1[20];
struct object *object;
--
1.4.1.g4d2af
^ permalink raw reply related
* Re: [PATCH] Add "raw" output option to blobs in "tree" view format
From: Junio C Hamano @ 2006-07-07 6:58 UTC (permalink / raw)
To: ltuikov; +Cc: git
In-Reply-To: <20060707063930.7752.qmail@web31805.mail.mud.yahoo.com>
Luben Tuikov <ltuikov@yahoo.com> writes:
> Add a "raw" output option to blobs in "tree" view format, so that the
> user doesn't have to click on "blob", wait for the (binary) file to be
> uploaded and shown in "blob" mode, and then click on "plain" to
> download the (binary) file.
I appreciate what you are trying to achieve, but at the same
time wonder if it would make more sense to simply teach a=blob
action to do this automatically, perhaps using /etc/mime.types
and/or File::MMagic.
If you know your MUA will mangle whitespace to make your patch
inapplicable, please do not add a patch to the message _and_
attach the patch to the message. The mail-acceptance tools know
how to flatten MIME attachments, but if you have your log,
three-dash and then corrupt patch in the cover-letter part, and
then the true patch in the attachment part, the flattened result
will have the corrupt patch first to cause the patch application
to fail. So please either (preferably) use a MUA that does not
corrupt your patches, or do a log in the message part with patch
only as attachment.
^ permalink raw reply
* [PATCH] Add "raw" output option to blobs in "tree" view format
From: Luben Tuikov @ 2006-07-07 6:39 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
Add a "raw" output option to blobs in "tree" view format, so that the
user doesn't have to click on "blob", wait for the (binary) file to be
uploaded and shown in "blob" mode, and then click on "plain" to
download the (binary) file.
This is useful when the file is clearly binary and we don't want the
browser to upload and display it in "blob" mode, but we just want to
download it. Case in point: pdf files, wlg.
Note: the "raw" format is equivalent to the blob->plain view, not
blob->head view. I.e. the view has the hash of the file as listed
by git-ls-tree, not just "HEAD".
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
gitweb/gitweb.cgi | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 3e2790c..cce0753 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1668,6 +1668,7 @@ sub git_tree {
$cgi->a({-href => "$my_uri?" .
esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob") .
# " | " . $cgi->a({-href => "$my_uri?" .
esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame") .
" | " . $cgi->a({-href => "$my_uri?" .
esc_param("p=$project;a=history;h=$hash_base;f=$base$t_name")}, "history") .
+ " | " . $cgi->a({-href => "$my_uri?" .
esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
"</td>\n";
} elsif ($t_type eq "tree") {
print "<td class=\"list\">" .
--
1.4.1.g88ada
[-- Attachment #2: 2829251161-patch.patch --]
[-- Type: application/octet-stream, Size: 790 bytes --]
26f034dc7bf30e675d53da4f215ca2e1e6b88d1f
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 3e2790c..cce0753 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1668,6 +1668,7 @@ sub git_tree {
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob") .
# " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame") .
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$hash_base;f=$base$t_name")}, "history") .
+ " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
"</td>\n";
} elsif ($t_type eq "tree") {
print "<td class=\"list\">" .
^ permalink raw reply related
* Re: [RFC/PATCH] git-svn: migrate out of contrib
From: Junio C Hamano @ 2006-07-07 0:20 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <11521700563472-git-send-email-normalperson@yhbt.net>
Overall it looks good.
9104 and 9105 fail when GIT_SVN_NO_LIB is unset and the
libsvn-*-perl is not available. Maybe check this just like you
check and omit tests when svn or svnadmin is unavailable?
^ permalink raw reply
* Re: git on HP-UX
From: Junio C Hamano @ 2006-07-07 0:20 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1152197629.7720.10.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
>> I needed following changes in order to make git compile on HP-UX:
>> +ifeq ($(uname_S),HP-UX)
>> + NO_IPV6 = YesPlease
>> + NO_CURL = YesPlease
>
> Is there any fundamental problem with curl and IPv6 on HP-UX? I don't
> think so.
>
> Sorry for using your path as a bad example, but the appearance of such
> patches is a perfect argument for a real configure script. If we
> continue patching Makefile, we'll drown in such conditionals.
Conditionals like 'ifdef NO_IPV6' in Makefile are good, but
conditionals switch on platforms to set/reset them are not.
A configure script to set them in config.mak.gen is the way to
go, I would agree.
> I hope the Autoconf based configure is on its way to git, but I don't
> see in in the "pu" branch yet. I'm not very keen about reinventing
> Autoconf and hacking a hand-made configure script.
OK, you half-convinced me. The other half came from a recent
series of patches to try using 'which' to detect executables,
which is another common mistake handcrafted configure script
makes, which autoconf people have solved for us long time ago.
^ permalink raw reply
* Re: [PATCH] Fix compilation
From: Junio C Hamano @ 2006-07-07 0:15 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0607070120590.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Without this, make 3.79.1 (Darwin) says
>
> rm -f git-archimport git-archimport+
> INSTLIBDIR=`make -C perl -s --no-print-directory instlibdir` && \
> sed -e '1s|#!.*perl|#!/usr/bin/perl|1' \
> -e '2i\
> use lib (split(/:/, $ENV{GITPERLLIB} || '\'"$INSTLIBDIR"\''));' \
> -e 's|@@INSTLIBDIR@@|'"$INSTLIBDIR"'|g' \
> -e 's/@@GIT_VERSION@@/1.4.1.gb564-dirty/g' \
> git-archimport.perl >git-archimport+
> sed: 1: "2i use lib (split(/:/, ...": command i expects \ followed by text
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Traditionally 'i' and 'a' command to sed has been unfriendly
with make, primarily because different make implementations did
unexpected things to backslashes at the end of lines.
For portability I would even suggest making that command into a
separate helper shell script, and call that from the Makefile.
> Note that this just fixes compilation, not the tests. All of
> a sudden, I have to install Scalar::Util, where things were
> fine before Git.pm.
I recall Pasky talking about Scalar::Util removal and I thought
I took a patch.
... goes "git grep" ...
Ah the private edition of Error.pm pulls that in. Sheesh.
^ permalink raw reply
* Re: git-fetch per-repository speed issues
From: David Woodhouse @ 2006-07-06 23:36 UTC (permalink / raw)
To: Keith Packard; +Cc: Git Mailing List
In-Reply-To: <1151949764.4723.51.camel@neko.keithp.com>
On Mon, 2006-07-03 at 11:02 -0700, Keith Packard wrote:
> just uses ssh for everything. This slows down the connection process
> by several seconds.
Only if you forgot to use the 'control socket' support, which lets you
make a _single_ authenticated connection and re-use it for multiple
sessions.
http://david.woodhou.se/openssh-control.html has a couple of
improvements, but the basics are usable in upstream openssh.
--
dwmw2
^ permalink raw reply
* [PATCH] Fix compilation
From: Johannes Schindelin @ 2006-07-06 23:21 UTC (permalink / raw)
To: git, junkio
Without this, make 3.79.1 (Darwin) says
rm -f git-archimport git-archimport+
INSTLIBDIR=`make -C perl -s --no-print-directory instlibdir` && \
sed -e '1s|#!.*perl|#!/usr/bin/perl|1' \
-e '2i\
use lib (split(/:/, $ENV{GITPERLLIB} || '\'"$INSTLIBDIR"\''));' \
-e 's|@@INSTLIBDIR@@|'"$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/1.4.1.gb564-dirty/g' \
git-archimport.perl >git-archimport+
sed: 1: "2i use lib (split(/:/, ...": command i expects \ followed by text
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
Note that this just fixes compilation, not the tests. All of
a sudden, I have to install Scalar::Util, where things were
fine before Git.pm.
Note also, that this patch relies on the perl scripts not
caring if an additional command is shifted into the 2nd line.
I checked all of them, and they don't.
Makefile | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -563,8 +563,7 @@ common-cmds.h: Documentation/git-*.txt
rm -f $@ $@+
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
- -e '2i\
- use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
+ -e "2s=^=use lib (split(/:/, \$$ENV{GITPERLLIB} || \'$$INSTLIBDIR\')); =g" \
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+
^ permalink raw reply
* Re: Re: git-log output changed from 1.4.0 -> 1.4.1?
From: Robin Luckey @ 2006-07-06 22:09 UTC (permalink / raw)
To: git
In-Reply-To: <7vlkr65rbo.fsf@assigned-by-dhcp.cox.net>
> In the meantime, "git log --raw -r ..." would give you want you
> want, I think.
This did the trick! Thanks for the quick responses.
Robin
^ permalink raw reply
* Re: git-log output changed from 1.4.0 -> 1.4.1?
From: Junio C Hamano @ 2006-07-06 21:58 UTC (permalink / raw)
To: Robin Luckey; +Cc: git
In-Reply-To: <761519800607061451n9473ad4oa9e2781517ca9389@mail.gmail.com>
"Robin Luckey" <robinluckey@gmail.com> writes:
> In git 1.4.0, the following command...
>
> git log -r --root --abbrev=40 master
After Timo's diff options rewrite, -r does not seem to
automatically imply diff output anymore. I personally think it
should.
In the meantime, "git log --raw -r ..." would give you want you
want, I think.
^ permalink raw reply
* Re: git-log output changed from 1.4.0 -> 1.4.1?
From: Johannes Schindelin @ 2006-07-06 21:56 UTC (permalink / raw)
To: Robin Luckey; +Cc: git
In-Reply-To: <761519800607061451n9473ad4oa9e2781517ca9389@mail.gmail.com>
Hi,
On Thu, 6 Jul 2006, Robin Luckey wrote:
> In git 1.4.0, the following command...
>
> git log -r --root --abbrev=40 master
>
> ...would generate log entries like this...
>
> commit 8db998464a3cc7f41728ac8bb59aee0f62e14aa8
> Author: someone <someone>
> Date: Sun Aug 29 09:44:49 2004 +0000
>
> A comment goes here.
>
> :100755 000000 56f5eb6c914c7ff6706dc3f8736a77d155cad93f
> 0000000000000000000000000000000000000000 D someapp/file1.c
> :100755 000000 d7e0277fe15bfc11f75cbc535ecf1c5ee3d79baf
> 0000000000000000000000000000000000000000 D someapp/file2.c
>
> Is there a way to generate this same format with git 1.4.1?
I do not know about git 1.4.1, but with 'next' you can just add '--raw' to
the command line, and it works.
Hth,
Dscho
^ permalink raw reply
* git-log output changed from 1.4.0 -> 1.4.1?
From: Robin Luckey @ 2006-07-06 21:51 UTC (permalink / raw)
To: git
We use a custom script to generate reports based on the git-log
output. However, it appears that the output of git-log has changed in
1.4.1, and I have been unable to discover a set of flags to recreate
the log format to which I have become accustomed.
In git 1.4.0, the following command...
git log -r --root --abbrev=40 master
...would generate log entries like this...
commit 8db998464a3cc7f41728ac8bb59aee0f62e14aa8
Author: someone <someone>
Date: Sun Aug 29 09:44:49 2004 +0000
A comment goes here.
:100755 000000 56f5eb6c914c7ff6706dc3f8736a77d155cad93f
0000000000000000000000000000000000000000 D someapp/file1.c
:100755 000000 d7e0277fe15bfc11f75cbc535ecf1c5ee3d79baf
0000000000000000000000000000000000000000 D someapp/file2.c
Is there a way to generate this same format with git 1.4.1?
Thanks,
Robin
^ permalink raw reply
* Re: Moving a topic branch forward: rebase vs. resolve
From: Linus Torvalds @ 2006-07-06 21:24 UTC (permalink / raw)
To: Marc Singer; +Cc: Git Mailing List
In-Reply-To: <20060706211008.GA6566@buici.com>
On Thu, 6 Jul 2006, Marc Singer wrote:
>
> So, I tried resolve which I would expect to apply the other direction,
> merging 234 onto C. git-resolve finishes in a single pass leaving
> conflict markers in a number of files. However, some of these are
> unexpected, conflicts in files that I've not and which I'd expect to
> merge cleanly. For example
>
> diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
> index 2975291..fea24ba 100644
> --- a/Documentation/DocBook/Makefile
> +++ b/Documentation/DocBook/Makefile
> @@ -2,15 +2,21 @@ ###
> # This makefile is used to generate the kernel documentation,
> # primarily based on in-line comments in various source files.
> # See Documentation/kernel-doc-nano-HOWTO.txt for instruction in how
> -# to ducument the SRC - and how to read it.
> +# to document the SRC - and how to read it.
> # To add a new book the only step required is to add the book to the
> # list of DOCBOOKS.
>
> DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
> kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
> procfs-guide.xml writing_usb_driver.xml \
> +<<<<<<< .merge_file_arWYZk
> kernel-api.xml journal-api.xml lsm.xml usb.xml \
> gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml
> +=======
> + kernel-api.xml journal-api.xml lsm.xml usb.xml \
> + gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
> + genericirq.xml
> +>>>>>>> .merge_file_G8cSmh
>
> We have a spelling fix and the addition of genericirq.xml. What would
> cause these sorts of conflicts? Is there someting I can do to
> eliminate them or resolve them properly?
Well, the spelling fix was already merged properly. I can't tell why it
thinks it conflicted on the addition of genericirq.xml, but it _looks_
like you may have done some whitespace changes. The merge result seems
obvious (pick the second hunk, possibly editing the whitespace to match).
If you wonder why a merge clashes, and you want to see what both branches
did, see the email thread a few days ago called "A note on merging
conflicts" on how to efficiently and easily see what the changes were in
both branches.
Linus
^ permalink raw reply
* Moving a topic branch forward: rebase vs. resolve
From: Marc Singer @ 2006-07-06 21:10 UTC (permalink / raw)
To: Git Mailing List
In moving a topic branch forward from about 2.6.16 to 2.6.18-rc1, I'm
finding little solace in either rebase or resolve.
REBASE
Rebase is an attractive method as it preserves the change history,
though in the end the only interesting bits are those that are merged
with master.
--1---2----3---4 master
\
--A--B--C topic
In rebasing ABC at 4, it looks like git is applying each patch in
turn. While this is strictly correct, it can make for a tedious merge
if both A and C modify the same piece of code *and* if revision 2
makes both A and C merge with conflicts. The result was an exhausting
march through the change sets.
RESOLVE
So, I tried resolve which I would expect to apply the other direction,
merging 234 onto C. git-resolve finishes in a single pass leaving
conflict markers in a number of files. However, some of these are
unexpected, conflicts in files that I've not and which I'd expect to
merge cleanly. For example
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 2975291..fea24ba 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -2,15 +2,21 @@ ###
# This makefile is used to generate the kernel documentation,
# primarily based on in-line comments in various source files.
# See Documentation/kernel-doc-nano-HOWTO.txt for instruction in how
-# to ducument the SRC - and how to read it.
+# to document the SRC - and how to read it.
# To add a new book the only step required is to add the book to the
# list of DOCBOOKS.
DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
procfs-guide.xml writing_usb_driver.xml \
+<<<<<<< .merge_file_arWYZk
kernel-api.xml journal-api.xml lsm.xml usb.xml \
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml
+=======
+ kernel-api.xml journal-api.xml lsm.xml usb.xml \
+ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
+ genericirq.xml
+>>>>>>> .merge_file_G8cSmh
We have a spelling fix and the addition of genericirq.xml. What would
cause these sorts of conflicts? Is there someting I can do to
eliminate them or resolve them properly?
Cheers.
^ 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