diff --git a/Documentation/Makefile b/Documentation/Makefile index e82596dcdf..a637d8d559 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 b54382b2bf..0381590d38 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 () { if (/^NAME$/) { @@ -55,7 +58,14 @@ sub format_one { 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 0d59c06139..e0be856546 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 ] [-h] [-v] [-d ] [-s ] - [-p ] [-C ] [-i] [-P ] - [-m] [-M regex] [] +'git-cvsimport' [-o ] [-h] [-v] [-d ] + [-A ] [-p ] [-P ] + [-C ] [-z ] [-i] [-k] [-u] [-s ] + [-a] [-m] [-M ] [-S ] [-L ] + [] DESCRIPTION @@ -30,28 +32,25 @@ any CVS branches, yourself. OPTIONS ------- +-v:: + Verbosity: let 'cvsimport' report what it is doing. + -d :: 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. + +:: + The CVS module you want to import. Relative to . + If not given, git-cvsimport tries to read it from + `CVS/Repository`. -C :: The git repository to import to. If the directory doesn't exist, it will be created. Default is the current directory. --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 - 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 :: The 'HEAD' branch from CVS is imported to the 'origin' branch within the git repository, as 'HEAD' already has a special meaning for git. @@ -60,12 +59,32 @@ OPTIONS 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 + 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. + +-s :: + Substitute the character "/" in branch names with + -p :: Additional options for cvsps. The options '-u' and '-A' are implicit and should not be used here. + If you need to pass multiple options, separate them with a comma. +-z :: + Pass the timestamp fuzz factor to cvsps, in seconds. If unset, + cvsps defaults to 300s. + -P :: 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 :: 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. - -:: - The CVS module you want to import. Relative to . - --h:: - Print a short usage message and exit. - --z :: - Pass the timestamp fuzz factor to cvsps, in seconds. If unset, - cvsps defaults to 300s. - --s :: - Substitute the character "/" in branch names with +-S :: + 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 :: - Skip paths matching the regex. - -L :: 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 574e9c0e50..d43d2377ec 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 diff --git a/Makefile b/Makefile index 45dbcf6edf..ba214589cb 100644 --- a/Makefile +++ b/Makefile @@ -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 a4494ee337..7408285050 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 1a1ba7b1a6..ac74bc51b3 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -32,12 +32,15 @@ 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 < 0) { - $references .= " $message_id"; + $references .= "\n $message_id"; } else { $references = "$message_id"; } diff --git a/refs.c b/refs.c index f471152bfc..d2b7b7fb56 100644 --- a/refs.c +++ b/refs.c @@ -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 ce2c5f41fd..828d553a4b 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 35e036a864..083095f7f3 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