diff options
-rw-r--r-- | Documentation/Makefile | 7 | ||||
-rwxr-xr-x | Documentation/cmd-list.perl | 14 | ||||
-rw-r--r-- | Documentation/git-cvsimport.txt | 72 | ||||
-rw-r--r-- | Documentation/user-manual.txt | 8 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | builtin-branch.c | 6 | ||||
-rwxr-xr-x | git-cvsimport.perl | 15 | ||||
-rwxr-xr-x | git-send-email.perl | 2 | ||||
-rw-r--r-- | refs.c | 10 | ||||
-rwxr-xr-x | t/t3200-branch.sh | 8 | ||||
-rwxr-xr-x | t/t5300-pack-object.sh | 11 |
11 files changed, 87 insertions, 67 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile index e82596dcd..a637d8d55 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -90,14 +90,17 @@ cmds_txt = cmds-ancillaryinterrogators.txt \ cmds-purehelpers.txt \ cmds-foreignscminterface.txt -$(cmds_txt): cmd-list.perl $(MAN1_TXT) +$(cmds_txt): cmd-list.made + +cmd-list.made: cmd-list.perl $(MAN1_TXT) perl ./cmd-list.perl + date >$@ git.7 git.html: git.txt core-intro.txt clean: rm -f *.xml *.xml+ *.html *.html+ *.1 *.7 howto-index.txt howto/*.html doc.dep - rm -f $(cmds_txt) + rm -f $(cmds_txt) *.made %.html : %.txt rm -f $@+ $@ diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl index b54382b2b..0381590d3 100755 --- a/Documentation/cmd-list.perl +++ b/Documentation/cmd-list.perl @@ -1,8 +1,11 @@ -# +#!/usr/bin/perl -w + +use File::Compare qw(compare); sub format_one { my ($out, $name) = @_; my ($state, $description); + $state = 0; open I, '<', "$name.txt" or die "No such file $name.txt"; while (<I>) { if (/^NAME$/) { @@ -55,7 +58,14 @@ for my $cat (qw(ancillaryinterrogators format_one(\*O, $_); } close O; - rename "$out+", "$out"; + + if (-f "$out" && compare("$out", "$out+") == 0) { + unlink "$out+"; + } + else { + print STDERR "$out\n"; + rename "$out+", "$out"; + } } __DATA__ diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index 0d59c0613..e0be85654 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -9,9 +9,11 @@ git-cvsimport - Salvage your data out of another SCM people love to hate SYNOPSIS -------- [verse] -'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>] - [-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>] - [-m] [-M regex] [<CVS_module>] +'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] + [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>] + [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>] + [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>] + [<CVS_module>] DESCRIPTION @@ -30,35 +32,48 @@ any CVS branches, yourself. OPTIONS ------- +-v:: + Verbosity: let 'cvsimport' report what it is doing. + -d <CVSROOT>:: The root of the CVS archive. May be local (a simple path) or remote; currently, only the :local:, :ext: and :pserver: access methods - are supported. + are supported. If not given, git-cvsimport will try to read it + from `CVS/Root`. If no such file exists, it checks for the + `CVSROOT` environment variable. + +<CVS_module>:: + The CVS module you want to import. Relative to <CVSROOT>. + If not given, git-cvsimport tries to read it from + `CVS/Repository`. -C <target-dir>:: The git repository to import to. If the directory doesn't exist, it will be created. Default is the current directory. +-o <branch-for-HEAD>:: + The 'HEAD' branch from CVS is imported to the 'origin' branch within + the git repository, as 'HEAD' already has a special meaning for git. + Use this option if you want to import into a different branch. ++ +Use '-o master' for continuing an import that was initially done by +the old cvs2git tool. + -i:: Import-only: don't perform a checkout after importing. This option ensures the working directory and index remain untouched and will not create them if they do not exist. -k:: - Kill keywords: will extract files with -kk from the CVS archive + Kill keywords: will extract files with '-kk' from the CVS archive to avoid noisy changesets. Highly recommended, but off by default to preserve compatibility with early imported trees. -u:: Convert underscores in tag and branch names to dots. --o <branch-for-HEAD>:: - The 'HEAD' branch from CVS is imported to the 'origin' branch within - the git repository, as 'HEAD' already has a special meaning for git. - Use this option if you want to import into a different branch. -+ -Use '-o master' for continuing an import that was initially done by -the old cvs2git tool. +-s <subst>:: + Substitute the character "/" in branch names with <subst> -p <options-for-cvsps>:: Additional options for cvsps. @@ -66,6 +81,10 @@ the old cvs2git tool. + If you need to pass multiple options, separate them with a comma. +-z <fuzz>:: + Pass the timestamp fuzz factor to cvsps, in seconds. If unset, + cvsps defaults to 300s. + -P <cvsps-output-file>:: Instead of calling cvsps, read the provided cvsps output file. Useful for debugging or when cvsps is being handled outside cvsimport. @@ -77,32 +96,16 @@ If you need to pass multiple options, separate them with a comma. -M <regex>:: Attempt to detect merges based on the commit message with a custom - regex. It can be used with -m to also see the default regexes. + regex. It can be used with '-m' to also see the default regexes. You must escape forward slashes. --v:: - Verbosity: let 'cvsimport' report what it is doing. - -<CVS_module>:: - The CVS module you want to import. Relative to <CVSROOT>. - --h:: - Print a short usage message and exit. - --z <fuzz>:: - Pass the timestamp fuzz factor to cvsps, in seconds. If unset, - cvsps defaults to 300s. - --s <subst>:: - Substitute the character "/" in branch names with <subst> +-S <regex>:: + Skip paths matching the regex. -a:: Import all commits, including recent ones. cvsimport by default skips commits that have a timestamp less than 10 minutes ago. --S <regex>:: - Skip paths matching the regex. - -L <limit>:: Limit the number of commits imported. Workaround for cases where cvsimport leaks memory. @@ -122,14 +125,17 @@ git-cvsimport will make it appear as those authors had their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly all along. + -For convenience, this data is saved to $GIT_DIR/cvs-authors -each time the -A option is provided and read from that same +For convenience, this data is saved to `$GIT_DIR/cvs-authors` +each time the '-A' option is provided and read from that same file each time git-cvsimport is run. + It is not recommended to use this feature if you intend to export changes back to CVS again later with gitlink:git-cvsexportcommit[1]. +-h:: + Print a short usage message and exit. + OUTPUT ------ If '-v' is specified, the script reports what it is doing. diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 574e9c0e5..d43d2377e 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1015,7 +1015,7 @@ $ git commit ------------------------------------------------- [[how-to-make-a-commit]] -how to make a commit +How to make a commit -------------------- Creating a new commit takes three steps: @@ -1109,7 +1109,7 @@ $ git diff # difference between the index file and your $ git status # a brief per-file summary of the above. ------------------------------------------------- -creating good commit messages +Creating good commit messages ----------------------------- Though not required, it's a good idea to begin the commit message @@ -1119,7 +1119,7 @@ description. Tools that turn commits into email, for example, use the first line on the Subject line and the rest of the commit in the body. -how to merge +How to merge ------------ You can rejoin two diverging branches of development using @@ -1298,7 +1298,7 @@ the different stages of that file will be "collapsed", after which git-diff will (by default) no longer show diffs for that file. [[undoing-a-merge]] -undoing a merge +Undoing a merge --------------- If you get stuck and decide to just give up and throw the whole mess @@ -385,6 +385,7 @@ endif ifeq ($(uname_S),Darwin) NEEDS_SSL_WITH_CRYPTO = YesPlease NEEDS_LIBICONV = YesPlease + OLD_ICONV = UnfortunatelyYes NO_STRLCPY = YesPlease endif ifeq ($(uname_S),SunOS) diff --git a/builtin-branch.c b/builtin-branch.c index a4494ee33..740828505 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -493,6 +493,7 @@ static void rename_branch(const char *oldname, const char *newname, int force) { char oldref[PATH_MAX], newref[PATH_MAX], logmsg[PATH_MAX*2 + 100]; unsigned char sha1[20]; + char oldsection[PATH_MAX], newsection[PATH_MAX]; if (!oldname) die("cannot rename the current branch while not on any."); @@ -521,6 +522,11 @@ static void rename_branch(const char *oldname, const char *newname, int force) /* no need to pass logmsg here as HEAD didn't really move */ if (!strcmp(oldname, head) && create_symref("HEAD", newref, NULL)) die("Branch renamed to %s, but HEAD is not updated!", newname); + + snprintf(oldsection, sizeof(oldsection), "branch.%s", oldref + 11); + snprintf(newsection, sizeof(newsection), "branch.%s", newref + 11); + if (git_config_rename_section(oldsection, newsection) < 0) + die("Branch is renamed, but update of config-file failed"); } int cmd_branch(int argc, const char **argv, const char *prefix) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 1a1ba7b1a..ac74bc51b 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -32,12 +32,15 @@ $ENV{'TZ'}="UTC"; our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S,$opt_L, $opt_a); my (%conv_author_name, %conv_author_email); -sub usage() { +sub usage(;$) { + my $msg = shift; + print(STDERR "Error: $msg\n") if $msg; print STDERR <<END; Usage: ${\basename $0} # fetch/update GIT from CVS [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file] - [-p opts-for-cvsps] [-C GIT_repository] [-z fuzz] [-i] [-k] [-u] - [-s subst] [-a] [-m] [-M regex] [-S regex] [CVS_module] + [-p opts-for-cvsps] [-P file] [-C GIT_repository] [-z fuzz] [-i] [-k] + [-u] [-s subst] [-a] [-m] [-M regex] [-S regex] [-L commitlimit] + [CVS_module] END exit(1); } @@ -116,7 +119,7 @@ read_repo_config($opts); getopts($opts) or usage(); usage if $opt_h; -@ARGV <= 1 or usage(); +@ARGV <= 1 or usage("You can't specify more than one CVS module"); if ($opt_d) { $ENV{"CVSROOT"} = $opt_d; @@ -129,7 +132,7 @@ if ($opt_d) { } elsif ($ENV{"CVSROOT"}) { $opt_d = $ENV{"CVSROOT"}; } else { - die "CVSROOT needs to be set"; + usage("CVSROOT needs to be set"); } $opt_o ||= "origin"; $opt_s ||= "-"; @@ -148,7 +151,7 @@ if ($#ARGV == 0) { chomp $cvs_tree; close $f; } else { - usage(); + usage("CVS module has to be specified"); } our @mergerx = (); diff --git a/git-send-email.perl b/git-send-email.perl index ae50990d0..1278fcba4 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -595,7 +595,7 @@ foreach my $t (@files) { if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) { $reply_to = $message_id; if (length $references > 0) { - $references .= " $message_id"; + $references .= "\n $message_id"; } else { $references = "$message_id"; } @@ -828,16 +828,6 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg) goto rollback; } - if (!prefixcmp(oldref, "refs/heads/") && - !prefixcmp(newref, "refs/heads/")) { - char oldsection[1024], newsection[1024]; - - snprintf(oldsection, 1024, "branch.%s", oldref + 11); - snprintf(newsection, 1024, "branch.%s", newref + 11); - if (git_config_rename_section(oldsection, newsection) < 0) - return 1; - } - return 0; rollback: diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index ce2c5f41f..828d553a4 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -11,7 +11,7 @@ handled. Specifically, that a bogus branch is not created. . ./test-lib.sh test_expect_success \ - 'prepare an trivial repository' \ + 'prepare a trivial repository' \ 'echo Hello > A && git-update-index --add A && git-commit -m "Initial commit." && @@ -85,9 +85,9 @@ test_expect_failure \ mv .git/config .git/config-saved -test_expect_success 'git branch -m q Q without config should succeed' ' - git-branch -m q Q && - git-branch -m Q q +test_expect_success 'git branch -m q q2 without config should succeed' ' + git-branch -m q q2 && + git-branch -m q2 q ' mv .git/config-saved .git/config diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 35e036a86..083095f7f 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -123,11 +123,12 @@ test_expect_success \ done' cd "$TRASH" -test_expect_success \ - 'compare delta flavors' \ - 'size_2=`stat -c "%s" test-2-${packname_2}.pack` && - size_3=`stat -c "%s" test-3-${packname_3}.pack` && - test $size_2 -gt $size_3' +test_expect_success 'compare delta flavors' ' + perl -e '\'' + defined($_ = -s $_) or die for @ARGV; + exit 1 if $ARGV[0] <= $ARGV[1]; + '\'' test-2-$packname_2.pack test-3-$packname_3.pack +' rm -fr .git2 mkdir .git2 |