Browse Source

Merge branch 'pe/date' into next

* pe/date:
  date.c: improve guess between timezone offset and year.
  git-rm: honor -n flag.
  git-clone: fix duplicated "master" in $GIT_DIR/remotes/origin
  check for error return from fork()
  Document git-clone --use-separate-remote
maint
Junio C Hamano 19 years ago
parent
commit
55becd7b5f
  1. 11
      Documentation/git-clone.txt
  2. 17
      builtin-rm.c
  3. 2
      connect.c
  4. 2
      date.c
  5. 15
      git-clone.sh
  6. 6
      imap-send.c
  7. 6
      rsh.c

11
Documentation/git-clone.txt

@ -11,7 +11,7 @@ SYNOPSIS @@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
<repository> [<directory>]
[--use-separate-remote] <repository> [<directory>]

DESCRIPTION
-----------
@ -73,7 +73,7 @@ OPTIONS @@ -73,7 +73,7 @@ OPTIONS
files in `<directory>/.git`, make the `<directory>`
itself the `$GIT_DIR`. This implies `-n` option. When
this option is used, neither the `origin` branch nor the
default `remotes/origin` file is created.
default `remotes/origin` file is created.

-o <name>::
Instead of using the branch name 'origin' to keep track
@ -94,12 +94,17 @@ OPTIONS @@ -94,12 +94,17 @@ OPTIONS
if unset the templates are taken from the installation
defined default, typically `/usr/share/git-core/templates`.

--use-separate-remote::
Save remotes heads under `$GIT_DIR/remotes/origin/' instead
of `$GIT_DIR/refs/heads/'. Only the master branch is saved
in the latter.

<repository>::
The (possibly remote) repository to clone from. It can
be any URL git-fetch supports.

<directory>::
The name of a new directory to clone into. The "humanish"
The name of a new directory to clone into. The "humanish"
part of the source repository is used if no directory is
explicitly given ("repo" for "/path/to/repo.git" and "foo"
for "host.xz:foo/.git"). Cloning into an existing directory

17
builtin-rm.c

@ -83,15 +83,15 @@ int cmd_rm(int argc, const char **argv, char **envp) @@ -83,15 +83,15 @@ int cmd_rm(int argc, const char **argv, char **envp)
}
die(builtin_rm_usage);
}
pathspec = get_pathspec(prefix, argv + i);
if (argc <= i)
usage(builtin_rm_usage);

pathspec = get_pathspec(prefix, argv + i);
seen = NULL;
if (pathspec) {
for (i = 0; pathspec[i] ; i++)
/* nothing */;
seen = xmalloc(i);
memset(seen, 0, i);
}
for (i = 0; pathspec[i] ; i++)
/* nothing */;
seen = xmalloc(i);
memset(seen, 0, i);

for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
@ -121,6 +121,9 @@ int cmd_rm(int argc, const char **argv, char **envp) @@ -121,6 +121,9 @@ int cmd_rm(int argc, const char **argv, char **envp)
cache_tree_invalidate_path(active_cache_tree, path);
}

if (show_only)
return 0;

/*
* Then, if we used "-f", remove the filenames from the
* workspace. If we fail to remove the first one, we

2
connect.c

@ -657,6 +657,8 @@ int git_connect(int fd[2], char *url, const char *prog) @@ -657,6 +657,8 @@ int git_connect(int fd[2], char *url, const char *prog)
if (pipe(pipefd[0]) < 0 || pipe(pipefd[1]) < 0)
die("unable to create pipe pair for communication");
pid = fork();
if (pid < 0)
die("unable to fork");
if (!pid) {
snprintf(command, sizeof(command), "%s %s", prog,
sq_quote(path));

2
date.c

@ -369,7 +369,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt @@ -369,7 +369,7 @@ static int match_digit(const char *date, struct tm *tm, int *offset, int *tm_gmt

/* Four-digit year or a timezone? */
if (n == 4) {
if (num <= 1200 && *offset == -1) {
if (num <= 1400 && *offset == -1) {
unsigned int minutes = num % 100;
unsigned int hours = num / 100;
*offset = hours*60 + minutes;

15
git-clone.sh

@ -391,11 +391,16 @@ Pull: refs/heads/$head_points_at:$origin_track" && @@ -391,11 +391,16 @@ Pull: refs/heads/$head_points_at:$origin_track" &&
(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
while read dotslref
do
name=`expr "$dotslref" : './\(.*\)'` &&
test "$use_separate_remote" = '' && {
test "$head_points_at" = "$name" ||
test "$origin" = "$name"
} ||
name=`expr "$dotslref" : './\(.*\)'`
if test "z$head_points_at" = "z$name"
then
continue
fi
if test "$use_separate_remote" = '' &&
test "z$origin" = "z$name"
then
continue
fi
echo "Pull: refs/heads/${name}:$remote_top/${name}"
done >>"$GIT_DIR/remotes/$origin" &&
case "$use_separate_remote" in

6
imap-send.c

@ -924,6 +924,7 @@ imap_open_store( imap_server_conf_t *srvc ) @@ -924,6 +924,7 @@ imap_open_store( imap_server_conf_t *srvc )
struct hostent *he;
struct sockaddr_in addr;
int s, a[2], preauth;
pid_t pid;

ctx = xcalloc( sizeof(*ctx), 1 );

@ -941,7 +942,10 @@ imap_open_store( imap_server_conf_t *srvc ) @@ -941,7 +942,10 @@ imap_open_store( imap_server_conf_t *srvc )
exit( 1 );
}

if (fork() == 0) {
pid = fork();
if (pid < 0)
_exit( 127 );
if (!pid) {
if (dup2( a[0], 0 ) == -1 || dup2( a[0], 1 ) == -1)
_exit( 127 );
close( a[0] );

6
rsh.c

@ -48,6 +48,7 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog, @@ -48,6 +48,7 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,
int sizen;
int of;
int i;
pid_t pid;

if (!strcmp(url, "-")) {
*fd_in = 0;
@ -91,7 +92,10 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog, @@ -91,7 +92,10 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv))
return error("Couldn't create socket");

if (!fork()) {
pid = fork();
if (pid < 0)
return error("Couldn't fork");
if (!pid) {
const char *ssh, *ssh_basename;
ssh = getenv("GIT_SSH");
if (!ssh) ssh = "ssh";

Loading…
Cancel
Save