* Re: [PATCH] diff.c: respect diff.renames config option
From: Junio C Hamano @ 2006-07-07 12:17 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <7vpsghzmr1.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> I am more worried about somebody who opts-in finds breakage of
> commands that happen to internally use low-level diff machinery
> and expect the diff machinery does not automagically do funny
> rename detection without being told.
> ...
> That is why I said I do not want this at _that_ low level. I do
> not have objections to have the configuration at a layer closer
> to the UI, e.g. things in builtin-log.c and builtin-diff.c.
Upon closer look I think the revision pruning code is OK. So
let's cook this as is in "next" and see what happens.
^ permalink raw reply
* Re: [PATCH] Do not drop data from '\0' until eol in patch output
From: Junio C Hamano @ 2006-07-07 12:03 UTC (permalink / raw)
To: sf; +Cc: git
In-Reply-To: <44AE431C.4090509@b-i-t.de>
sf <sf@b-i-t.de> writes:
> GNU patch can apply patches with binary content which are typically
> produced with GNU diff with --text option.
Hmph. Things must have improved since I looked at it the last
time, perhaps 6-7 years ago. I remember that I used "diff -a
-u0" as an el-cheapo way to deliber binary contents but found
that patch sometimes could not grok such, and ended up writing a
small customized C program.
^ permalink raw reply
* Re: [PATCH] Teach --text option to diff
From: sf @ 2006-07-07 11:53 UTC (permalink / raw)
To: git
In-Reply-To: <7v64i91xow.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> 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.
Not really. I was surprised that the GNU diff option --text is
unsupported in the builtin diff.
>
>> 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 ;-)
Of course. I did not find any conflict but as the builtin diff and its
options are used by quite a lot of git commands I wanted to make sure.
If no objections arise I am going to add the 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?
>
> Most likely that would be the place.
Good.
^ permalink raw reply
* fatal: ambiguous argument '': unknown revision or path not in the working tree.
From: Michal Ludvig @ 2006-07-07 11:52 UTC (permalink / raw)
To: git
Hi all,
I'm getting this error from most cogito commands in my repository
(created with cg-init):
===
$ cg status
Heads:
>master 66ef937771695c865e38ff7227c077d9260759ce
? patches/series
fatal: ambiguous argument '': unknown revision or path not in the
working tree.
Use '--' to separate paths from revisions
===
I already have some commits and history in there that I'd prefer not to
loose. When I clone this repository the error disappears but I'd prefer
to fix it in place.
Any ideas?
Using cogito-0.17 and git-1.4.0
Thanks
Michal
^ permalink raw reply
* [PATCH] Makefile: export NO_SVN_TESTS
From: Johannes Schindelin @ 2006-07-07 11:26 UTC (permalink / raw)
To: git, junkio
Without this patch, it really is not sufficient to define NO_SVN_TESTS
in config.mak or the Makefile.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index e5e536a..2aa0123 100644
--- a/Makefile
+++ b/Makefile
@@ -708,6 +708,7 @@ # However, the environment gets quite bi
# with that.
export NO_PYTHON
+export NO_SVN_TESTS
test: all
$(MAKE) -C t/ all
--
1.4.1.g2e7c-dirty
^ permalink raw reply related
* Re: [PATCH 1/3] configure: Add test for Perl
From: Timo Hirvonen @ 2006-07-07 11:23 UTC (permalink / raw)
To: Petr Baudis; +Cc: dennis, git
In-Reply-To: <20060707110655.GR29115@pasky.or.cz>
Petr Baudis <pasky@suse.cz> wrote:
> Dear diary, on Thu, Jul 06, 2006 at 03:10:11PM CEST, I got a letter
> where Timo Hirvonen <tihirvon@gmail.com> said that...
> > "which" isn't portable. On SunOS 5.9 "which foo" prints error message to
> > stdout and returns 0.
>
> Wait, Git runs on SunOS 5.9?
I have no idea. I noticed the problem with "which" when I ported my
cmus configure scripts to SunOS.
In the git Makefile there are:
ifeq ($(uname_S),SunOS)
...
ifeq ($(uname_R),5.8)
...
ifeq ($(uname_R),5.9)
so it at least tries to work ;) Oh and that 5.9 is apparently kernel
version, not OS version. Sorry for the confusion.
--
http://onion.dynserv.net/~timo/
^ permalink raw reply
* Re: [PATCH 1/3] configure: Add test for Perl
From: Junio C Hamano @ 2006-07-07 11:20 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
In-Reply-To: <20060707110655.GR29115@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
>> "which" isn't portable. On SunOS 5.9 "which foo" prints error message to
>> stdout and returns 0.
>
> Wait, Git runs on SunOS 5.9?
I thought so. In any case, the traditionalist way is to split $PATH
by hand with "IFS=:" -- somebody already posted that on this
thread.
^ permalink raw reply
* Re: [PATCH] Do not drop data from '\0' until eol in patch output
From: sf @ 2006-07-07 11:18 UTC (permalink / raw)
To: git
In-Reply-To: <7vslld1ycq.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> 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?
>
GNU patch can apply patches with binary content which are typically
produced with GNU diff with --text option.
^ permalink raw reply
* Re: [PATCH] diff.c: respect diff.renames config option
From: Junio C Hamano @ 2006-07-07 11:18 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <20060707110123.GA23400@soma>
Eric Wong <normalperson@yhbt.net> writes:
> Nevertheless, it's still opt -in via repo-config, and most people will
> find renames useful unless they need to export to non-git
> systems.
I am more worried about somebody who opts-in finds breakage of
commands that happen to internally use low-level diff machinery
and expect the diff machinery does not automagically do funny
rename detection without being told.
For example, revision walking with path pruning uses diff
machinery without renames. I do not know what happens if I
override it with diff.renames to allow rename detection but I
fear something might horribly break.
That is why I said I do not want this at _that_ low level. I do
not have objections to have the configuration at a layer closer
to the UI, e.g. things in builtin-log.c and builtin-diff.c.
^ permalink raw reply
* Re: [PATCH 1/3] configure: Add test for Perl
From: Petr Baudis @ 2006-07-07 11:06 UTC (permalink / raw)
To: Timo Hirvonen; +Cc: Dennis Stosberg, git
In-Reply-To: <20060706161011.ccc2ea1c.tihirvon@gmail.com>
Dear diary, on Thu, Jul 06, 2006 at 03:10:11PM CEST, I got a letter
where Timo Hirvonen <tihirvon@gmail.com> said that...
> Dennis Stosberg <dennis@stosberg.net> wrote:
>
> > + echocheck "for perl"
> > + if test -z "$_perl" ; then
> > + _perl=`which perl`
> > + test "$_perl" || die "cannot find path to perl"
> > + fi
> > + echores "$_perl"
>
> "which" isn't portable. On SunOS 5.9 "which foo" prints error message to
> stdout and returns 0.
Wait, Git runs on SunOS 5.9?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
^ permalink raw reply
* 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
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