From: Junio C Hamano Date: Wed, 28 Feb 2007 22:18:57 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.1-rc1~115 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1db8b60b2a6ef0cc0f7cc7d0783b7cda2ce894ca?ds=inline;hp=-c Merge branch 'maint' * maint: Start preparing Release Notes for 1.5.0.3 Documentation: git-remote add [-t ] [-m ] [-f] name url Include config.mak in doc/Makefile git.el: Set the default commit coding system from the repository config. git-archimport: support empty summaries, put summary on a single line. http-push.c::lock_remote(): validate all remote refs. git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs. --- 1db8b60b2a6ef0cc0f7cc7d0783b7cda2ce894ca diff --combined Documentation/git-remote.txt index 266faade31,f96b30429c..a9fb6a9a5e --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@@ -10,10 -10,9 +10,10 @@@ SYNOPSI -------- [verse] 'git-remote' - 'git-remote' add + 'git-remote' add [-t ] [-m ] [-f] 'git-remote' show 'git-remote' prune +'git-remote' update [group] DESCRIPTION ----------- @@@ -54,17 -53,7 +54,17 @@@ Gives some information about the remot Deletes all stale tracking branches under . These stale branches have already been removed from the remote repository -referenced by , but are still locally available in "remotes/". +referenced by , but are still locally available in +"remotes/". + +'update':: + +Fetch updates for a named set of remotes in the repository as defined by +remotes.. If a named group is not specified on the command line, +the configuration parameter remotes.default will get used; if +remotes.default is not defined, all remotes which do not the +configuration parameter remote..skipDefaultUpdate set to true will +be updated. (See gitlink:git-config[1]). DISCUSSION @@@ -77,8 -66,8 +77,8 @@@ gitlink:git-config[1]) Examples -------- - Add a new remote, fetch, and check out a branch from it: - + * Add a new remote, fetch, and check out a branch from it + + ------------ $ git remote origin @@@ -98,6 -87,17 +98,17 @@@ $ git checkout -b nfs linux-nfs/maste ... ------------ + * Imitate 'git clone' but track only selected branches + + + ------------ + $ mkdir project.git + $ cd project.git + $ git init + $ git remote add -f -t master -m master origin git://example.com/git.git/ + $ git merge origin + ------------ + + See Also -------- gitlink:git-fetch[1] diff --combined git-cvsexportcommit.perl index d08216cfd7,32a4883321..67224b4449 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@@ -15,21 -15,14 +15,21 @@@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DI die "GIT_DIR is not defined or is unreadable"; } -our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m ); +our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d); -getopts('hPpvcfam:'); +getopts('hPpvcfam:d:'); $opt_h && usage(); die "Need at least one commit identifier!" unless @ARGV; +my @cvs; +if ($opt_d) { + @cvs = ('cvs', '-d', $opt_d); +} else { + @cvs = ('cvs'); +} + # setup a tempdir our ($tmpdir, $tmpdirname) = tempdir('git-cvsapplycommit-XXXXXX', TMPDIR => 1, @@@ -167,7 -160,7 +167,7 @@@ foreach my $f (@afiles) my $p = $1; next if (grep { $_ eq $p } @dirs); } - my @status = grep(m/^File/, safe_pipe_capture('cvs', '-q', 'status' ,$f)); + my @status = grep(m/^File/, safe_pipe_capture(@cvs, '-q', 'status' ,$f)); if (@status > 1) { warn 'Strange! cvs status returned more than one line?'}; if (-d dirname $f and $status[0] !~ m/Status: Unknown$/ and $status[0] !~ m/^File: no file /) { @@@ -180,7 -173,7 +180,7 @@@ foreach my $f (@files) { next if grep { $_ eq $f } @afiles; # TODO:we need to handle removed in cvs - my @status = grep(m/^File/, safe_pipe_capture('cvs', '-q', 'status' ,$f)); + my @status = grep(m/^File/, safe_pipe_capture(@cvs, '-q', 'status' ,$f)); if (@status > 1) { warn 'Strange! cvs status returned more than one line?'}; unless ($status[0] =~ m/Status: Up-to-date$/) { $dirty = 1; @@@ -201,7 -194,7 +201,7 @@@ print "Applying\n" print "Patch applied successfully. Adding new files and directories to CVS\n"; my $dirtypatch = 0; foreach my $d (@dirs) { - if (system('cvs','add',$d)) { + if (system(@cvs,'add',$d)) { $dirtypatch = 1; warn "Failed to cvs add directory $d -- you may need to do it manually"; } @@@ -209,9 -202,9 +209,9 @@@ foreach my $f (@afiles) { if (grep { $_ eq $f } @bfiles) { - system('cvs', 'add','-kb',$f); + system(@cvs, 'add','-kb',$f); } else { - system('cvs', 'add', $f); + system(@cvs, 'add', $f); } if ($?) { $dirtypatch = 1; @@@ -220,7 -213,7 +220,7 @@@ } foreach my $f (@dfiles) { - system('cvs', 'rm', '-f', $f); + system(@cvs, 'rm', '-f', $f); if ($?) { $dirtypatch = 1; warn "Failed to cvs rm -f $f -- you may need to do it manually"; @@@ -230,7 -223,7 +230,7 @@@ print "Commit to CVS\n"; print "Patch title (first comment line): $title\n"; my @commitfiles = map { unless (m/\s/) { '\''.$_.'\''; } else { $_; }; } (@files); -my $cmd = "cvs commit -F .msg @commitfiles"; +my $cmd = join(' ', @cvs)." commit -F .msg @commitfiles"; if ($dirtypatch) { print "NOTE: One or more hunks failed to apply cleanly.\n"; @@@ -243,18 -236,19 +243,19 @@@ if ($opt_c) { print "Autocommit\n $cmd\n"; - print safe_pipe_capture('cvs', 'commit', '-F', '.msg', @files); + print safe_pipe_capture(@cvs, 'commit', '-F', '.msg', @files); if ($?) { die "Exiting: The commit did not succeed"; } print "Committed successfully to CVS\n"; + # clean up + unlink(".msg"); } else { print "Ready for you to commit, just run:\n\n $cmd\n"; } # clean up unlink(".cvsexportcommit.diff"); - unlink(".msg"); sub usage { print STDERR <obj->sha1); struct active_request_slot *slot; char *posn; - char type[20]; + enum object_type type; char hdr[50]; void *unpacked; unsigned long len; @@@ -487,8 -487,8 +487,8 @@@ ssize_t size; z_stream stream; - unpacked = read_sha1_file(request->obj->sha1, type, &len); - hdrlen = sprintf(hdr, "%s %lu", type, len) + 1; + unpacked = read_sha1_file(request->obj->sha1, &type, &len); + hdrlen = sprintf(hdr, "%s %lu", typename(type), len) + 1; /* Set it up */ memset(&stream, 0, sizeof(stream)); @@@ -1060,8 -1060,8 +1060,8 @@@ static int fetch_indices(void case 'P': i++; if (i + 52 < buffer.posn && - !strncmp(data + i, " pack-", 6) && - !strncmp(data + i + 46, ".pack\n", 6)) { + !prefixcmp(data + i, " pack-") && + !prefixcmp(data + i + 46, ".pack\n")) { get_sha1_hex(data + i + 6, sha1); setup_index(sha1); i += 51; @@@ -1206,11 -1206,11 +1206,11 @@@ static void handle_new_lock_ctx(struct lock->owner = xmalloc(strlen(ctx->cdata) + 1); strcpy(lock->owner, ctx->cdata); } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TIMEOUT)) { - if (!strncmp(ctx->cdata, "Second-", 7)) + if (!prefixcmp(ctx->cdata, "Second-")) lock->timeout = strtol(ctx->cdata + 7, NULL, 10); } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) { - if (!strncmp(ctx->cdata, "opaquelocktoken:", 16)) { + if (!prefixcmp(ctx->cdata, "opaquelocktoken:")) { lock->token = xmalloc(strlen(ctx->cdata) - 15); strcpy(lock->token, ctx->cdata + 16); } @@@ -1295,7 -1295,7 +1295,7 @@@ static struct remote_lock *lock_remote( sprintf(url, "%s%s", remote->url, path); /* Make sure leading directories exist for the remote ref */ - ep = strchr(url + strlen(remote->url) + 11, '/'); + ep = strchr(url + strlen(remote->url) + 1, '/'); while (ep) { *ep = 0; slot = get_active_slot(); @@@ -2168,7 -2168,7 +2168,7 @@@ static void fetch_symref(const char *pa return; /* If it's a symref, set the refname; otherwise try for a sha1 */ - if (!strncmp((char *)buffer.buffer, "ref: ", 5)) { + if (!prefixcmp((char *)buffer.buffer, "ref: ")) { *symref = xmalloc(buffer.posn - 5); strlcpy(*symref, (char *)buffer.buffer + 5, buffer.posn - 5); } else {