Merge branch 'maint'
* maint: Documentation: tighten dependency for git.{html,txt} Makefile: iconv() on Darwin has the old interface t5300-pack-object.sh: portability issue using /usr/bin/stat t3200-branch.sh: small language nit usermanual.txt: some capitalization nits Make builtin-branch.c handle the git config file rename_ref(): only print a warning when config-file update fails Distinguish branches by more than case in tests. Avoid composing too long "References" header. cvsimport: Improve formating consistency cvsimport: Reorder options in documentation for better understanding cvsimport: Improve usage error reporting cvsimport: Improve documentation of CVSROOT and CVS module determination cvsimport: sync usage lines with existing options Conflicts: Documentation/Makefile
This commit is contained in:
commit
ced38ea252
@ -90,14 +90,17 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
|
|||||||
cmds-purehelpers.txt \
|
cmds-purehelpers.txt \
|
||||||
cmds-foreignscminterface.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
|
perl ./cmd-list.perl
|
||||||
|
date >$@
|
||||||
|
|
||||||
git.7 git.html: git.txt core-intro.txt
|
git.7 git.html: git.txt core-intro.txt
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.xml *.xml+ *.html *.html+ *.1 *.7 howto-index.txt howto/*.html doc.dep
|
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
|
%.html : %.txt
|
||||||
rm -f $@+ $@
|
rm -f $@+ $@
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
#
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
use File::Compare qw(compare);
|
||||||
|
|
||||||
sub format_one {
|
sub format_one {
|
||||||
my ($out, $name) = @_;
|
my ($out, $name) = @_;
|
||||||
my ($state, $description);
|
my ($state, $description);
|
||||||
|
$state = 0;
|
||||||
open I, '<', "$name.txt" or die "No such file $name.txt";
|
open I, '<', "$name.txt" or die "No such file $name.txt";
|
||||||
while (<I>) {
|
while (<I>) {
|
||||||
if (/^NAME$/) {
|
if (/^NAME$/) {
|
||||||
@ -55,8 +58,15 @@ for my $cat (qw(ancillaryinterrogators
|
|||||||
format_one(\*O, $_);
|
format_one(\*O, $_);
|
||||||
}
|
}
|
||||||
close O;
|
close O;
|
||||||
|
|
||||||
|
if (-f "$out" && compare("$out", "$out+") == 0) {
|
||||||
|
unlink "$out+";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print STDERR "$out\n";
|
||||||
rename "$out+", "$out";
|
rename "$out+", "$out";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__DATA__
|
__DATA__
|
||||||
git-add mainporcelain
|
git-add mainporcelain
|
||||||
|
@ -9,9 +9,11 @@ git-cvsimport - Salvage your data out of another SCM people love to hate
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
[verse]
|
[verse]
|
||||||
'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] [-s <subst>]
|
'git-cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
|
||||||
[-p <options-for-cvsps>] [-C <git_repository>] [-i] [-P <file>]
|
[-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
|
||||||
[-m] [-M regex] [<CVS_module>]
|
[-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
|
||||||
|
[-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
|
||||||
|
[<CVS_module>]
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
@ -30,28 +32,25 @@ any CVS branches, yourself.
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
|
-v::
|
||||||
|
Verbosity: let 'cvsimport' report what it is doing.
|
||||||
|
|
||||||
-d <CVSROOT>::
|
-d <CVSROOT>::
|
||||||
The root of the CVS archive. May be local (a simple path) or remote;
|
The root of the CVS archive. May be local (a simple path) or remote;
|
||||||
currently, only the :local:, :ext: and :pserver: access methods
|
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>::
|
-C <target-dir>::
|
||||||
The git repository to import to. If the directory doesn't
|
The git repository to import to. If the directory doesn't
|
||||||
exist, it will be created. Default is the current directory.
|
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 <branch-for-HEAD>::
|
-o <branch-for-HEAD>::
|
||||||
The 'HEAD' branch from CVS is imported to the 'origin' branch within
|
The 'HEAD' branch from CVS is imported to the 'origin' branch within
|
||||||
the git repository, as 'HEAD' already has a special meaning for git.
|
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
|
Use '-o master' for continuing an import that was initially done by
|
||||||
the old cvs2git tool.
|
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 <subst>::
|
||||||
|
Substitute the character "/" in branch names with <subst>
|
||||||
|
|
||||||
-p <options-for-cvsps>::
|
-p <options-for-cvsps>::
|
||||||
Additional options for cvsps.
|
Additional options for cvsps.
|
||||||
The options '-u' and '-A' are implicit and should not be used here.
|
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.
|
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>::
|
-P <cvsps-output-file>::
|
||||||
Instead of calling cvsps, read the provided cvsps output file. Useful
|
Instead of calling cvsps, read the provided cvsps output file. Useful
|
||||||
for debugging or when cvsps is being handled outside cvsimport.
|
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>::
|
-M <regex>::
|
||||||
Attempt to detect merges based on the commit message with a custom
|
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.
|
You must escape forward slashes.
|
||||||
|
|
||||||
-v::
|
-S <regex>::
|
||||||
Verbosity: let 'cvsimport' report what it is doing.
|
Skip paths matching the regex.
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
-a::
|
-a::
|
||||||
Import all commits, including recent ones. cvsimport by default
|
Import all commits, including recent ones. cvsimport by default
|
||||||
skips commits that have a timestamp less than 10 minutes ago.
|
skips commits that have a timestamp less than 10 minutes ago.
|
||||||
|
|
||||||
-S <regex>::
|
|
||||||
Skip paths matching the regex.
|
|
||||||
|
|
||||||
-L <limit>::
|
-L <limit>::
|
||||||
Limit the number of commits imported. Workaround for cases where
|
Limit the number of commits imported. Workaround for cases where
|
||||||
cvsimport leaks memory.
|
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
|
their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
|
||||||
all along.
|
all along.
|
||||||
+
|
+
|
||||||
For convenience, this data is saved to $GIT_DIR/cvs-authors
|
For convenience, this data is saved to `$GIT_DIR/cvs-authors`
|
||||||
each time the -A option is provided and read from that same
|
each time the '-A' option is provided and read from that same
|
||||||
file each time git-cvsimport is run.
|
file each time git-cvsimport is run.
|
||||||
+
|
+
|
||||||
It is not recommended to use this feature if you intend to
|
It is not recommended to use this feature if you intend to
|
||||||
export changes back to CVS again later with
|
export changes back to CVS again later with
|
||||||
gitlink:git-cvsexportcommit[1].
|
gitlink:git-cvsexportcommit[1].
|
||||||
|
|
||||||
|
-h::
|
||||||
|
Print a short usage message and exit.
|
||||||
|
|
||||||
OUTPUT
|
OUTPUT
|
||||||
------
|
------
|
||||||
If '-v' is specified, the script reports what it is doing.
|
If '-v' is specified, the script reports what it is doing.
|
||||||
|
@ -1015,7 +1015,7 @@ $ git commit
|
|||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
[[how-to-make-a-commit]]
|
[[how-to-make-a-commit]]
|
||||||
how to make a commit
|
How to make a commit
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Creating a new commit takes three steps:
|
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.
|
$ 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
|
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
|
the first line on the Subject line and the rest of the commit in the
|
||||||
body.
|
body.
|
||||||
|
|
||||||
how to merge
|
How to merge
|
||||||
------------
|
------------
|
||||||
|
|
||||||
You can rejoin two diverging branches of development using
|
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.
|
git-diff will (by default) no longer show diffs for that file.
|
||||||
|
|
||||||
[[undoing-a-merge]]
|
[[undoing-a-merge]]
|
||||||
undoing a merge
|
Undoing a merge
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
If you get stuck and decide to just give up and throw the whole mess
|
If you get stuck and decide to just give up and throw the whole mess
|
||||||
|
1
Makefile
1
Makefile
@ -385,6 +385,7 @@ endif
|
|||||||
ifeq ($(uname_S),Darwin)
|
ifeq ($(uname_S),Darwin)
|
||||||
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
NEEDS_SSL_WITH_CRYPTO = YesPlease
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
|
OLD_ICONV = UnfortunatelyYes
|
||||||
NO_STRLCPY = YesPlease
|
NO_STRLCPY = YesPlease
|
||||||
endif
|
endif
|
||||||
ifeq ($(uname_S),SunOS)
|
ifeq ($(uname_S),SunOS)
|
||||||
|
@ -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];
|
char oldref[PATH_MAX], newref[PATH_MAX], logmsg[PATH_MAX*2 + 100];
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
|
char oldsection[PATH_MAX], newsection[PATH_MAX];
|
||||||
|
|
||||||
if (!oldname)
|
if (!oldname)
|
||||||
die("cannot rename the current branch while not on any.");
|
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 */
|
/* no need to pass logmsg here as HEAD didn't really move */
|
||||||
if (!strcmp(oldname, head) && create_symref("HEAD", newref, NULL))
|
if (!strcmp(oldname, head) && create_symref("HEAD", newref, NULL))
|
||||||
die("Branch renamed to %s, but HEAD is not updated!", newname);
|
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)
|
int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||||
|
@ -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);
|
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);
|
my (%conv_author_name, %conv_author_email);
|
||||||
|
|
||||||
sub usage() {
|
sub usage(;$) {
|
||||||
|
my $msg = shift;
|
||||||
|
print(STDERR "Error: $msg\n") if $msg;
|
||||||
print STDERR <<END;
|
print STDERR <<END;
|
||||||
Usage: ${\basename $0} # fetch/update GIT from CVS
|
Usage: ${\basename $0} # fetch/update GIT from CVS
|
||||||
[-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
|
[-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
|
||||||
[-p opts-for-cvsps] [-C GIT_repository] [-z fuzz] [-i] [-k] [-u]
|
[-p opts-for-cvsps] [-P file] [-C GIT_repository] [-z fuzz] [-i] [-k]
|
||||||
[-s subst] [-a] [-m] [-M regex] [-S regex] [CVS_module]
|
[-u] [-s subst] [-a] [-m] [-M regex] [-S regex] [-L commitlimit]
|
||||||
|
[CVS_module]
|
||||||
END
|
END
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -116,7 +119,7 @@ read_repo_config($opts);
|
|||||||
getopts($opts) or usage();
|
getopts($opts) or usage();
|
||||||
usage if $opt_h;
|
usage if $opt_h;
|
||||||
|
|
||||||
@ARGV <= 1 or usage();
|
@ARGV <= 1 or usage("You can't specify more than one CVS module");
|
||||||
|
|
||||||
if ($opt_d) {
|
if ($opt_d) {
|
||||||
$ENV{"CVSROOT"} = $opt_d;
|
$ENV{"CVSROOT"} = $opt_d;
|
||||||
@ -129,7 +132,7 @@ if ($opt_d) {
|
|||||||
} elsif ($ENV{"CVSROOT"}) {
|
} elsif ($ENV{"CVSROOT"}) {
|
||||||
$opt_d = $ENV{"CVSROOT"};
|
$opt_d = $ENV{"CVSROOT"};
|
||||||
} else {
|
} else {
|
||||||
die "CVSROOT needs to be set";
|
usage("CVSROOT needs to be set");
|
||||||
}
|
}
|
||||||
$opt_o ||= "origin";
|
$opt_o ||= "origin";
|
||||||
$opt_s ||= "-";
|
$opt_s ||= "-";
|
||||||
@ -148,7 +151,7 @@ if ($#ARGV == 0) {
|
|||||||
chomp $cvs_tree;
|
chomp $cvs_tree;
|
||||||
close $f;
|
close $f;
|
||||||
} else {
|
} else {
|
||||||
usage();
|
usage("CVS module has to be specified");
|
||||||
}
|
}
|
||||||
|
|
||||||
our @mergerx = ();
|
our @mergerx = ();
|
||||||
|
@ -595,7 +595,7 @@ foreach my $t (@files) {
|
|||||||
if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
|
if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
|
||||||
$reply_to = $message_id;
|
$reply_to = $message_id;
|
||||||
if (length $references > 0) {
|
if (length $references > 0) {
|
||||||
$references .= " $message_id";
|
$references .= "\n $message_id";
|
||||||
} else {
|
} else {
|
||||||
$references = "$message_id";
|
$references = "$message_id";
|
||||||
}
|
}
|
||||||
|
10
refs.c
10
refs.c
@ -828,16 +828,6 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg)
|
|||||||
goto rollback;
|
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;
|
return 0;
|
||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
|
@ -11,7 +11,7 @@ handled. Specifically, that a bogus branch is not created.
|
|||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'prepare an trivial repository' \
|
'prepare a trivial repository' \
|
||||||
'echo Hello > A &&
|
'echo Hello > A &&
|
||||||
git-update-index --add A &&
|
git-update-index --add A &&
|
||||||
git-commit -m "Initial commit." &&
|
git-commit -m "Initial commit." &&
|
||||||
@ -85,9 +85,9 @@ test_expect_failure \
|
|||||||
|
|
||||||
mv .git/config .git/config-saved
|
mv .git/config .git/config-saved
|
||||||
|
|
||||||
test_expect_success 'git branch -m q Q without config should succeed' '
|
test_expect_success 'git branch -m q q2 without config should succeed' '
|
||||||
git-branch -m q Q &&
|
git-branch -m q q2 &&
|
||||||
git-branch -m Q q
|
git-branch -m q2 q
|
||||||
'
|
'
|
||||||
|
|
||||||
mv .git/config-saved .git/config
|
mv .git/config-saved .git/config
|
||||||
|
@ -123,11 +123,12 @@ test_expect_success \
|
|||||||
done'
|
done'
|
||||||
cd "$TRASH"
|
cd "$TRASH"
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'compare delta flavors' '
|
||||||
'compare delta flavors' \
|
perl -e '\''
|
||||||
'size_2=`stat -c "%s" test-2-${packname_2}.pack` &&
|
defined($_ = -s $_) or die for @ARGV;
|
||||||
size_3=`stat -c "%s" test-3-${packname_3}.pack` &&
|
exit 1 if $ARGV[0] <= $ARGV[1];
|
||||||
test $size_2 -gt $size_3'
|
'\'' test-2-$packname_2.pack test-3-$packname_3.pack
|
||||||
|
'
|
||||||
|
|
||||||
rm -fr .git2
|
rm -fr .git2
|
||||||
mkdir .git2
|
mkdir .git2
|
||||||
|
Loading…
Reference in New Issue
Block a user