* Re: [PATCH 1/2] daemon: add tests
From: Clemens Buchacher @ 2012-01-07 11:46 UTC (permalink / raw)
To: Jakub Narebski
Cc: Jeff King, Junio C Hamano, git, Jonathan Nieder, Erik Faye-Lund,
Ilari Liusvaara, Nguyễn Thái Ngọc Duy
In-Reply-To: <201201070035.52581.jnareb@gmail.com>
On Sat, Jan 07, 2012 at 12:35:50AM +0100, Jakub Narebski wrote:
> >
> > We could probably add a "--notify-when-ready" option to git-daemon to
> > do something similar.
>
> What would git-daemon do what it is ready? Write to socket, raise signal,
> print to STDOUT / STDERR?
Please have a look at my "git-daemon: produce output when ready" patch.
After opening the socket, git-daemon --verbose writes "Ready to rumble"
to stderr.
^ permalink raw reply
* [PATCH 3/5] git-daemon: add tests
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1325936567-3136-1-git-send-email-drizzd@aon.at>
The semantics of the git daemon tests are similar to the http transport
tests. In fact, they are only a slightly modified copy of t5550, plus the
newly added remote error tests.
All git-daemon tests will be skipped unless the environment variable
GIT_TEST_GIT_DAEMON is set.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/lib-git-daemon.sh | 53 +++++++++++++++++
t/t5570-git-daemon.sh | 148 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 201 insertions(+), 0 deletions(-)
create mode 100644 t/lib-git-daemon.sh
create mode 100755 t/t5570-git-daemon.sh
diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
new file mode 100644
index 0000000..5e81a25
--- /dev/null
+++ b/t/lib-git-daemon.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+if test -z "$GIT_TEST_GIT_DAEMON"
+then
+ skip_all="git-daemon testing disabled (define GIT_TEST_GIT_DAEMON to enable)"
+ test_done
+fi
+
+LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-'8121'}
+
+GIT_DAEMON_PID=
+GIT_DAEMON_DOCUMENT_ROOT_PATH="$PWD"/repo
+GIT_DAEMON_URL=git://127.0.0.1:$LIB_GIT_DAEMON_PORT
+
+start_git_daemon() {
+ if test -n "$GIT_DAEMON_PID"
+ then
+ error "start_git_daemon already called"
+ fi
+
+ mkdir -p "$GIT_DAEMON_DOCUMENT_ROOT_PATH"
+
+ trap 'code=$?; stop_git_daemon; (exit $code); die' EXIT
+
+ say >&3 "Starting git daemon ..."
+ git daemon --listen=127.0.0.1 --port="$LIB_GIT_DAEMON_PORT" \
+ --reuseaddr --verbose \
+ --base-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
+ "$@" "$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
+ >&3 2>&4 &
+ GIT_DAEMON_PID=$!
+}
+
+stop_git_daemon() {
+ if test -z "$GIT_DAEMON_PID"
+ then
+ return
+ fi
+
+ trap 'die' EXIT
+
+ # kill git-daemon child of git
+ say >&3 "Stopping git daemon ..."
+ kill "$GIT_DAEMON_PID"
+ wait "$GIT_DAEMON_PID" >&3 2>&4
+ ret=$?
+ # expect exit with status 143 = 128+15 for signal TERM=15
+ if test $ret -ne 143
+ then
+ error "git daemon exited with status: $ret"
+ fi
+ GIT_DAEMON_PID=
+}
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
new file mode 100755
index 0000000..7cbc999
--- /dev/null
+++ b/t/t5570-git-daemon.sh
@@ -0,0 +1,148 @@
+#!/bin/sh
+
+test_description='test fetching over git protocol'
+. ./test-lib.sh
+
+LIB_GIT_DAEMON_PORT=${LIB_GIT_DAEMON_PORT-5570}
+. "$TEST_DIRECTORY"/lib-git-daemon.sh
+start_git_daemon
+
+test_expect_success 'setup repository' '
+ echo content >file &&
+ git add file &&
+ git commit -m one
+'
+
+test_expect_success 'create git-accessible bare repository' '
+ mkdir "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
+ (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
+ git --bare init &&
+ : >git-daemon-export-ok
+ ) &&
+ git remote add public "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git" &&
+ git push public master:master
+'
+
+test_expect_success 'clone git repository' '
+ git clone "$GIT_DAEMON_URL/repo.git" clone &&
+ test_cmp file clone/file
+'
+
+test_expect_success 'fetch changes via git protocol' '
+ echo content >>file &&
+ git commit -a -m two &&
+ git push public &&
+ (cd clone && git pull) &&
+ test_cmp file clone/file
+'
+
+test_expect_failure 'remote detects correct HEAD' '
+ git push public master:other &&
+ (cd clone &&
+ git remote set-head -d origin &&
+ git remote set-head -a origin &&
+ git symbolic-ref refs/remotes/origin/HEAD > output &&
+ echo refs/remotes/origin/master > expect &&
+ test_cmp expect output
+ )
+'
+
+test_expect_success 'prepare pack objects' '
+ cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git &&
+ (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git &&
+ git --bare repack -a -d
+ )
+'
+
+test_expect_success 'fetch notices corrupt pack' '
+ cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
+ (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad1.git &&
+ p=`ls objects/pack/pack-*.pack` &&
+ chmod u+w $p &&
+ printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
+ ) &&
+ mkdir repo_bad1.git &&
+ (cd repo_bad1.git &&
+ git --bare init &&
+ test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad1.git" &&
+ test 0 = `ls objects/pack/pack-*.pack | wc -l`
+ )
+'
+
+test_expect_success 'fetch notices corrupt idx' '
+ cp -R "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_pack.git "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
+ (cd "$GIT_DAEMON_DOCUMENT_ROOT_PATH"/repo_bad2.git &&
+ p=`ls objects/pack/pack-*.idx` &&
+ chmod u+w $p &&
+ printf %0256d 0 | dd of=$p bs=256 count=1 seek=1 conv=notrunc
+ ) &&
+ mkdir repo_bad2.git &&
+ (cd repo_bad2.git &&
+ git --bare init &&
+ test_must_fail git --bare fetch "$GIT_DAEMON_URL/repo_bad2.git" &&
+ test 0 = `ls objects/pack | wc -l`
+ )
+'
+
+test_remote_error()
+{
+ do_export=YesPlease
+ while test $# -gt 0
+ do
+ case $1 in
+ -x)
+ shift
+ chmod -x "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git"
+ ;;
+ -n)
+ shift
+ do_export=
+ ;;
+ *)
+ break
+ esac
+ done
+
+ if test $# -ne 3
+ then
+ error "invalid number of arguments"
+ fi
+
+ cmd=$1
+ repo=$2
+ msg=$3
+
+ if test -x "$GIT_DAEMON_DOCUMENT_ROOT_PATH/$repo"
+ then
+ if test -n "$do_export"
+ then
+ : >"$GIT_DAEMON_DOCUMENT_ROOT_PATH/$repo/git-daemon-export-ok"
+ else
+ rm -f "$GIT_DAEMON_DOCUMENT_ROOT_PATH/$repo/git-daemon-export-ok"
+ fi
+ fi
+
+ test_must_fail git "$cmd" "$GIT_DAEMON_URL/$repo" 2>output &&
+ echo "fatal: remote error: $msg: /$repo" >expect &&
+ test_cmp expect output
+ ret=$?
+ chmod +x "$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo.git"
+ (exit $ret)
+}
+
+msg="access denied or repository not exported"
+test_expect_success 'clone non-existent' "test_remote_error clone nowhere.git '$msg'"
+test_expect_success 'push disabled' "test_remote_error push repo.git '$msg'"
+test_expect_success 'read access denied' "test_remote_error -x fetch repo.git '$msg'"
+test_expect_success 'not exported' "test_remote_error -n fetch repo.git '$msg'"
+
+stop_git_daemon
+start_git_daemon --informative-errors
+
+test_expect_success 'clone non-existent' "test_remote_error clone nowhere.git 'no such repository'"
+test_expect_success 'push disabled' "test_remote_error push repo.git 'service not enabled'"
+test_expect_success 'read access denied' "test_remote_error -x fetch repo.git 'no such repository'"
+test_expect_success 'not exported' "test_remote_error -n fetch repo.git 'repository not exported'"
+
+stop_git_daemon
+test_done
--
1.7.8
^ permalink raw reply related
* [PATCH 1/5] run-command: optionally kill children on exit
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1325936567-3136-1-git-send-email-drizzd@aon.at>
From: Jeff King <peff@peff.net>
When we spawn a helper process, it should generally be done
and finish_command called before we exit. However, if we
exit abnormally due to an early return or a signal, the
helper may continue to run in our absence.
In the best case, this may simply be wasted CPU cycles or a
few stray messages on a terminal. But it could also mean a
process that the user thought was aborted continues to run
to completion (e.g., a push's pack-objects helper will
complete the push, even though you killed the push process).
This patch provides infrastructure for run-command to keep
track of PIDs to be killed, and clean them on signal
reception or input, just as we do with tempfiles. PIDs can
be added in two ways:
1. If NO_PTHREADS is defined, async helper processes are
automatically marked. By definition this code must be
ready to die when the parent dies, since it may be
implemented as a thread of the parent process.
2. If the run-command caller specifies the "clean_on_exit"
option. This is not the default, as there are cases
where it is OK for the child to outlive us (e.g., when
spawning a pager).
PIDs are cleared from the kill-list automatically during
wait_or_whine, which is called from finish_command and
finish_async.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
Not sure if I can sign off without your sign-off. Should I have
replaced this with Acked-by?
run-command.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
run-command.h | 1 +
2 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/run-command.c b/run-command.c
index 1c51043..0204aaf 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1,8 +1,66 @@
#include "cache.h"
#include "run-command.h"
#include "exec_cmd.h"
+#include "sigchain.h"
#include "argv-array.h"
+struct child_to_clean {
+ pid_t pid;
+ struct child_to_clean *next;
+};
+static struct child_to_clean *children_to_clean;
+static int installed_child_cleanup_handler;
+
+static void cleanup_children(int sig)
+{
+ while (children_to_clean) {
+ struct child_to_clean *p = children_to_clean;
+ children_to_clean = p->next;
+ kill(p->pid, sig);
+ free(p);
+ }
+}
+
+static void cleanup_children_on_signal(int sig)
+{
+ cleanup_children(sig);
+ sigchain_pop(sig);
+ raise(sig);
+}
+
+static void cleanup_children_on_exit(void)
+{
+ cleanup_children(SIGTERM);
+}
+
+static void mark_child_for_cleanup(pid_t pid)
+{
+ struct child_to_clean *p = xmalloc(sizeof(*p));
+ p->pid = pid;
+ p->next = children_to_clean;
+ children_to_clean = p;
+
+ if (!installed_child_cleanup_handler) {
+ atexit(cleanup_children_on_exit);
+ sigchain_push_common(cleanup_children_on_signal);
+ installed_child_cleanup_handler = 1;
+ }
+}
+
+static void clear_child_for_cleanup(pid_t pid)
+{
+ struct child_to_clean **last, *p;
+
+ last = &children_to_clean;
+ for (p = children_to_clean; p; p = p->next) {
+ if (p->pid == pid) {
+ *last = p->next;
+ free(p);
+ return;
+ }
+ }
+}
+
static inline void close_pair(int fd[2])
{
close(fd[0]);
@@ -130,6 +188,9 @@ static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure)
} else {
error("waitpid is confused (%s)", argv0);
}
+
+ clear_child_for_cleanup(pid);
+
errno = failed_errno;
return code;
}
@@ -292,6 +353,8 @@ fail_pipe:
if (cmd->pid < 0)
error("cannot fork() for %s: %s", cmd->argv[0],
strerror(failed_errno = errno));
+ else if (cmd->clean_on_exit)
+ mark_child_for_cleanup(cmd->pid);
/*
* Wait for child's execvp. If the execvp succeeds (or if fork()
@@ -312,6 +375,7 @@ fail_pipe:
cmd->pid = -1;
}
close(notify_pipe[0]);
+
}
#else
{
@@ -356,6 +420,8 @@ fail_pipe:
failed_errno = errno;
if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
error("cannot spawn %s: %s", cmd->argv[0], strerror(errno));
+ if (cmd->clean_on_exit && cmd->pid >= 0)
+ mark_child_for_cleanup(cmd->pid);
if (cmd->env)
free_environ(env);
@@ -540,6 +606,8 @@ int start_async(struct async *async)
exit(!!async->proc(proc_in, proc_out, async->data));
}
+ mark_child_for_cleanup(async->pid);
+
if (need_in)
close(fdin[0]);
else if (async->in)
diff --git a/run-command.h b/run-command.h
index 56491b9..2a69466 100644
--- a/run-command.h
+++ b/run-command.h
@@ -38,6 +38,7 @@ struct child_process {
unsigned silent_exec_failure:1;
unsigned stdout_to_stderr:1;
unsigned use_shell:1;
+ unsigned clean_on_exit:1;
void (*preexec_cb)(void);
};
--
1.7.8
^ permalink raw reply related
* [PATCH 5/5] git-daemon tests: wait until daemon is ready
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1325936567-3136-1-git-send-email-drizzd@aon.at>
In start_daemon, git-daemon is started as a background process. In
theory, the tests may try to connect before the daemon had a chance
to open a listening socket. Avoid this race condition by waiting
for it to output "Ready to rumble". Any other output is considered
an error and the test is aborted.
Should git-daemon produce no output at all, lib-git-daemon would
block forever. This could be fixed by introducing a timeout. On
the other hand, we have no timeout for other git commands which
could suffer from the same problem. Since such a mechanism adds
some complexity, I have decided against it.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
t/lib-git-daemon.sh | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh
index 5e81a25..ef2d01f 100644
--- a/t/lib-git-daemon.sh
+++ b/t/lib-git-daemon.sh
@@ -23,12 +23,27 @@ start_git_daemon() {
trap 'code=$?; stop_git_daemon; (exit $code); die' EXIT
say >&3 "Starting git daemon ..."
+ mkfifo git_daemon_output
git daemon --listen=127.0.0.1 --port="$LIB_GIT_DAEMON_PORT" \
--reuseaddr --verbose \
--base-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
"$@" "$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
- >&3 2>&4 &
+ >&3 2>git_daemon_output &
GIT_DAEMON_PID=$!
+ {
+ read line
+ echo >&4 "$line"
+ cat >&4 &
+
+ # Check expected output
+ if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"
+ then
+ kill "$GIT_DAEMON_PID"
+ wait "$GIT_DAEMON_PID"
+ trap 'die' EXIT
+ error "git daemon failed to start"
+ fi
+ } <git_daemon_output
}
stop_git_daemon() {
@@ -50,4 +65,5 @@ stop_git_daemon() {
error "git daemon exited with status: $ret"
fi
GIT_DAEMON_PID=
+ rm -f git_daemon_output
}
--
1.7.8
^ permalink raw reply related
* Re: [PATCH 1/2] daemon: add tests
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <7vipkoih0e.fsf@alter.siamese.dyndns.org>
On Fri, Jan 06, 2012 at 02:49:05PM -0800, Junio C Hamano wrote:
>
> but it seems that the best course of action would be to drop it
> and queue your re-roll afresh, aiming for the next cycle.
Here's the re-rolled series, also available as cb/git-daemon-tests based
on current master at https://github.com/drizzd/git .
[PATCH 1/5] run-command: optionally kill children on exit
[PATCH 2/5] run-command: kill children on exit by default
[PATCH 3/5] git-daemon: add tests
[PATCH 4/5] git-daemon: produce output when ready
[PATCH 5/5] git-daemon tests: wait until daemon is ready
On Fri, Jan 06, 2012 at 05:32:15PM -0500, Jeff King wrote:
> On Fri, Jan 06, 2012 at 08:48:00PM +0100, Clemens Buchacher wrote:
>
> > I have rebased Junio's cb/git-daemon-tests onto your
> > jk/child-cleanup and replaced the call to pkill with a regular kill
> > command.
>
> Looks pretty good from my cursory examination. I think you should fill
> out the rationale for "kill dashed externals on exit" a bit. My
> reasoning is that whether a git command is an internal or external
> process is purely an implementation detail, and killing the git wrapper
> should behave identically in both cases.
The previous version of this patch only changed the behavior for users
of run_command_v_opt, but not for those who filled out the child_process
structure by themselves. I could have manually enabled all of those, but
that felt unnatural. Instead, I have now reversed the meaning of
clean_on_exit to stay_alive_on_exit in [PATCH 2/5] run-command: kill
children on exit by default. Cleanup is on by default and callers of
run_command must disable it if children should stay alive.
^ permalink raw reply
* [PATCH 4/5] git-daemon: produce output when ready
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1325936567-3136-1-git-send-email-drizzd@aon.at>
If a client tries to connect after git-daemon starts, but before it
opens a listening socket, the connection will fail. Output "[PID]
Ready to rumble]" after opening the socket successfully in order to
inform the user that the daemon is now ready to receive
connections.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
daemon.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemon.c b/daemon.c
index 15ce918..ab21e66 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1086,6 +1086,8 @@ static int serve(struct string_list *listen_addr, int listen_port,
drop_privileges(cred);
+ loginfo("Ready to rumble");
+
return service_loop(&socklist);
}
@@ -1270,10 +1272,8 @@ int main(int argc, char **argv)
if (inetd_mode || serve_mode)
return execute();
- if (detach) {
+ if (detach)
daemonize();
- loginfo("Ready to rumble");
- }
else
sanitize_stdfds();
--
1.7.8
^ permalink raw reply related
* [PATCH 2/5] run-command: kill children on exit by default
From: Clemens Buchacher @ 2012-01-07 11:42 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1325936567-3136-1-git-send-email-drizzd@aon.at>
It feels natural for a user to view git commands as monolithic
commands with a single thread of execution. If the parent git
command dies, it should therefore clean up its child processes as
well. So enable the cleanup mechanism by default.
For dashed externals, this means that killing the git wrapper will
kill the command itself, just like what would happen in case of an
internal command. A notable exception is the credentials cache
daemon, which must stay alive after the store command has
completed.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
I considered squashing this into the previous commit. But it's a fairly
small change and may help with bisecting in case of problems.
credential-cache.c | 1 +
run-command.c | 4 ++--
run-command.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/credential-cache.c b/credential-cache.c
index dc98372..15e7236 100644
--- a/credential-cache.c
+++ b/credential-cache.c
@@ -48,6 +48,7 @@ static void spawn_daemon(const char *socket)
daemon.argv = argv;
daemon.no_stdin = 1;
daemon.out = -1;
+ daemon.stay_alive_on_exit = 1;
if (start_command(&daemon))
die_errno("unable to start cache daemon");
diff --git a/run-command.c b/run-command.c
index 0204aaf..fe07b20 100644
--- a/run-command.c
+++ b/run-command.c
@@ -353,7 +353,7 @@ fail_pipe:
if (cmd->pid < 0)
error("cannot fork() for %s: %s", cmd->argv[0],
strerror(failed_errno = errno));
- else if (cmd->clean_on_exit)
+ else if (!cmd->stay_alive_on_exit)
mark_child_for_cleanup(cmd->pid);
/*
@@ -420,7 +420,7 @@ fail_pipe:
failed_errno = errno;
if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
error("cannot spawn %s: %s", cmd->argv[0], strerror(errno));
- if (cmd->clean_on_exit && cmd->pid >= 0)
+ if (!cmd->stay_alive_on_exit && cmd->pid >= 0)
mark_child_for_cleanup(cmd->pid);
if (cmd->env)
diff --git a/run-command.h b/run-command.h
index 2a69466..69dbea1 100644
--- a/run-command.h
+++ b/run-command.h
@@ -38,7 +38,7 @@ struct child_process {
unsigned silent_exec_failure:1;
unsigned stdout_to_stderr:1;
unsigned use_shell:1;
- unsigned clean_on_exit:1;
+ unsigned stay_alive_on_exit:1;
void (*preexec_cb)(void);
};
--
1.7.8
^ permalink raw reply related
* [PATCH/RFC] gitweb: Fix actionless dispatch for non-existent objects
From: Jakub Narebski @ 2012-01-07 10:47 UTC (permalink / raw)
To: git
When gitweb URL does not provide action explicitly, e.g.
http://git.example.org/repo.git/branch
dispatch() tries to guess action (view to be used) based on remaining
parameters. Among others it is based on the type of requested object,
which gave problems when asking for non-existent branch or file (for
example misspelt name).
Now undefined $action from dispatch() should not result in problems.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
I'm not sure if this is the way to fix it, by erroring-out in
dispatch() and leaving $action undefined.
Testsuite passes, but I have not examined output intensively.
gitweb/gitweb.perl | 4 +++-
t/t9500-gitweb-standalone-no-errors.sh | 8 ++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f884dfe..e2e04df 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1123,8 +1123,10 @@ sub dispatch {
if (!defined $action) {
if (defined $hash) {
$action = git_get_type($hash);
+ $action or die_error(404, "Object does not exist");
} elsif (defined $hash_base && defined $file_name) {
$action = git_get_type("$hash_base:$file_name");
+ $action or die_error(404, "File or directory does not exist");
} elsif (defined $project) {
$action = 'summary';
} else {
@@ -2391,7 +2393,7 @@ sub get_feed_info {
return unless (defined $project);
# some views should link to OPML, or to generic project feed,
# or don't have specific feed yet (so they should use generic)
- return if ($action =~ /^(?:tags|heads|forks|tag|search)$/x);
+ return if (!$action || $action =~ /^(?:tags|heads|forks|tag|search)$/x);
my $branch;
# branches refs uses 'refs/heads/' prefix (fullname) to differentiate
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index ab24917..0f771c6 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -475,6 +475,14 @@ test_expect_success \
'gitweb_run "" "/.git/master:foo/"'
test_expect_success \
+ 'path_info: project/branch (non-existent)' \
+ 'gitweb_run "" "/.git/non-existent"'
+
+test_expect_success \
+ 'path_info: project/branch:filename (non-existent branch)' \
+ 'gitweb_run "" "/.git/non-existent:non-existent"'
+
+test_expect_success \
'path_info: project/branch:file (non-existent)' \
'gitweb_run "" "/.git/master:non-existent"'
^ permalink raw reply related
* Re: [PATCH] Documentation: rerere.enabled overrides [ -d rr-cache ]
From: Junio C Hamano @ 2012-01-07 5:17 UTC (permalink / raw)
To: Thomas Rast; +Cc: Junio C Hamano, git
In-Reply-To: <87boqge19s.fsf@thomas.inf.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> The manual page for "rerere" talks about "configuration variable
>> rerere.enabled"; perhaps it should also refer to git config manual page to
>> make it more discoverable?
>
> Maybe, but it already says you should set the variable in two different
> places.
That is not the point.
The documentation for git config seems to be the only place where we
explain that the existence of rr-cache determines what happens when the
user does _not_ set the variable; lack of that description will lead to
the confusion you describe below:
>> Thomas Rast <trast@student.ethz.ch> writes:
>>
>>> ... OTOH the
>>> auto-creation of rr-cache can cause strange behavior if a user has
>>> rerere.enabled unset and tries it once, as in
>>>
>>> git config rerere.enabled true
>>> git merge ...
>>> git config --unset rerere.enabled
>>
>> That is because the last one should be
>>
>> git config --bool rerere.enabled false
>
> I definitely meant --unset. If the user knows the distinction, and
> wants to return the variable to the state it had before his test ...
Running "unset" is how to return the _variable_ to the previous state, but
that is _not_ how to return to the previous state of the _repository_.
Perhaps something like this in addition?
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 04f5e19..c523c67 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1786,7 +1786,8 @@ rerere.enabled::
conflict hunks can be resolved automatically, should they be
encountered again. By default, linkgit:git-rerere[1] is
enabled if there is an `rr-cache` directory under the
- `$GIT_DIR`.
+ `$GIT_DIR`, e.g. if "rerere" was previously used in the
+ repository.
sendemail.identity::
A configuration identity. When given, causes values in the
^ permalink raw reply related
* Re: Aborting "git commit --interactive" discards updates to index
From: Junio C Hamano @ 2012-01-07 5:08 UTC (permalink / raw)
To: demerphq; +Cc: git, Ævar Arnfjörð Bjarmason
In-Reply-To: <CANgJU+X+qLe3Aqy_ZpoSDKMuf=8=OxVvpkt0tGmSi=KVgti3HQ@mail.gmail.com>
demerphq <demerphq@gmail.com> writes:
> On 27 June 2011 17:59, Junio C Hamano <gitster@pobox.com> wrote:
>> The latest feature release Git 1.7.6 is available at the usual
>> places:
>>
>> http://www.kernel.org/pub/software/scm/git/
> [snip]
>> * Aborting "git commit --interactive" discards updates to the index
>> made during the interactive session.
>
> Hi, I am wondering why this change was made?
I wasn't directly involved in this particular part of the design of what
should happen to the index when a commit is aborted, so I would be a bad
person to give you the first answer, but let's try.
If a "commit" session is aborted, it is logical to revert whatever has
been done inside that session as a single logical unit, so I do not
particularly find the current behaviour so confusing. It might even make
more sense if we update "commit -i" and "commit -a" to also revert the
index modification when the command is aborted for consistency.
You are welcome to rehash the age old discussion, though. Personally I do
not care very deeply either way. I would never use "commit --interactive"
myself, and I would not encourage others to use it, either, even if we do
not worry about the behaviour when a commit is aborted.
One thread of interest (there are others, as this change was rerolled at
least a few times) may be
http://thread.gmane.org/gmane.comp.version-control.git/173033/focus=173035
Having said all that,...
> .... I am writing this after spending about 45 minutes showing a
> colleague how to use git commit --interactive, when we realized that
> we had forgotten to add a file....
... if your partial commit is so complex that you need to spend 45 minutes
to sift what to be commited and what to be left out, you are much better
off to run "git add -i" to prepare the index, "git stash save -k" to check
out what is to be committed (and stash away what are to be left out) so
that you can make sure what you are committing is what you thought are
committing (by asking "git diff" and "make test" for example), and after
convincing yourself that you made a good state in the index, make a commit
with "git commit" (without any other arguments) and conclude it with "git
stash pop" to recover the changes that you decided to leave out.
"commit --interactive" robs me from that crucial "verification" step, and
that is why I wouldn't be a user or an advocate of this "misfeature".
By the way, why did you draw Ævar into this discussion? I do not think he
was involved in any way with the design or implementation of this command.
^ permalink raw reply
* Re: [PATCH 2/3] show_ref(): remove unused "flag" and "cb_data" arguments
From: Junio C Hamano @ 2012-01-07 5:08 UTC (permalink / raw)
To: mhagger; +Cc: git, Jeff King, Jakub Narebski, Heiko Voigt, Johan Herland
In-Reply-To: <1325859153-31016-3-git-send-email-mhagger@alum.mit.edu>
mhagger@alum.mit.edu writes:
> I suppose, though I didn't verify, that the old function signature was
> a vestige of its earlier having been used as a callback function. But
> it doesn't really matter; the point is that the extra arguments are
> currently not needed.
Yeah, since 8a65ff7 (Generalize the "show each ref" code in receice-pack,
2005-07-02) the function has always been fed to for_each_ref(), but when
6b01ecf (ref namespaces: Support remote repositories via upload-pack and
receive-pack, 2011-07-08) introduced show_ref_cb() as the callback that
uses show_ref() as a helper, it forgot to do the clean-up in this patch.
^ permalink raw reply
* Re: [PATCH 1/2] git-svn, perl/Git.pm: add central method for prompting passwords honoring GIT_ASKPASS and SSH_ASKPASS
From: Sven Strickroth @ 2012-01-07 4:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jeff King, Jakub Narebski
In-Reply-To: <7vipkrp9pq.fsf@alter.siamese.dyndns.org>
Hi,
Am 04.01.2012 20:08 schrieb Junio C Hamano:
> Is there a way to ask Term::ReadKey (or possibly some other module) if we
> will be able to interact with the terminal _before_ we give that prompt?
>
> The simplest would be to do this, I would think, but I didn't test it.
>
> if (!defined $ret && -t) {
> print STDERR $prompt;
> if ($isPassword) {
> ...
> }
-t does not help, but I think it's not a big deal if the prompt is printed on
the terminal and also on the ASKPASS-helper.
Using Term::ReadLine seems to help:
...
$ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
}
if (!defined $ret) {
use Term::Readline;
my $term = Term::ReadLine->new("Git.pm");
if ($isPassword) {
require Term::ReadKey;
Term::ReadKey::ReadMode('noecho');
}
$ret = $term->readline($prompt);
if ($isPassword) {
Term::ReadKey::ReadMode('restore');
print STDERR "\n";
}
}
if (!defined $ret) {
$ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
...
But I'm not sure if this is what we want, because you can go with the cursor
over the whole terminal.
A better (working) alternative might be:
...
$ret = _prompt($ENV{'SSH_ASKPASS'}, $prompt);
}
use Term::Readline;
my $term = Term::ReadLine->new("Git.pm");
if (!defined $ret && fileno($term->IN)) {
print STDERR $prompt;
if ($isPassword) {
...
}
...
--
Best regards,
Sven Strickroth
ClamAV, a GPL anti-virus toolkit http://www.clamav.net
PGP key id F5A9D4C4 @ any key-server
^ permalink raw reply
* Re: How to deal with historic tar-balls
From: Thomas Rast @ 2012-01-07 1:50 UTC (permalink / raw)
To: nn6eumtr; +Cc: Neal Kreitzinger, git
In-Reply-To: <4F079BA1.3060907@gmail.com>
nn6eumtr <nn6eumtr@gmail.com> writes:
> Thanks for the response, there is lots of good information there.
>
> One clarification - can you track renames in git? I tried using git mv
> but from the status output it looks like it deleted the old file and
> added the new file. I was expecting it to record some sort of
> indicator of the name change, instead it looks like a short-cut for
> delete & add, the docs aren't clear if that is the case.
Git only stores snapshots; so for an ordinary (non-merge, non-root)
commit, you have the "before" (parent) and "after" (commit's) snapshot.
Everything is generated on the fly from that, including diffs, heuristic
rename detection, pickaxe, ...
To apply rename detection when diffing (e.g. in diff, log, show,
format-patch), use the -M flag.
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply
* Re: [PATCH] Documentation: rerere.enabled overrides [ -d rr-cache ]
From: Thomas Rast @ 2012-01-07 1:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vfwfsk24y.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> The manual page for "rerere" talks about "configuration variable
> rerere.enabled"; perhaps it should also refer to git config manual page to
> make it more discoverable?
Maybe, but it already says you should set the variable in two different
places.
> Thomas Rast <trast@student.ethz.ch> writes:
>
>> ... OTOH the
>> auto-creation of rr-cache can cause strange behavior if a user has
>> rerere.enabled unset and tries it once, as in
>>
>> git config rerere.enabled true
>> git merge ...
>> git config --unset rerere.enabled
>
> That is because the last one should be
>
> git config --bool rerere.enabled false
I definitely meant --unset. If the user knows the distinction, and
wants to return the variable to the state it had before his test
(perhaps so that a future --global setting might take effect), he would
use this sequence. He might then be somewhat surprised to see that
rerere is now permamently enabled for this repo.
Probably I'm worrying too much about a weird fringe case though.
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply
* Re: How to deal with historic tar-balls
From: nn6eumtr @ 2012-01-07 1:10 UTC (permalink / raw)
To: Neal Kreitzinger, git
In-Reply-To: <4F05C0E2.4050101@gmail.com>
Thanks for the response, there is lots of good information there.
One clarification - can you track renames in git? I tried using git mv
but from the status output it looks like it deleted the old file and
added the new file. I was expecting it to record some sort of indicator
of the name change, instead it looks like a short-cut for delete & add,
the docs aren't clear if that is the case.
On 1/5/2012 10:25 AM, Neal Kreitzinger wrote:
...
> going to want to do appropriate clean up of the working tree in each
> iteration before committing. This is where you would review
> renames/removes with git-status before you git-add and git-commit. Also,
> if you are tracking permissions in git (the executable bit) then you
> will want to filter out any noise generated by frivolous permissions
> changes between the tarball contents.
...
^ permalink raw reply
* Re: [ANNOUNCE] Git 1.7.9-rc0
From: Philip Oakley @ 2012-01-07 0:23 UTC (permalink / raw)
To: Junio C Hamano, git
In-Reply-To: <7vr4zciji4.fsf@alter.siamese.dyndns.org>
minor spelling
From: "Junio C Hamano" <gitster@pobox.com> Sent: Friday, January 06, 2012
9:55 PM
> Git v1.7.9 Release Notes (draft)
> ========================
>
> * "git log --format='<format>'" learned new %g[nNeE] specifiers to
> show information from the reflog entries when warlking the reflog
> (i.e. with "-g").
s/warlking/walking/
^ permalink raw reply
* Re: [PATCH 1/2] daemon: add tests
From: Jakub Narebski @ 2012-01-06 23:35 UTC (permalink / raw)
To: Jeff King
Cc: Junio C Hamano, Clemens Buchacher, git, Jonathan Nieder,
Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <20120105025154.GA7326@sigill.intra.peff.net>
On Thu, 5 Jan 2012, Jeff King wrote:
> On Wed, Jan 04, 2012 at 06:24:16PM -0800, Jakub Narebski wrote:
>
> > Jeff King <peff@peff.net> writes:
> >
> > > As a side note, it looks like we just start the daemon with "git daemon
> > > &". Doesn't that create a race condition with the tests which
> > > immediately try to access it (i.e., the first test may run before the
> > > daemon actually opens the socket)?
> >
> > Hmmm... perhaps the trick that git-instaweb does for "plackup" web
> > server would be of use here, waiting for socket to be ready?
>
> It looks like it busy loops, which is kind of ugly.
Well, as far as I know you can wait for data on socket or pipe, but
you can't wait for socket to be created.
Anyway this busy-wait is not too busy, and it is better than just
adding 'sleep 1' in testsuite.
> The credential-cache helper has a similar problem. It wants to kick off
> a daemon if one is not already running, and then connect to it. So the
> daemon does:
>
> printf("ok\n");
> fclose(stdout);
>
> when it has set up the socket, and the client does:
>
> r = read_in_full(daemon.out, buf, sizeof(buf));
> if (r < 0)
> die_errno("unable to read result code from cache daemon");
> if (r != 3 || memcmp(buf, "ok\n", 3))
> die("cache daemon did not start: %.*s", r, buf);
> /* now we can connect over the socket */
>
> We could probably add a "--notify-when-ready" option to git-daemon to
> do something similar.
What would git-daemon do what it is ready? Write to socket, raise signal,
print to STDOUT / STDERR?
BTW. I wonder if it would be worth it to add something a la systemd
trick creating sockets first to git-daemon. Adding systemd support
doesn't make sense for daemon that is to be run from inetd / xinetd,
I guess.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] Work around sed portability issue in t8006-blame-textconv
From: Junio C Hamano @ 2012-01-06 22:53 UTC (permalink / raw)
To: Ben Walton; +Cc: git
In-Reply-To: <7vd3b0vc6h.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Ben Walton <bwalton@artsci.utoronto.ca> writes:
>
>> In test 'blame --textconv with local changes' of t8006-blame-textconv,
>> using /usr/xpg4/bin/sed on Solaris as set by SANE_TOOL_PATH, an
>> additional newline was added to the output from the 'helper' script
>> driven by git attributes.
>>
>> This was noted by sed with a message such as:
>> sed: Missing newline at end of file zero.bin.
>>
>> In turn, this was triggering a fatal error from git blame:
>> fatal: unable to read files to diff
>
> Interesting. A file with incomplete line technically is not a text file
> and sed is supposed to work on text files, so it is allowed to be picky.
>
>> Use perl -p -e instead of sed -e to work around this portability issue
>> as it will not insert the newline.
>
> I am not sure if additional newline is the problem, or the exit status
> from sed is, from your description. Your first paragraph says you will get
> output from sed but with an extra newline, and then later you said blame
> noticed an error in its attempt to read the contents. I am suspecting that
> it checked the exit status from the textconv subprocess and noticed the
> error and that is the cause of the issue, but could you clarify? IOW, I
> am suspecting that replacing "as it will not insert the newline" with "as
> it does not error out on an incomplete line" is necessary in this
> sentence.
Ping?
^ permalink raw reply
* Re: [PATCH 1/2] daemon: add tests
From: Junio C Hamano @ 2012-01-06 22:49 UTC (permalink / raw)
To: Clemens Buchacher
Cc: Jeff King, git, Jonathan Nieder, Erik Faye-Lund, Ilari Liusvaara,
Nguyễn Thái Ngọc Duy
In-Reply-To: <20120106194800.GA9301@ecki.lan>
Clemens Buchacher <drizzd@aon.at> writes:
> I have rebased Junio's cb/git-daemon-tests onto your
> jk/child-cleanup and replaced the call to pkill with a regular kill
> command.
>
> On top of that, I have added two commits to fix the discussed race
> condition. I also verified that the race condition actually happens
> by adding an artificial delay in the daemon (this change is
> obviously not included).
>
> I pushed the new cb/git-daemon-tests to
> https://github.com/drizzd/git . If you have no objections I will
> post the entire series including your run-command and send-pack
> patches to the list.
Looked fine except that some patches seem to lack enough justification
(justification in Peff's reply was good enough).
I actually was thinking that the previous round was good enough (perhaps
dropping the "pkill" bit altogether and replacing it with "kill" on the
daemon process itself, if OSX folks complain loudly), so it is in "next"
already, but it seems that the best course of action would be to drop it
and queue your re-roll afresh, aiming for the next cycle.
Thanks.
^ permalink raw reply
* Re: [PATCH] parse_object: try internal cache before reading object db
From: Jeff King @ 2012-01-06 22:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, git-dev
In-Reply-To: <7vmxa0ih6s.fsf@alter.siamese.dyndns.org>
On Fri, Jan 06, 2012 at 02:45:15PM -0800, Junio C Hamano wrote:
> > Did you want to leave the parse_object optimization until next cycle,
> > too? It's not loosening checks, but it's such a core piece of code that
> > it makes me nervous somebody somewhere is abusing "struct object" in a
> > way that will break it.
>
> I was just updating the "What's cooking" report and my current thinking is
> that we should keep all three in "next" to give it a bit of exposure for
> now, and merge them to "master" early in the 1.7.10 cycle.
That sounds perfect. Thanks.
-Peff
^ permalink raw reply
* Re: [PATCH] parse_object: try internal cache before reading object db
From: Junio C Hamano @ 2012-01-06 22:45 UTC (permalink / raw)
To: Jeff King; +Cc: git, git-dev
In-Reply-To: <20120106223324.GB13106@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
>> Even though it is a bit scary kind of loosening of sanity checks that I
>> hesitate to take at this late in the cycle, I think it makes sense. Let's
>> queue them on 'pu' and aim for the next cycle.
>
> Did you want to leave the parse_object optimization until next cycle,
> too? It's not loosening checks, but it's such a core piece of code that
> it makes me nervous somebody somewhere is abusing "struct object" in a
> way that will break it.
I was just updating the "What's cooking" report and my current thinking is
that we should keep all three in "next" to give it a bit of exposure for
now, and merge them to "master" early in the 1.7.10 cycle.
^ permalink raw reply
* Re: [PATCH] parse_object: try internal cache before reading object db
From: Jeff King @ 2012-01-06 22:33 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, git-dev
In-Reply-To: <7v8vlkjzcj.fsf@alter.siamese.dyndns.org>
On Fri, Jan 06, 2012 at 01:27:40PM -0800, Junio C Hamano wrote:
> > I don't know if it is really that worth it on top of the parse_object
> > optimization. It's almost negligible for the normal case...
> > ... OTOH, if you had some totally insane ref
> > structure, like 120K _unique_ refs (which would probably imply that
> > you're making one ref per commit or something silly like that. But hey,
> > people have suggested it in the past), then it could be a big
> > improvement.
>
> Even though it is a bit scary kind of loosening of sanity checks that I
> hesitate to take at this late in the cycle, I think it makes sense. Let's
> queue them on 'pu' and aim for the next cycle.
Did you want to leave the parse_object optimization until next cycle,
too? It's not loosening checks, but it's such a core piece of code that
it makes me nervous somebody somewhere is abusing "struct object" in a
way that will break it.
-Peff
^ permalink raw reply
* Re: [PATCH 1/2] daemon: add tests
From: Jeff King @ 2012-01-06 22:32 UTC (permalink / raw)
To: Clemens Buchacher
Cc: Junio C Hamano, git, Jonathan Nieder, Erik Faye-Lund,
Ilari Liusvaara, Nguyễn Thái Ngọc Duy
In-Reply-To: <20120106194800.GA9301@ecki.lan>
On Fri, Jan 06, 2012 at 08:48:00PM +0100, Clemens Buchacher wrote:
> I have rebased Junio's cb/git-daemon-tests onto your
> jk/child-cleanup and replaced the call to pkill with a regular kill
> command.
Looks pretty good from my cursory examination. I think you should fill
out the rationale for "kill dashed externals on exit" a bit. My
reasoning is that whether a git command is an internal or external
process is purely an implementation detail, and killing the git wrapper
should behave identically in both cases.
> On top of that, I have added two commits to fix the discussed race
> condition. I also verified that the race condition actually happens
> by adding an artificial delay in the daemon (this change is
> obviously not included).
Looks reasonable to me.
> I pushed the new cb/git-daemon-tests to
> https://github.com/drizzd/git . If you have no objections I will
> post the entire series including your run-command and send-pack
> patches to the list.
No objections here. Thanks for moving this forward.
-Peff
^ permalink raw reply
* [ANNOUNCE] Git 1.7.9-rc0
From: Junio C Hamano @ 2012-01-06 21:55 UTC (permalink / raw)
To: git
A release candidate Git 1.7.9-rc0 is available for testing. This is
supposed to be almost feature-complete for the final release.
The release tarballs are found at:
http://code.google.com/p/git-core/downloads/list
and their SHA-1 checksums are:
c4a04c92ce9a501ba11cfd0032b1f8371aa6536e git-1.7.9.rc0.tar.gz
60593473ab1111e1bf5af5e491e370ff6a9e9e10 git-htmldocs-1.7.9.rc0.tar.gz
834eff04341ef5bf475654c7a9588d29ae15937c git-manpages-1.7.9.rc0.tar.gz
Also the following public repositories all have a copy of the v1.7.9-rc0
tag and the master branch that the tag points at:
url = git://repo.or.cz/alt-git.git
url = https://code.google.com/p/git-core/
url = git://git.sourceforge.jp/gitroot/git-core/git.git
url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
url = https://github.com/gitster/git
Git v1.7.9 Release Notes (draft)
========================
Updates since v1.7.8
--------------------
* gitk updates accumulated since early 2011.
* git-gui updated to 0.16.0.
* git-p4 (in contrib/) updates.
* Git uses gettext to translate its most common interface messages
into the user's language if translations are available and the
locale is appropriately set. Distributors can drop in new PO files
in po/ to add new translations.
* The code to handle username/password for HTTP transaction used in
"git push" & "git fetch" learned to talk "credential API" to
external programs to cache or store them, to allow integration with
platform native keychain mechanisms.
* The prompted input in the terminal use our own getpass() replacement
when possible. HTTP transactions used to ask username without echoing
back what was typed, but with this change you will see it as you type.
* The internal of "revert/cherry-pick" has been tweaked to prepare
building more generic "sequencer" on top of the implementation that
drives them.
* "git add" learned to stream large files directly into a packfile
instead of writing them into individual loose object files.
* "git checkout -B <current branch> <elsewhere>" is a more intuitive
way to spell "git reset --keep <elsewhere>".
* "git checkout" and "git merge" learned "--no-overwrite-ignore" option
to tell Git that untracked and ignored files are not expendable.
* "git commit --amend" learned "--no-edit" option to say that the
user is amending the tree being recorded, without updating the
commit log message.
* "git commit" and "git reset" re-learned the optimization to prime
the cache-tree information in the index, which makes it faster to
write a tree object out after the index entries are updated.
* "git commit" detects and rejects an attempt to stuff NUL byte in
the commit log message.
* "git commit" learned "-S" to GPG-sign the commit; this can be shown
with the "--show-signature" option to "git log".
* fsck and prune are relatively lengthy operations that still go
silent while making the end-user wait. They learned to give progress
output like other slow operations.
* The set of built-in function-header patterns for various languages
knows MATLAB.
* "git log --format='<format>'" learned new %g[nNeE] specifiers to
show information from the reflog entries when warlking the reflog
(i.e. with "-g").
* "git pull" can be used to fetch and merge an annotated/signed tag,
instead of the tip of a topic branch. The GPG signature from the
signed tag is recorded in the resulting merge commit for later
auditing.
* "git log" learned "--show-signature" option to show the signed tag
that was merged that is embedded in the merge commit. It also can
show the signature made on the commit with "git commit -S".
* "git branch --edit-description" can be used to add descriptive text
to explain what a topic branch is about.
* "git fmt-merge-msg" learned to take the branch description into
account when preparing a merge summary that "git merge" records
when merging a local branch.
* "git request-pull" has been updated to convey more information
useful for integrators to decide if a topic is worth merging and
what is pulled is indeed what the requestor asked to pull,
including:
- the tip of the branch being requested to be merged;
- the branch description describing what the topic is about;
- the contents of the annotated tag, when requesting to pull a tag.
* "git pull" learned to notice 'pull.rebase' configuration variable,
which serves as a global fallback for setting 'branch.<name>.rebase'
configuration variable per branch.
* "git tag" learned "--cleanup" option to control how the whitespaces
and empty lines in tag message are cleaned up.
* "gitweb" learned to show side-by-side diff.
Also contains minor documentation updates and code clean-ups.
Fixes since v1.7.8
------------------
Unless otherwise noted, all the fixes since v1.7.8 in the maintenance
releases are contained in this release (see release notes to them for
details).
----------------------------------------------------------------
Changes since v1.7.8 are as follows:
Anders Kaseorg (2):
gitk: Remove unused $cdate array
gitk: Remember time zones from author and commit timestamps
Andrew Wong (1):
rebase -i: interrupt rebase when "commit --amend" failed during "reword"
Bert Wesarg (14):
git-gui: fix multi selected file operation
git-gui: handle config booleans without value
git-gui: add smart case search mode in searchbar
git-gui: add regexp search mode to the searchbar
git-gui: add search history to searchbar
git-gui: fix unintended line break in message string
git-gui: use "untracked" for files which are not known to git
git-gui: new config to control staging of untracked files
git-gui: fix display of path in browser title
git-gui: use a tristate to control the case mode in the searchbar
git-gui: span widgets over the full file output area in the blame view
git-gui: include the file path in guitools confirmation dialog
git-gui: make config gui.warndetachedcommit a boolean
git-gui: don't warn for detached head when rebasing
Brandon Casey (2):
t/t4131-apply-fake-ancestor.sh: fix broken test
builtin/apply.c: report error on failure to recognize input
Brian Harring (1):
fix hang in git fetch if pointed at a 0 length bundle
Carlos Martín Nieto (2):
convert: track state in LF-to-CRLF filter
clone: the -o option has nothing to do with <branch>
Clemens Buchacher (2):
Documentation: read-tree --prefix works with existing subtrees
t5550: repack everything into one file
Conrad Irwin (1):
Update documentation for stripspace
Dejan Ribič (1):
git-gui: fix spelling error in sshkey.tcl
Eric Wong (1):
enable SO_KEEPALIVE for connected TCP sockets
Erik Faye-Lund (3):
mingw: give waitpid the correct signature
compat/setenv.c: update errno when erroring out
compat/setenv.c: error if name contains '='
Gary Gibbons (5):
git-p4: ensure submit clientPath exists before chdir
git-p4: use absolute directory for PWD env var
git-p4: fix test for unsupported P4 Client Views
git-p4: sort client views by reverse View number
git-p4: support single file p4 client view maps
Gustaf Hendeby (1):
Add built-in diff patterns for MATLAB code
Jack Nagel (2):
Documentation: fix formatting error in merge-options.txt
Add MYMETA.json to perl/.gitignore
Jakub Narebski (7):
gitweb: Refactor diff body line classification
gitweb: Extract formatting of diff chunk header
gitweb: Give side-by-side diff extra CSS styling
t9500: Add test for handling incomplete lines in diff by gitweb
t9500: Add basic sanity tests for side-by-side diff in gitweb
gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"
gitweb: Fix fallback mode of to_utf8 subroutine
Jeff King (53):
http: drop "local" member from request struct
prune: handle --progress/no-progress
reachable: per-object progress
read-cache: let refresh_cache_ent pass up changed flags
refresh_index: rename format variables
refresh_index: make porcelain output more specific
upload-archive: use start_command instead of fork
archive: don't let remote clients get unreachable commits
stripspace: fix outdated comment
fetch: create status table using strbuf
test-lib: add test_config_global variant
t5550: fix typo
introduce credentials API
credential: add function for parsing url components
http: use credential API to get passwords
credential: apply helper config
credential: add credential.*.username
credential: make relevance of http path configurable
docs: end-user documentation for the credential subsystem
credentials: add "cache" helper
compat/snprintf: don't look at va_list twice
docs: mention "-k" for both forms of "git mv"
mv: honor --verbose flag
mv: make non-directory destination error more clear
mv: improve overwrite warning
mv: be quiet about overwriting
strbuf: add strbuf_add*_urlencode
imap-send: avoid buffer overflow
imap-send: don't check return value of git_getpass
move git_getpass to its own source file
refactor git_getpass into generic prompt function
add generic terminal prompt function
credentials: add "store" helper
prompt: use git_terminal_prompt
t: add test harness for external credential helpers
credential: use git_prompt instead of git_getpass
Makefile: linux has /dev/tty
Makefile: OS X has /dev/tty
contrib: add credential helper for OS X Keychain
drop "match" parameter from get_remote_heads
t5500: give fully-qualified refs to fetch-pack
fetch-pack: match refs exactly
connect.c: drop path_match function
t5540: test DAV push with authentication
http-push: enable "proactive auth"
blame: don't overflow time buffer
test-lib: redirect stdin of tests
use custom rename score during --follow
pretty: give placeholders to reflog identity
docs: brush up obsolete bits of git-fsck manpage
make "git push -v" actually verbose
commit, merge: initialize static strbuf
remote-curl: don't pass back fake refs
Jelmer Vernooij (1):
Fix an incorrect reference to --set-all.
Jens Lehmann (2):
diff/status: print submodule path when looking for changes fails
docs: describe behavior of relative submodule URLs
Joey Hess (1):
write first for-merge ref to FETCH_HEAD first
Johan Herland (3):
t9301: Fix testcase covering up a bug in fast-import's notes fanout handling
t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling
fast-import: Fix incorrect fanout level when modifying existing notes refs
Johannes Sixt (3):
Compatibility: declare strtoimax() under NO_STRTOUMAX
Makefile: unix sockets may not available on some platforms
t0090: be prepared that 'wc -l' writes leading blanks
Jonathan Nieder (15):
gitk: Make vi-style keybindings more vi-like
branch: allow a no-op "branch -M <current-branch> HEAD"
Allow checkout -B <current-branch> to update the current branch
test: add missing "&&" after echo command
test: remove a porcelain test that hard-codes commit names
t7501 (commit): modernize style
test: commit --amend should honor --no-edit
revert: give --continue handling its own function
revert: allow cherry-pick --continue to commit before resuming
revert: pass around rev-list args in already-parsed form
revert: allow single-pick in the middle of cherry-pick sequence
revert: do not remove state until sequence is finished
Revert "reset: Make reset remove the sequencer state"
revert: stop creating and removing sequencer-old directory
test: errors preparing for a test are not special
Jonathon Mah (1):
stash: Don't fail if work dir contains file named 'HEAD'
Junio C Hamano (65):
branch: add read_branch_desc() helper function
format-patch: use branch description in cover letter
branch: teach --edit-description option
request-pull: modernize style
request-pull: state what commit to expect
request-pull: use the branch description
fmt-merge-msg: use branch.$name.description
get_tree_entry(): do not call find_tree_entry() on an empty tree
unpack_object_header_buffer(): clear the size field upon error
write_pack_header(): a helper function
create_tmp_packfile(): a helper function
finish_tmp_packfile(): a helper function
Split GPG interface into its own helper library
merge: notice local merging of tags and keep it unwrapped
fetch: allow "git fetch $there v1.0" to fetch a tag
refs DWIMmery: use the same rule for both "git fetch" and others
fmt-merge-msg: avoid early returns
fmt-merge-msg: package options into a structure
fmt-merge-msg: Add contents of merged tag in the merge message
merge: make usage of commit->util more extensible
merge: record tag objects without peeling in MERGE_HEAD
request-pull: use the annotated tag contents
commit: copy merged signed tags to headers of merge commit
merge: force edit and no-ff mode when merging a tag object
commit: teach --amend to carry forward extra headers
commit-tree: update the command line parsing
commit-tree: teach -m/-F options to read logs from elsewhere
commit: teach --gpg-sign option
log: --show-signature
test "commit -S" and "log --show-signature"
pretty: %G[?GS] placeholders
receive-pack, fetch-pack: reject bogus pack that records objects twice
pack-object: tolerate broken packs that have duplicated objects
gpg-interface: allow use of a custom GPG binary
csum-file: introduce sha1file_checkpoint
bulk-checkin: replace fast-import based implementation
Kick-off the 1.7.9 cycle
checkout -m: no need to insist on having all 3 stages
commit: honour --no-edit
Update draft release notes for 1.7.9
Git 1.7.6.5
Git 1.7.7.5
Update draft release notes for 1.7.8.1
Update draft release notes to 1.7.9
checkout_merged(): squelch false warning from some gcc
request-pull: update the "pull" command generation logic
lf_to_crlf_filter(): tell the caller we added "\n" when draining
Update draft release notes to 1.7.9
lf_to_crlf_filter(): resurrect CRLF->CRLF hack
advice: Document that they all default to true
request-pull: do not emit "tag" before the tagname
Update draft release notes to 1.7.9
commit: do not lose mergetag header when not amending
Git 1.7.8.1
Update draft release notes to 1.7.9
Update draft release notes in preparation for 1.7.9-rc0
Git 1.7.8.2
Update draft release notes to 1.7.9
verify_signed_buffer: fix stale comment
commit --amend -S: strip existing gpgsig headers
log-tree.c: small refactor in show_signature()
log-tree: show mergetag in log --show-signature output
log --show-signature: reword the common two-head merge case
Git 1.7.8.3
Git 1.7.9-rc0
Jürgen Kreileder (3):
gitweb: Call to_utf8() on input string in chop_and_escape_str()
gitweb: esc_html() site name for title in OPML
gitweb: Output valid utf8 in git_blame_common('data')
Kato Kazuyoshi (2):
gitweb: Add a feature to show side-by-side diff
gitweb: Add navigation to select side-by-side diff
Kirill A. Shutemov (1):
git-tag: introduce --cleanup option
Linus Torvalds (1):
fetch: do not store peeled tag object names in FETCH_HEAD
Martin von Zweigbergk (11):
gitk: Fix file highlight when run in subdirectory
gitk: Fix "show origin of this line" with separate work tree
gitk: Fix "blame parent commit" with separate work tree
gitk: Fix "External diff" with separate work tree
gitk: Put temporary directory inside .git
gitk: Run 'git rev-parse --git-dir' only once
gitk: Simplify calculation of gitdir
gitk: Show modified files with separate work tree
am: don't persist keepcr flag
t3401: modernize style
t3401: use test_commit in setup
Michael Haggerty (17):
git symbolic-ref: documentation fix
struct ref_entry: document name member
refs: rename "refname" variables
refs: rename parameters result -> sha1
clear_ref_array(): rename from free_ref_array()
is_refname_available(): remove the "quiet" argument
parse_ref_line(): add docstring
add_ref(): add docstring
is_dup_ref(): extract function from sort_ref_array()
refs: change signatures of get_packed_refs() and get_loose_refs()
get_ref_dir(): change signature
resolve_gitlink_ref(): improve docstring
Pass a (ref_cache *) to the resolve_gitlink_*() helper functions
resolve_gitlink_ref_recursive(): change to work with struct ref_cache
repack_without_ref(): remove temporary
create_ref_entry(): extract function from add_ref()
add_ref(): take a (struct ref_entry *) parameter
Michael Schubert (2):
builtin/commit: add missing '/' in help message
builtin/log: remove redundant initialization
Mika Fischer (3):
http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
http.c: Use timeout suggested by curl instead of fixed 50ms timeout
http.c: Rely on select instead of tracking whether data was received
Nguyễn Thái Ngọc Duy (20):
tree-walk.c: do not leak internal structure in tree_entry_len()
read_directory_recursive: reduce one indentation level
tree_entry_interesting(): give meaningful names to return values
tree_entry_interesting: make use of local pointer "item"
fsck: return error code when verify_pack() goes wrong
verify_packfile(): check as many object as possible in a pack
fsck: avoid reading every object twice
fsck: print progress
prune: show progress while marking reachable objects
Convert many resolve_ref() calls to read_ref*() and ref_exists()
checkout,merge: loosen overwriting untracked file check based on info/exclude
checkout,merge: disallow overwriting ignored files with --no-overwrite-ignore
Copy resolve_ref() return value for longer use
revert: convert resolve_ref() to read_ref_full()
Convert resolve_ref+xstrdup to new resolve_refdup function
Rename resolve_ref() to resolve_ref_unsafe()
merge: abort if fails to commit
Convert commit_tree() to take strbuf as message
commit_tree(): refuse commit messages that contain NULs
Catch invalid --depth option passed to clone or fetch
Nick Alcock (2):
Add strtoimax() compatibility function.
Support sizes >=2G in various config options accepting 'g' sizes.
Pat Thoyts (11):
git-gui: include the number of untracked files to stage when asking the user
git-gui: theme the search and line-number entry fields on blame screen
git-gui: catch invalid or complete regular expressions and treat as no match.
git-gui: enable the smart case sensitive search only if gui.search.smartcase is true
git-gui: set suitable extended window manager hints.
git-gui: support underline style when parsing diff output
git-gui: sort the numeric ansi codes
git-gui: set whitespace warnings appropriate to this project
git-gui: added config gui.gcwarning to disable the gc hint message
git-gui: handle shell script text filters when loading for blame.
git-gui 0.16
Paul Mackerras (1):
gitk: Update copyright
Pete Harlan (1):
Test 'checkout -m -- path'
Pete Wyckoff (18):
git-p4: introduce skipSubmitEdit
git-p4: submit test for auto-creating clientPath
git-p4: test for absolute PWD problem
git-p4: fix skipSubmitEdit regression
rename git-p4 tests
git-p4: introduce asciidoc documentation
git-p4: clone does not use --git-dir
git-p4: test cloning with two dirs, clarify doc
git-p4: document and test clone --branch
git-p4: honor --changesfile option and test
git-p4: document and test --import-local
git-p4: test --max-changes
git-p4: test --keep-path
git-p4: test and document --use-client-spec
git-p4: document and test submit options
git-p4: test client view handling
git-p4: rewrite view handling
git-p4: view spec documentation
Ramkumar Ramachandra (11):
t3200 (branch): fix '&&' chaining
test: fix '&&' chaining
t3030 (merge-recursive): use test_expect_code
t1510 (worktree): fix '&&' chaining
t3040 (subprojects-basic): fix '&&' chaining, modernize style
revert: free msg in format_todo()
revert: make commit subjects in insn sheet optional
revert: tolerate extra spaces, tabs in insn sheet
revert: simplify getting commit subject in format_todo()
t3510 (cherry-pick-sequencer): use exit status
t3502, t3510: clarify cherry-pick -m failure
Ramsay Allan Jones (3):
builtin/log.c: Fix an "Using plain integer as NULL pointer" warning
environment.c: Fix an sparse "symbol not declared" warning
fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error
Raphael Zimmerer (1):
gitk: When a commit contains a note, mark it with a yellow box
René Scharfe (5):
read-cache.c: allocate index entries individually
cache.h: put single NUL at end of struct cache_entry
use struct sha1_array in diff_tree_combined()
pass struct commit to diff_tree_combined_merge()
submodule: use diff_tree_combined_merge() instead of diff_tree_combined()
SZEDER Gábor (9):
completion: document __gitcomp()
completion: optimize refs completion
completion: make refs completion consistent for local and remote repos
completion: improve ls-remote output filtering in __git_refs()
completion: support full refs from remote repositories
completion: query only refs/heads/ in __git_refs_remotes()
completion: improve ls-remote output filtering in __git_refs_remotes()
completion: fast initial completion for config 'remote.*.fetch' value
completion: remove broken dead code from __git_heads() and __git_tags()
Samuel Bronson (1):
git-gui: Set both 16x16 and 32x32 icons on X to pacify Xming.
Sebastian Morr (1):
Add MYMETA.yml to perl/.gitignore
Steven Walter (1):
git-svn.perl: close the edit for propedits even with no mods
Thomas Jarosch (1):
imap-send: Remove unused 'use_namespace' variable
Thomas Rast (13):
userdiff: allow * between cpp funcname words
Add test-scrap-cache-tree
Test the current state of the cache-tree optimization
Refactor cache_tree_update idiom from commit
commit: write cache-tree data when writing index anyway
reset: update cache-tree data when appropriate
grep: load funcname patterns for -W
grep: enable threading with -p and -W using lazy attribute lookup
grep: disable threading in non-worktree case
test-terminal: set output terminals to raw mode
git-sh-setup: make require_clean_work_tree part of the interface
bash completion: use read -r everywhere
Documentation: rerere.enabled is the primary way to configure rerere
Tilman Vogel (1):
git-gui: add config value gui.diffopts for passing additional diff options
Vincent van Ravesteijn (4):
Compile fix for MSVC: Do not include sys/resources.h
Compile fix for MSVC: Include <io.h>
MSVC: Remove unneeded header stubs
Show error for 'git merge' with unset merge.defaultToUpstream
Yggy King (1):
gitk: Make "touching paths" search support backslashes
Ævar Arnfjörð Bjarmason (9):
apply: get rid of useless x < 0 comparison on a size_t type
cast variable in call to free() in builtin/diff.c and submodule.c
pull: introduce a pull.rebase option to enable --rebase
i18n: add infrastructure for translating Git with gettext
t/t2023-checkout-m.sh: fix use of test_must_fail
builtin/init-db.c: eliminate -Wformat warning on Solaris
Fix an enum assignment issue spotted by Sun Studio
Fix a bitwise negation assignment issue spotted by Sun Studio
Appease Sun Studio by renaming "tmpfile"
^ permalink raw reply
* [ANNOUNCE] Git 1.7.8.3
From: Junio C Hamano @ 2012-01-06 21:53 UTC (permalink / raw)
To: git
The latest maintenance release Git 1.7.8.3 is available.
The release tarballs are found at:
http://code.google.com/p/git-core/downloads/list
and their SHA-1 checksums are:
e5eb8c289b69d69fd08c81b587a06eb5dd2b5c1c git-1.7.8.3.tar.gz
8a65d2425c1b6f646d130cf5846e92e9e0e93736 git-htmldocs-1.7.8.3.tar.gz
a6e2b7cff8181ee52a1cc00ebba7b349850d6680 git-manpages-1.7.8.3.tar.gz
Also the following public repositories all have a copy of the v1.7.8.3
tag and the maint branch that the tag points at:
url = git://repo.or.cz/alt-git.git
url = https://code.google.com/p/git-core/
url = git://git.sourceforge.jp/gitroot/git-core/git.git
url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
url = https://github.com/gitster/git
----------------------------------------------------------------
Changes since v1.7.8.2 are as follows:
Brian Harring (1):
fix hang in git fetch if pointed at a 0 length bundle
Clemens Buchacher (2):
Documentation: read-tree --prefix works with existing subtrees
t5550: repack everything into one file
Jack Nagel (1):
Add MYMETA.json to perl/.gitignore
Jakub Narebski (1):
gitweb: Fix fallback mode of to_utf8 subroutine
Jens Lehmann (1):
docs: describe behavior of relative submodule URLs
Junio C Hamano (1):
Git 1.7.8.3
Jürgen Kreileder (3):
gitweb: Call to_utf8() on input string in chop_and_escape_str()
gitweb: esc_html() site name for title in OPML
gitweb: Output valid utf8 in git_blame_common('data')
Nguyễn Thái Ngọc Duy (1):
Catch invalid --depth option passed to clone or fetch
Thomas Rast (1):
Documentation: rerere.enabled is the primary way to configure rerere
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox