* [PATCH v2 4/4] use wrapper for unchecked setenv/putenv calls
From: Erik Faye-Lund @ 2011-12-14 14:07 UTC (permalink / raw)
To: git; +Cc: peff, gitster, schwab
In-Reply-To: <1323871631-2872-1-git-send-email-kusmabite@gmail.com>
This avoids us from accidentally dropping state, possibly leading
to unexpected behaviour.
This is especially important on Windows, where the maximum size of
the environment is 32 kB.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
builtin/clone.c | 2 +-
builtin/commit.c | 6 +++---
builtin/help.c | 4 ++--
builtin/init-db.c | 2 +-
builtin/merge.c | 4 ++--
builtin/notes.c | 2 +-
builtin/remote-ext.c | 4 ++--
builtin/revert.c | 2 +-
config.c | 2 +-
exec_cmd.c | 4 ++--
git.c | 18 +++++++++---------
| 2 +-
run-command.c | 2 +-
setup.c | 6 +++---
14 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index efe8b6c..8d81c29 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -566,7 +566,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
atexit(remove_junk);
sigchain_push_common(remove_junk_on_signal);
- setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
+ xsetenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
if (safe_create_leading_directories_const(git_dir) < 0)
die(_("could not create leading directories of '%s'"), git_dir);
diff --git a/builtin/commit.c b/builtin/commit.c
index e36e9ad..2b87da9 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -361,13 +361,13 @@ static char *prepare_index(int argc, const char **argv, const char *prefix,
die(_("unable to create temporary index"));
old_index_env = getenv(INDEX_ENVIRONMENT);
- setenv(INDEX_ENVIRONMENT, index_lock.filename, 1);
+ xsetenv(INDEX_ENVIRONMENT, index_lock.filename, 1);
if (interactive_add(argc, argv, prefix, patch_interactive) != 0)
die(_("interactive add failed"));
if (old_index_env && *old_index_env)
- setenv(INDEX_ENVIRONMENT, old_index_env, 1);
+ xsetenv(INDEX_ENVIRONMENT, old_index_env, 1);
else
unsetenv(INDEX_ENVIRONMENT);
@@ -1023,7 +1023,7 @@ static int parse_and_validate_options(int argc, const char *argv[],
if (edit_flag)
use_editor = 1;
if (!use_editor)
- setenv("GIT_EDITOR", ":", 1);
+ xsetenv("GIT_EDITOR", ":", 1);
/* Sanity check options */
if (amend && !current_head)
diff --git a/builtin/help.c b/builtin/help.c
index 61ff798..e7dc15b 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -330,7 +330,7 @@ static void setup_man_path(void)
if (old_path)
strbuf_addstr(&new_path, old_path);
- setenv("MANPATH", new_path.buf, 1);
+ xsetenv("MANPATH", new_path.buf, 1);
strbuf_release(&new_path);
}
@@ -371,7 +371,7 @@ static void show_man_page(const char *git_cmd)
static void show_info_page(const char *git_cmd)
{
const char *page = cmd_to_page(git_cmd);
- setenv("INFOPATH", system_path(GIT_INFO_PATH), 1);
+ xsetenv("INFOPATH", system_path(GIT_INFO_PATH), 1);
execlp("info", "info", "gitman", page, (char *)NULL);
die("no info viewer handled the request");
}
diff --git a/builtin/init-db.c b/builtin/init-db.c
index d07554c..21ff09e 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -537,7 +537,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
if (is_bare_repository_cfg == 1) {
static char git_dir[PATH_MAX+1];
- setenv(GIT_DIR_ENVIRONMENT,
+ xsetenv(GIT_DIR_ENVIRONMENT,
getcwd(git_dir, sizeof(git_dir)), argc > 0);
}
diff --git a/builtin/merge.c b/builtin/merge.c
index a1c8534..a4ae473 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1257,7 +1257,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
strbuf_addstr(&buf, "merge");
for (i = 0; i < argc; i++)
strbuf_addf(&buf, " %s", argv[i]);
- setenv("GIT_REFLOG_ACTION", buf.buf, 0);
+ xsetenv("GIT_REFLOG_ACTION", buf.buf, 0);
strbuf_reset(&buf);
for (i = 0; i < argc; i++) {
@@ -1267,7 +1267,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
remotes = &commit_list_insert(commit, remotes)->next;
strbuf_addf(&buf, "GITHEAD_%s",
sha1_to_hex(commit->object.sha1));
- setenv(buf.buf, argv[i], 1);
+ xsetenv(buf.buf, argv[i], 1);
strbuf_reset(&buf);
if (merge_remote_util(commit) &&
merge_remote_util(commit)->obj &&
diff --git a/builtin/notes.c b/builtin/notes.c
index 10b8bc7..7b53c69 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -1076,7 +1076,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
struct strbuf sb = STRBUF_INIT;
strbuf_addstr(&sb, override_notes_ref);
expand_notes_ref(&sb);
- setenv("GIT_NOTES_REF", sb.buf, 1);
+ xsetenv("GIT_NOTES_REF", sb.buf, 1);
strbuf_release(&sb);
}
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 692c834..0b2169a 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -38,8 +38,8 @@ static char *strip_escapes(const char *str, const char *service,
psoff = 4;
/* Pass the service to command. */
- setenv("GIT_EXT_SERVICE", service, 1);
- setenv("GIT_EXT_SERVICE_NOPREFIX", service + psoff, 1);
+ xsetenv("GIT_EXT_SERVICE", service, 1);
+ xsetenv("GIT_EXT_SERVICE_NOPREFIX", service + psoff, 1);
/* Scan the length of argument. */
while (str[rpos] && (escape || str[rpos] != ' ')) {
diff --git a/builtin/revert.c b/builtin/revert.c
index 1ea525c..955a99f 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1007,7 +1007,7 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)
struct commit_list *cur;
int res;
- setenv(GIT_REFLOG_ACTION, action_name(opts), 0);
+ xsetenv(GIT_REFLOG_ACTION, action_name(opts), 0);
if (opts->allow_ff)
assert(!(opts->signoff || opts->no_commit ||
opts->record_origin || opts->edit));
diff --git a/config.c b/config.c
index 5ea101f..f461a62 100644
--- a/config.c
+++ b/config.c
@@ -43,7 +43,7 @@ void git_config_push_parameter(const char *text)
strbuf_addch(&env, ' ');
}
sq_quote_buf(&env, text);
- setenv(CONFIG_DATA_ENVIRONMENT, env.buf, 1);
+ xsetenv(CONFIG_DATA_ENVIRONMENT, env.buf, 1);
strbuf_release(&env);
}
diff --git a/exec_cmd.c b/exec_cmd.c
index 171e841..a5a92dd 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -63,7 +63,7 @@ void git_set_argv_exec_path(const char *exec_path)
/*
* Propagate this setting to external programs.
*/
- setenv(EXEC_PATH_ENVIRONMENT, exec_path, 1);
+ xsetenv(EXEC_PATH_ENVIRONMENT, exec_path, 1);
}
@@ -108,7 +108,7 @@ void setup_path(void)
else
strbuf_addstr(&new_path, _PATH_DEFPATH);
- setenv("PATH", new_path.buf, 1);
+ xsetenv("PATH", new_path.buf, 1);
strbuf_release(&new_path);
}
diff --git a/git.c b/git.c
index 8e34903..cb80de2 100644
--- a/git.c
+++ b/git.c
@@ -54,7 +54,7 @@ int check_pager_config(const char *cmd)
static void commit_pager_choice(void) {
switch (use_pager) {
case 0:
- setenv("GIT_PAGER", "cat", 1);
+ xsetenv("GIT_PAGER", "cat", 1);
break;
case 1:
setup_pager();
@@ -109,7 +109,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--no-replace-objects")) {
read_replace_refs = 0;
- setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
+ xsetenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
if (envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--git-dir")) {
@@ -117,13 +117,13 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
fprintf(stderr, "No directory given for --git-dir.\n" );
usage(git_usage_string);
}
- setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
+ xsetenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
if (envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
} else if (!prefixcmp(cmd, "--git-dir=")) {
- setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
+ xsetenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
if (envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--namespace")) {
@@ -131,13 +131,13 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
fprintf(stderr, "No namespace given for --namespace.\n" );
usage(git_usage_string);
}
- setenv(GIT_NAMESPACE_ENVIRONMENT, (*argv)[1], 1);
+ xsetenv(GIT_NAMESPACE_ENVIRONMENT, (*argv)[1], 1);
if (envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
} else if (!prefixcmp(cmd, "--namespace=")) {
- setenv(GIT_NAMESPACE_ENVIRONMENT, cmd + 12, 1);
+ xsetenv(GIT_NAMESPACE_ENVIRONMENT, cmd + 12, 1);
if (envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--work-tree")) {
@@ -145,19 +145,19 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
fprintf(stderr, "No directory given for --work-tree.\n" );
usage(git_usage_string);
}
- setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
+ xsetenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
if (envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
} else if (!prefixcmp(cmd, "--work-tree=")) {
- setenv(GIT_WORK_TREE_ENVIRONMENT, cmd + 12, 1);
+ xsetenv(GIT_WORK_TREE_ENVIRONMENT, cmd + 12, 1);
if (envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--bare")) {
static char git_dir[PATH_MAX+1];
is_bare_repository_cfg = 1;
- setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0);
+ xsetenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0);
if (envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "-c")) {
--git a/pager.c b/pager.c
index 975955b..d3a1299 100644
--- a/pager.c
+++ b/pager.c
@@ -76,7 +76,7 @@ void setup_pager(void)
if (!pager)
return;
- setenv("GIT_PAGER_IN_USE", "true", 1);
+ xsetenv("GIT_PAGER_IN_USE", "true", 1);
/* spawn the pager */
pager_argv[0] = pager;
diff --git a/run-command.c b/run-command.c
index 1c51043..37abbde 100644
--- a/run-command.c
+++ b/run-command.c
@@ -258,7 +258,7 @@ fail_pipe:
if (cmd->env) {
for (; *cmd->env; cmd->env++) {
if (strchr(*cmd->env, '='))
- putenv((char *)*cmd->env);
+ xputenv((char *)*cmd->env);
else
unsetenv(*cmd->env);
}
diff --git a/setup.c b/setup.c
index 61c22e6..06f38d0 100644
--- a/setup.c
+++ b/setup.c
@@ -309,7 +309,7 @@ void setup_work_tree(void)
* if $GIT_WORK_TREE is set relative
*/
if (getenv(GIT_WORK_TREE_ENVIRONMENT))
- setenv(GIT_WORK_TREE_ENVIRONMENT, ".", 1);
+ xsetenv(GIT_WORK_TREE_ENVIRONMENT, ".", 1);
set_git_dir(relative_path(git_dir, work_tree));
initialized = 1;
@@ -683,9 +683,9 @@ const char *setup_git_directory_gently(int *nongit_ok)
prefix = setup_git_directory_gently_1(nongit_ok);
if (prefix)
- setenv("GIT_PREFIX", prefix, 1);
+ xsetenv("GIT_PREFIX", prefix, 1);
else
- setenv("GIT_PREFIX", "", 1);
+ xsetenv("GIT_PREFIX", "", 1);
if (startup_info) {
startup_info->have_repository = !nongit_ok || !*nongit_ok;
--
1.7.7.1.msysgit.0.272.g9e47e
^ permalink raw reply related
* [PATCH v2 3/4] wrapper: supply xsetenv and xputenv
From: Erik Faye-Lund @ 2011-12-14 14:07 UTC (permalink / raw)
To: git; +Cc: peff, gitster, schwab
In-Reply-To: <1323871631-2872-1-git-send-email-kusmabite@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
git-compat-util.h | 2 ++
wrapper.c | 14 ++++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 77062ed..ab17d53 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -439,6 +439,8 @@ extern int xdup(int fd);
extern FILE *xfdopen(int fd, const char *mode);
extern int xmkstemp(char *template);
extern int xmkstemp_mode(char *template, int mode);
+extern int xsetenv(const char *name, const char *val, int override);
+extern int xputenv(const char *string);
extern int odb_mkstemp(char *template, size_t limit, const char *pattern);
extern int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1);
diff --git a/wrapper.c b/wrapper.c
index 85f09df..8d172ac 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -381,3 +381,17 @@ int remove_or_warn(unsigned int mode, const char *file)
{
return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
}
+
+int xsetenv(const char *name, const char *val, int overwrite)
+{
+ if (setenv(name, val, overwrite))
+ die_errno("setenv failed to set '%s' to '%s'", name, val);
+ return 0;
+}
+
+int xputenv(const char *string)
+{
+ if (putenv(string))
+ die_errno("putenv failed to set '%s' ", string);
+ return 0;
+}
--
1.7.7.1.msysgit.0.272.g9e47e
^ permalink raw reply related
* [PATCH v2 2/4] compat/setenv.c: error if name contains '='
From: Erik Faye-Lund @ 2011-12-14 14:07 UTC (permalink / raw)
To: git; +Cc: peff, gitster, schwab
In-Reply-To: <1323871631-2872-1-git-send-email-kusmabite@gmail.com>
According to POSIX, setenv should error out with EINVAL if it's
asked to set an environment variable whose name contains an equals
sign. Implement this detail in our compatibility-fallback.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
compat/setenv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/compat/setenv.c b/compat/setenv.c
index 89947b7..fc1439a 100644
--- a/compat/setenv.c
+++ b/compat/setenv.c
@@ -6,7 +6,7 @@ int gitsetenv(const char *name, const char *value, int replace)
size_t namelen, valuelen;
char *envstr;
- if (!name || !value) {
+ if (!name || strchr(name, '=') || !value) {
errno = EINVAL;
return -1;
}
--
1.7.7.1.msysgit.0.272.g9e47e
^ permalink raw reply related
* [PATCH v2 1/4] compat/setenv.c: update errno when erroring out
From: Erik Faye-Lund @ 2011-12-14 14:07 UTC (permalink / raw)
To: git; +Cc: peff, gitster, schwab
In-Reply-To: <1323871631-2872-1-git-send-email-kusmabite@gmail.com>
Previously, gitsetenv didn't update errno as it should when
erroring out. Fix this.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---
compat/setenv.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/compat/setenv.c b/compat/setenv.c
index 3a22ea7..89947b7 100644
--- a/compat/setenv.c
+++ b/compat/setenv.c
@@ -6,7 +6,10 @@ int gitsetenv(const char *name, const char *value, int replace)
size_t namelen, valuelen;
char *envstr;
- if (!name || !value) return -1;
+ if (!name || !value) {
+ errno = EINVAL;
+ return -1;
+ }
if (!replace) {
char *oldval = NULL;
oldval = getenv(name);
@@ -16,7 +19,10 @@ int gitsetenv(const char *name, const char *value, int replace)
namelen = strlen(name);
valuelen = strlen(value);
envstr = malloc((namelen + valuelen + 2));
- if (!envstr) return -1;
+ if (!envstr) {
+ errno = ENOMEM;
+ return -1;
+ }
memcpy(envstr, name, namelen);
envstr[namelen] = '=';
--
1.7.7.1.msysgit.0.272.g9e47e
^ permalink raw reply related
* [PATCH v2 0/4] setenv/putenv errors
From: Erik Faye-Lund @ 2011-12-14 14:07 UTC (permalink / raw)
To: git; +Cc: peff, gitster, schwab
Here's v2 of this series. It grew a bit since the last round, as
I figured fixing the error-paths in compat/setenv.c made sense to
do while I was at it, considering how Windows (which is one of
the few likely platforms to be able to actually trigger this
issue) use it.
Erik Faye-Lund (4):
compat/setenv.c: update errno when erroring out
compat/setenv.c: error if name contains '='
wrapper: supply xsetenv and xputenv
use wrapper for unchecked setenv/putenv calls
builtin/clone.c | 2 +-
builtin/commit.c | 6 +++---
builtin/help.c | 4 ++--
builtin/init-db.c | 2 +-
builtin/merge.c | 4 ++--
builtin/notes.c | 2 +-
builtin/remote-ext.c | 4 ++--
builtin/revert.c | 2 +-
compat/setenv.c | 10 ++++++++--
config.c | 2 +-
exec_cmd.c | 4 ++--
git-compat-util.h | 2 ++
git.c | 18 +++++++++---------
pager.c | 2 +-
run-command.c | 2 +-
setup.c | 6 +++---
wrapper.c | 14 ++++++++++++++
17 files changed, 54 insertions(+), 32 deletions(-)
--
1.7.7.1.msysgit.0.272.g9e47e
^ permalink raw reply
* Re: [PATCH 1/7] revert: give --continue handling its own function
From: Ramkumar Ramachandra @ 2011-12-14 13:16 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Johannes Sixt, Junio C Hamano, git, Christian Couder,
Martin von Zweigbergk, Jay Soffian
In-Reply-To: <20111210124736.GB22035@elie.hsd1.il.comcast.net>
Hi Jonathan,
Jonathan Nieder wrote:
> This makes pick_revisions() a little shorter and easier to read
> straight through.
Ah, yes: you've asked about this earlier. Sounds sane; let's read
ahead and see if anything jumps out.
> diff --git a/builtin/revert.c b/builtin/revert.c
> index 1ea525c1..9f6c85c1 100644
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -1038,6 +1038,21 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)
> [...]
> +static int sequencer_continue(struct replay_opts *opts)
> +{
> + struct commit_list *todo_list = NULL;
> [...]
> static int pick_revisions(struct replay_opts *opts)
> {
> struct commit_list *todo_list = NULL;
> [...]
This is the only detailed that jumped out- you're filling up two
different commit_list structures, depending on whether we're
performing a fresh operation or continuing an existing one. Okay.
Thanks.
p.s- Sorry about the delay; just returned from a short vacation.
-- Ram
^ permalink raw reply
* Re: Branch names with slashes
From: Michael Haggerty @ 2011-12-14 12:52 UTC (permalink / raw)
To: Leonardo Kim; +Cc: git
In-Reply-To: <CAGcUY13TOodu1BO3DCoNnVvNZ9QkWAbD-RmyqQX6P1q6tcO+yg@mail.gmail.com>
On 12/14/2011 11:17 AM, Leonardo Kim wrote:
> Branch names can contain slashes, so we can use 'development/foo' as a
> branch name. If I choose 'development' as a branch name, it doesn't
> work. There is a directory named development at '.git/refs/heads'
> directory. So we cannot create a file named development for
> 'refs/heads/development'.
>
> An error message may occurs like below. Unfortunately, It is not of help to me.
> 'error: 'refs/heads/development/foo' exists; cannot create
> 'refs/heads/development'.
Assuming that the wording of the error message is not considered part of
the external API, it is trivial to change it. What do you suggest?
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* Re: [PATCH 1/2] set_ref_status_for_push(): use transport-flags abstraction
From: Thomas Adam @ 2011-12-14 10:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vsjkot5nc.fsf@alter.siamese.dyndns.org>
On 13 December 2011 23:26, Junio C Hamano <gitster@pobox.com> wrote:
> It does not make much sense to have separate "int" parameters to
> this function with two callsites (why do we need to to begin with?
This last bit should read:
"Why do we need two to begin with?"
Kindly,
-- Thomas Adam
^ permalink raw reply
* Re: [bug?] checkout -m doesn't work without a base version
From: Michael Schubert @ 2011-12-14 10:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Pete Harlan, git
In-Reply-To: <7vbormn8vk.fsf@alter.siamese.dyndns.org>
On 12/05/2011 07:58 PM, Junio C Hamano wrote:
> @@ -150,18 +155,27 @@ static int checkout_merged(int pos, struct checkout *state)
> int status;
> unsigned char sha1[20];
> mmbuffer_t result_buf;
> + unsigned char threeway[3][20];
> + unsigned mode;
> +
> + memset(threeway, 0, sizeof(threeway));
> + while (pos < active_nr) {
> + int stage;
> + stage = ce_stage(ce);
> + if (!stage || strcmp(path, ce->name))
> + break;
> + hashcpy(threeway[stage - 1], ce->sha1);
> + if (stage == 2)
> + mode = create_ce_mode(ce->ce_mode);
> + pos++;
> + ce = active_cache[pos];
> + }
> + if (is_null_sha1(threeway[1]) || is_null_sha1(threeway[2]))
> + return error(_("path '%s' does not have necessary versions"), path);
>
> - if (ce_stage(ce) != 1 ||
> - active_nr <= pos + 2 ||
> - strcmp(active_cache[pos+1]->name, path) ||
> - ce_stage(active_cache[pos+1]) != 2 ||
> - strcmp(active_cache[pos+2]->name, path) ||
> - ce_stage(active_cache[pos+2]) != 3)
> - return error(_("path '%s' does not have all 3 versions"), path);
> -
> - read_mmblob(&ancestor, active_cache[pos]->sha1);
> - read_mmblob(&ours, active_cache[pos+1]->sha1);
> - read_mmblob(&theirs, active_cache[pos+2]->sha1);
> + read_mmblob(&ancestor, threeway[0]);
> + read_mmblob(&ours, threeway[1]);
> + read_mmblob(&theirs, threeway[2]);
>
> /*
> * NEEDSWORK: re-create conflicts from merges with
> @@ -192,9 +206,7 @@ static int checkout_merged(int pos, struct checkout *state)
> if (write_sha1_file(result_buf.ptr, result_buf.size,
> blob_type, sha1))
> die(_("Unable to add merge result for '%s'"), path);
> - ce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),
> - sha1,
> - path, 2, 0);
> + ce = make_cache_entry(mode, sha1, path, 2, 0);
> if (!ce)
> die(_("make_cache_entry failed for path '%s'"), path);
> status = checkout_entry(ce, state, NULL);
gcc 4.6.2:
builtin/checkout.c: In function ‘cmd_checkout’:
builtin/checkout.c:210:5: warning: ‘mode’ may be used uninitialized in this function [-Wuninitialized]
builtin/checkout.c:160:11: note: ‘mode’ was declared here
^ permalink raw reply
* Branch names with slashes
From: Leonardo Kim @ 2011-12-14 10:17 UTC (permalink / raw)
To: git
Hi
Branch names can contain slashes, so we can use 'development/foo' as a
branch name. If I choose 'development' as a branch name, it doesn't
work. There is a directory named development at '.git/refs/heads'
directory. So we cannot create a file named development for
'refs/heads/development'.
An error message may occurs like below. Unfortunately, It is not of help to me.
'error: 'refs/heads/development/foo' exists; cannot create
'refs/heads/development'.
I think that dealing with a file system and an error message above is
not sufficient for a novice like me. I hope that it should be
improved.
Thanks for your response.
Leonardo YongUk KIM
^ permalink raw reply
* Re: [RFC/PATCH 0/7] some sequencer loose ends (Re: Fix revert --abort on Windows)
From: Jonathan Nieder @ 2011-12-14 9:57 UTC (permalink / raw)
To: Junio C Hamano
Cc: Johannes Sixt, Ramkumar Ramachandra, git, Christian Couder,
Martin von Zweigbergk, Jay Soffian
In-Reply-To: <7v39cp32av.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> I saw a few minor nits in the log messages but otherwise nothing
> objectionable jumped at me from my initial reading of the series.
I was tempted to send a reroll with slightly better log messages once
I could see your corrections, but it looks like the series has been
merged to "next" and your corrections already leave me happy enough.
Thanks for looking it over.
^ permalink raw reply
* Re: [PATCH] test: errors preparing for a test are not special
From: Jonathan Nieder @ 2011-12-14 9:00 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Joe Ratterman, git, Junio C Hamano, Jeff King
In-Reply-To: <4EE863AF.2070606@viscovery.net>
Johannes Sixt wrote:
> At any rate, your patch makes the code much more comprehensible.
Thanks for the reminder and sanity-check.
^ permalink raw reply
* Re: [PATCH] Gitweb: Avoid warnings when a repo does not have a valid HEAD
From: Jonathan Nieder @ 2011-12-14 8:53 UTC (permalink / raw)
To: Joe Ratterman; +Cc: git, Jakub Narebski
In-Reply-To: <1323815706-10560-1-git-send-email-jratt0@gmail.com>
(just cc-ing Jakub)
Joe Ratterman wrote:
> It is possible that the HEAD reference does not point to an existing
> branch. When viewing such a repository in gitweb, a message like this
> one was sent to the error log:
>
> gitweb.cgi: Use of uninitialized value in string eq at /usr/src/git/gitweb/gitweb.cgi line 5115.
>
> Signed-off-by: Joe Ratterman <jratt0@gmail.com>
> ---
> gitweb/gitweb.perl | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 4f0c3bd..5af06d6 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -5440,7 +5440,7 @@ sub git_heads_body {
> for (my $i = $from; $i <= $to; $i++) {
> my $entry = $headlist->[$i];
> my %ref = %$entry;
> - my $curr = $ref{'id'} eq $head;
> + my $curr = $head ? ($ref{'id'} eq $head) : 0;
> if ($alternate) {
> print "<tr class=\"dark\">\n";
> } else {
> --
> 1.7.7.1
>
>
^ permalink raw reply
* Re: [PATCH] test: errors preparing for a test are not special
From: Johannes Sixt @ 2011-12-14 8:51 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Joe Ratterman, git, Junio C Hamano, Jeff King
In-Reply-To: <20111214082203.GB13166@elie.hsd1.il.comcast.net>
Am 12/14/2011 9:22, schrieb Jonathan Nieder:
> Johannes Sixt wrote:
>> Am 12/13/2011 23:35, schrieb Joe Ratterman:
>
>>> test_expect_success TTY 'no pager with --no-pager' '
>>> rm -f paginated.out ||
>>> cleanup_fail &&
>>
>> What kind of bogosity do I see in the context of this hunk
> [...]
>> Wouldn't rm -f always succeed under normal circumstances, and then the
>> rest of the test would be skipped?
>
> No, && and || are left-associative.
<Facepalm/> You are right, of course, and I should have known better. (I
need more caffein.)
At any rate, your patch makes the code much more comprehensible.
-- Hannes
^ permalink raw reply
* Git difftool / mergetool on directory tree
From: Daniele Segato @ 2011-12-14 8:42 UTC (permalink / raw)
To: Git Mailing List
Hi,
many diff / merge tool around have the ability to compare a directory
tree (meld is one, but there are many).
Is there a way to start a difftool or a mergetool on a folder instead of
the single file?
It would be an handsome feature to git.
I googled a little before popping out this question and I only found
suggestion on how to open "many" file at once instead of opening them
serially but that's not the same thing not as powerful as directory
comparison.
Thanks,
Daniele
^ permalink raw reply
* [PATCH] test: errors preparing for a test are not special
From: Jonathan Nieder @ 2011-12-14 8:22 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Joe Ratterman, git, Junio C Hamano, Jeff King
In-Reply-To: <4EE853C0.20505@viscovery.net>
This script uses the following idiom to start each test in a known
good state:
test_expect_success 'some commands use a pager' '
rm -f paginated.out || cleanup_fail &&
test_terminal git log &&
test -e paginated.out
'
where "cleanup_fail" is a function that prints an error message and
errors out.
That is bogus on three levels:
- Cleanup commands like "rm -f" and "test_unconfig" are designed not
to fail, so this logic would never trip.
- If they were to malfunction anyway, it is not useful to set apart
cleanup commands as a special kind of failure with a special error
message. Whichever command fails, the next step is to investigate
which command that was, for example by running tests with
"prove -e 'sh -x'", and fix it.
- Relying on left-associativity of mixed &&/|| lists makes the code
somewhat cryptic.
The fix is simple: drop the "|| cleanup_fail" in each test and the
definition of the "cleanup_fail" function so no new callers can arise.
Reported-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Johannes Sixt wrote:
> Am 12/13/2011 23:35, schrieb Joe Ratterman:
>> test_expect_success TTY 'no pager with --no-pager' '
>> rm -f paginated.out ||
>> cleanup_fail &&
>
> What kind of bogosity do I see in the context of this hunk
[...]
> Wouldn't rm -f always succeed under normal circumstances, and then the
> rest of the test would be skipped?
No, && and || are left-associative.
That said, I think the || was a mistake. At the time, I had not yet
understood why some tests in other scripts had cleanup commands
outside the test body. I wrongly thought it was to make sure errors
during cleanup are not mistaken for errors in the test proper (rather
than to ensure cleanup happens when needed even if some tests are
skipped).
| 73 ++++++++++++-----------------------------------------
1 files changed, 17 insertions(+), 56 deletions(-)
--git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 320e1d1d..ff259084 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -6,11 +6,6 @@ test_description='Test automatic use of a pager.'
. "$TEST_DIRECTORY"/lib-pager.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
-cleanup_fail() {
- echo >&2 cleanup failed
- (exit 1)
-}
-
test_expect_success 'setup' '
sane_unset GIT_PAGER GIT_PAGER_IN_USE &&
test_unconfig core.pager &&
@@ -22,9 +17,7 @@ test_expect_success 'setup' '
'
test_expect_success TTY 'some commands use a pager' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
test_terminal git log &&
test -e paginated.out
'
@@ -45,49 +38,37 @@ test_expect_failure TTY 'pager runs from subdir' '
'
test_expect_success TTY 'some commands do not use a pager' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
test_terminal git rev-list HEAD &&
! test -e paginated.out
'
test_expect_success 'no pager when stdout is a pipe' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
git log | cat &&
! test -e paginated.out
'
test_expect_success 'no pager when stdout is a regular file' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
git log >file &&
! test -e paginated.out
'
test_expect_success TTY 'git --paginate rev-list uses a pager' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
test_terminal git --paginate rev-list HEAD &&
test -e paginated.out
'
test_expect_success 'no pager even with --paginate when stdout is a pipe' '
- rm -f file paginated.out ||
- cleanup_fail &&
-
+ rm -f file paginated.out &&
git --paginate log | cat &&
! test -e paginated.out
'
test_expect_success TTY 'no pager with --no-pager' '
- rm -f paginated.out ||
- cleanup_fail &&
-
+ rm -f paginated.out &&
test_terminal git --no-pager log &&
! test -e paginated.out
'
@@ -136,9 +117,7 @@ colorful() {
}
test_expect_success 'tests can detect color' '
- rm -f colorful.log colorless.log ||
- cleanup_fail &&
-
+ rm -f colorful.log colorless.log &&
git log --no-color >colorless.log &&
git log --color >colorful.log &&
! colorful colorless.log &&
@@ -147,18 +126,14 @@ test_expect_success 'tests can detect color' '
test_expect_success 'no color when stdout is a regular file' '
rm -f colorless.log &&
- test_config color.ui auto ||
- cleanup_fail &&
-
+ test_config color.ui auto &&
git log >colorless.log &&
! colorful colorless.log
'
test_expect_success TTY 'color when writing to a pager' '
rm -f paginated.out &&
- test_config color.ui auto ||
- cleanup_fail &&
-
+ test_config color.ui auto &&
(
TERM=vt100 &&
export TERM &&
@@ -181,9 +156,7 @@ test_expect_success TTY 'colors are suppressed by color.pager' '
test_expect_success 'color when writing to a file intended for a pager' '
rm -f colorful.log &&
- test_config color.ui auto ||
- cleanup_fail &&
-
+ test_config color.ui auto &&
(
TERM=vt100 &&
GIT_PAGER_IN_USE=true &&
@@ -242,9 +215,7 @@ test_default_pager() {
$test_expectation SIMPLEPAGER,TTY "$cmd - default pager is used by default" "
sane_unset PAGER GIT_PAGER &&
test_unconfig core.pager &&
- rm -f default_pager_used ||
- cleanup_fail &&
-
+ rm -f default_pager_used &&
cat >\$less <<-\EOF &&
#!/bin/sh
wc >default_pager_used
@@ -265,9 +236,7 @@ test_PAGER_overrides() {
$test_expectation TTY "$cmd - PAGER overrides default pager" "
sane_unset GIT_PAGER &&
test_unconfig core.pager &&
- rm -f PAGER_used ||
- cleanup_fail &&
-
+ rm -f PAGER_used &&
PAGER='wc >PAGER_used' &&
export PAGER &&
$full_command &&
@@ -292,9 +261,7 @@ test_core_pager() {
$test_expectation TTY "$cmd - repository-local core.pager setting $used_if_wanted" "
sane_unset GIT_PAGER &&
- rm -f core.pager_used ||
- cleanup_fail &&
-
+ rm -f core.pager_used &&
PAGER=wc &&
export PAGER &&
test_config core.pager 'wc >core.pager_used' &&
@@ -321,9 +288,7 @@ test_pager_subdir_helper() {
$test_expectation TTY "$cmd - core.pager $used_if_wanted from subdirectory" "
sane_unset GIT_PAGER &&
rm -f core.pager_used &&
- rm -fr sub ||
- cleanup_fail &&
-
+ rm -fr sub &&
PAGER=wc &&
stampname=\$(pwd)/core.pager_used &&
export PAGER stampname &&
@@ -341,9 +306,7 @@ test_GIT_PAGER_overrides() {
parse_args "$@"
$test_expectation TTY "$cmd - GIT_PAGER overrides core.pager" "
- rm -f GIT_PAGER_used ||
- cleanup_fail &&
-
+ rm -f GIT_PAGER_used &&
test_config core.pager wc &&
GIT_PAGER='wc >GIT_PAGER_used' &&
export GIT_PAGER &&
@@ -356,9 +319,7 @@ test_doesnt_paginate() {
parse_args "$@"
$test_expectation TTY "no pager for '$cmd'" "
- rm -f GIT_PAGER_used ||
- cleanup_fail &&
-
+ rm -f GIT_PAGER_used &&
GIT_PAGER='wc >GIT_PAGER_used' &&
export GIT_PAGER &&
$full_command &&
--
1.7.8
^ permalink raw reply related
* Re: [PATCH] Revert "http: don't always prompt for password"
From: Matthieu Moy @ 2011-12-14 8:20 UTC (permalink / raw)
To: Junio C Hamano
Cc: Jeff King, Stefan Naewe, Sebastian Schuberth, Eric, git, msysgit
In-Reply-To: <7vaa6wuqjt.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Jeff King <peff@peff.net> writes:
>
>> Doing (3) is obviously the easiest thing. And given the complexity of
>> the other two solutions, I think it makes sense to revert 986bbc08
>> (i.e., apply this patch), ship a working v1.7.8.1, and then look at
>> doing one of the other two solutions for v1.7.9.
>
> Or just let the "dumb HTTP" die.
>
> I thought push over DAV has long been dead; is anybody using it for real?
I am.
I'm working with people behind a firewall, hence HTTP is mandantory. My
lab has a webdav server, without Git installed on it. Being able to work
with this setup was one of the key feature of Git when I adopted it
(after a few years using GNU Arch the same way).
I could probably manage to convince my sysadmin to install Git on our
webserver, but I'd prefer if Git continues supporting my current setup.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: [PATCH] Add '-P' as a synonym for '--no-pager' in the git command
From: Johannes Sixt @ 2011-12-14 7:44 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Joe Ratterman, git
In-Reply-To: <1323815706-10560-2-git-send-email-jratt0@gmail.com>
Am 12/13/2011 23:35, schrieb Joe Ratterman:
> +test_expect_success TTY 'no pager with -P' '
> + rm -f paginated.out ||
> + cleanup_fail &&
> +
> + test_terminal git -P log &&
> + ! test -e paginated.out
> +'
> +
> test_expect_success TTY 'no pager with --no-pager' '
> rm -f paginated.out ||
> cleanup_fail &&
What kind of bogosity do I see in the context of this hunk (and in the new
text as well, but it is not entirely your fault, Joe, since you obviously
have only copied an existing test snippet)?
Wouldn't rm -f always succeed under normal circumstances, and then the
rest of the test would be skipped? This use of || was introduced by
fdf1bc48 (t7006: guard cleanup with test_expect_success).
-- Hannes
^ permalink raw reply
* Re: [PATCH resend] Do not create commits whose message contains NUL
From: Jeff King @ 2011-12-14 7:17 UTC (permalink / raw)
To: Miles Bader; +Cc: Nguyễn Thái Ngọc Duy, git
In-Reply-To: <buomxavwwtq.fsf@dhlpc061.dev.necel.com>
On Wed, Dec 14, 2011 at 02:23:29PM +0900, Miles Bader wrote:
> Jeff King <peff@peff.net> writes:
> > But maybe it would be nicer to say something like:
> >
> > error: your commit message contains NUL characters.
> > hint: This is often caused by using multibyte encodings such as
> > hint: UTF-16. Please check your editor settings.
>
> I think the error message with the hint is much better for users, but
> isn't the term "multibyte" a little misleading here? It seems like
> it's really _wide_ encodings that are generally the culprit.
Yeah, wide is probably a better term. I'm not sure it is rigorously
defined anywhere, but in general I think it refers to the set of
encodings that do not care about the embedding of 8-bit ascii bytes as
subsets.
-Peff
^ permalink raw reply
* tr/pty-all (Re: What's cooking in git.git (Dec 2011, #04; Tue, 13))
From: Jonathan Nieder @ 2011-12-14 7:09 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Thomas Rast, Jeff King,
Nguyễn Thái Ngọc Duy
In-Reply-To: <7vobvcrlve.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> * tr/pty-all (2011-12-12) 3 commits
> - t/lib-terminal: test test-terminal's sanity
> - test-terminal: set output terminals to raw mode
> - test-terminal: give the child an empty stdin TTY
>
> Will merge to 'next' after taking another look.
The middle commit looks good. The bottom commit could be improved as
discussed at [1], but I guess that can happen in-tree.
However, the top commit ("test test-terminal's sanity") still does not
seem right to me.
It makes the same test run three times. Probably I should send an
alternate patch to get that sanity-check to run once, but I am also
not convinced the sanity-check is needed at all --- wouldn't any test
that is relying on output from test_terminal act as a sanity check for
it already?
As an aside, I also still believe that running "git shortlog" without
explicitly passing "HEAD" when testing how it reacts to [core] pager
configuration was a bug and a distraction, hence the patch at [2]. Am
I the only one? I also find Jeff's patch [3] appealing.
Thanks,
Jonathan
[1] http://thread.gmane.org/gmane.comp.version-control.git/186923/focus=186944
[2] http://article.gmane.org/gmane.comp.version-control.git/186932
[3] http://article.gmane.org/gmane.comp.version-control.git/186936
^ permalink raw reply
* Re: [PATCH resend] Do not create commits whose message contains NUL
From: Miles Bader @ 2011-12-14 5:23 UTC (permalink / raw)
To: Jeff King; +Cc: Nguyễn Thái Ngọc Duy, git
In-Reply-To: <20111213175932.GA1663@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> But maybe it would be nicer to say something like:
>
> error: your commit message contains NUL characters.
> hint: This is often caused by using multibyte encodings such as
> hint: UTF-16. Please check your editor settings.
I think the error message with the hint is much better for users, but
isn't the term "multibyte" a little misleading here? It seems like
it's really _wide_ encodings that are generally the culprit.
[UTF-16 of course is particularly nasty in that it uses both units which
are wider than a byte ("wide"), _and_ multiple units per code-point....]
Thanks,
-Miles
--
Quack, n. A murderer without a license.
^ permalink raw reply
* Re: [PATCH 0/3] use constants for sideband communication channels
From: Junio C Hamano @ 2011-12-14 4:56 UTC (permalink / raw)
To: iheffner; +Cc: git, Jeff King, Dave Olszewski
In-Reply-To: <1323800931-37123-1-git-send-email-iheffner@gmail.com>
iheffner@gmail.com writes:
> In order to make more clear how the different channels in sidechannel.c
> are to be used, I'm proposing some macros/constants which can be used in
> place of the "magic numbers" that mean little or nothing to someone not
> familiar with the protocol.
I am not fundamentally opposed to the stated goal, but the posted patches
make the resulting code way too wide for comfortable reading. Can we use a
bit shorter symbols?
Perhaps a good way to start would be to first refrain from using these
symbols, but give a prominent comment near the API functions that are used
to send and receive sideband data to explain which band is used for what
purpose, which should be enough for people who are writing the code to
link with these functions.
^ permalink raw reply
* Re: Tracking file metadata in git -- fix metastore or enhance git?
From: johnnyutahh @ 2011-12-14 4:54 UTC (permalink / raw)
To: git
In-Reply-To: <20110418004550.GA2529@elie>
Following up on
http://git.661346.n2.nabble.com/Tracking-file-metadata-in-git-fix-metastore-or-enhance-git-td6251248.html
this discussion re: git file-metadata-management , posted this:
http://superuser.com/questions/367729/how-to-reuse-extend-etckeepers-metadata-engine-for-git-control-of-non-etc-file
Any further movement on this topic?
Jonathan Nieder-2 wrote
>
> Hi again,
>
> Not sure if my thoughts will be useful here since you dropped me from
> the cc list. But anyway:
>
> Richard Hartmann wrote:
>
>> here are the three options:
>>
>> 1) fix metastore
>> 2) default to gitperms
>> 3) extend git
>>
>> I still think 3) would be best, but someone would need to step up to
>> do this. Is anyone up for this task? If not, we will have to resort to
>> 1) or 2)
>
> The usual practice in git development is
>
> (1) people make scripts wrapping plumbing commands (see git(1)) that
> work well for themselves
> (2) they tell the git list about it and publish it
> (3) an idea emerges that this is suitable for inclusion, and it
> gets included
>
> In particular, git's design is not so monolithic --- "extend git" can
> mean "add a script" or "add a builtin" so it is not so involved as you
> seem to think. See also contrib/README for a place to stop on the
> way.
>
> Anyway, if you want something the just works, my suggestion is (4) use
> the hook scripts from etckeeper. Last time I looked into this they
> worked better than metastore.
>
> Hope that helps.
> Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@.kernel
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
View this message in context: http://git.661346.n2.nabble.com/Tracking-file-metadata-in-git-fix-metastore-or-enhance-git-tp6251248p7092383.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH v2 28/51] refs.c: rename ref_array -> ref_dir
From: Jeff King @ 2011-12-14 2:33 UTC (permalink / raw)
To: Junio C Hamano
Cc: Michael Haggerty, git, Drew Northup, Jakub Narebski, Heiko Voigt,
Johan Herland, Julian Phillips
In-Reply-To: <7vborct37c.fsf@alter.siamese.dyndns.org>
On Tue, Dec 13, 2011 at 04:19:19PM -0800, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> >> Namely, we should figure out what code wants to set extra refs and or
> >> wants to include extra refs in its iteration over references. The
> >> setters don't have to be changed, but the readers should be.
> >
> > You read me correctly. That is exactly what I meant by "extra ref API" in
> > my earlier response.
>
> Actually, I do not think it even needs to be the "extra *REF* API". The
> only thing that matters is that these commits are considered to be extra
> anchor point in the history, in addition to the usual rule of considering
> that everything reachable from our refs is complete. The data structure to
> hold them does not even have to be a "struct ref". Just an array of object
> names (or "struct object *") should suffice.
Since my cff38a5 (receive-pack: eliminate duplicate .have refs,
2011-05-19), receive-pack simply has a packed array of binary sha1s (in
a "struct sha1_array" object). That might be the simplest thing.
-Peff
^ permalink raw reply
* What's cooking in git.git (Dec 2011, #04; Tue, 13)
From: Junio C Hamano @ 2011-12-14 1:19 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' (proposed updates) while commits prefixed with '+' are in
'next'.
Here are the repositories that have my integration branches:
With maint, master, next, pu, todo:
git://git.kernel.org/pub/scm/git/git.git
git://repo.or.cz/alt-git.git
https://code.google.com/p/git-core/
https://github.com/git/git
With only maint and master:
git://git.sourceforge.jp/gitroot/git-core/git.git
git://git-core.git.sourceforge.net/gitroot/git-core/git-core
With all the topics and integration branches:
https://github.com/gitster/git
The preformatted documentation in HTML and man format are found in:
git://git.kernel.org/pub/scm/git/git-{htmldocs,manpages}.git/
git://repo.or.cz/git-{htmldocs,manpages}.git/
https://code.google.com/p/git-{htmldocs,manpages}.git/
https://github.com/gitster/git-{htmldocs,manpages}.git/
--------------------------------------------------
[New Topics]
* jk/maint-fetch-status-table (2011-12-09) 1 commit
(merged to 'next' on 2011-12-09 at 159415e)
+ fetch: create status table using strbuf
Will merge to 'master'.
* ci/stripspace-docs (2011-12-12) 1 commit
(merged to 'next' on 2011-12-13 at 35b2cdf)
+ Update documentation for stripspace
* jk/maint-mv (2011-12-12) 5 commits
(merged to 'next' on 2011-12-13 at 58caedb)
+ mv: be quiet about overwriting
+ mv: improve overwrite warning
+ mv: make non-directory destination error more clear
+ mv: honor --verbose flag
+ docs: mention "-k" for both forms of "git mv"
* jk/maint-snprintf-va-copy (2011-12-12) 1 commit
(merged to 'next' on 2011-12-13 at d37a7e1)
+ compat/snprintf: don't look at va_list twice
* jn/maint-sequencer-fixes (2011-12-12) 7 commits
(merged to 'next' on 2011-12-13 at 5b3950c)
+ revert: stop creating and removing sequencer-old directory
+ Revert "reset: Make reset remove the sequencer state"
+ revert: do not remove state until sequence is finished
+ revert: allow single-pick in the middle of cherry-pick sequence
+ revert: pass around rev-list args in already-parsed form
+ revert: allow cherry-pick --continue to commit before resuming
+ revert: give --continue handling its own function
* mh/ref-api (2011-12-12) 51 commits
- repack_without_ref(): call clear_packed_ref_cache()
- read_packed_refs(): keep track of the directory being worked in
- is_refname_available(): query only possibly-conflicting references
- refs: read loose references lazily
- read_loose_refs(): take a (ref_entry *) as argument
- struct ref_dir: store a reference to the enclosing ref_cache
- sort_ref_dir(): take (ref_entry *) instead of (ref_dir *)
- do_for_each_ref_in_dir*(): take (ref_entry *) instead of (ref_dir *)
- add_entry(): take (ref_entry *) instead of (ref_dir *)
- search_ref_dir(): take (ref_entry *) instead of (ref_dir *)
- find_containing_direntry(): use (ref_entry *) instead of (ref_dir *)
- add_ref(): take (ref_entry *) instead of (ref_dir *)
- read_packed_refs(): take (ref_entry *) instead of (ref_dir *)
- find_ref(): take (ref_entry *) instead of (ref_dir *)
- is_refname_available(): take (ref_entry *) instead of (ref_dir *)
- get_loose_refs(): return (ref_entry *) instead of (ref_dir *)
- get_packed_refs(): return (ref_entry *) instead of (ref_dir *)
- refs: wrap top-level ref_dirs in ref_entries
- get_ref_dir(): keep track of the current ref_dir
- do_for_each_ref(): only iterate over the subtree that was requested
- refs: sort ref_dirs lazily
- sort_ref_dir(): do not sort if already sorted
- refs: store references hierarchically
- refs.c: rename ref_array -> ref_dir
- struct ref_entry: nest the value part in a union
- check_refname_component(): return 0 for zero-length components
- free_ref_entry(): new function
- refs.c: reorder definitions more logically
- is_refname_available(): reimplement using do_for_each_ref_in_array()
- names_conflict(): simplify implementation
- names_conflict(): new function, extracted from is_refname_available()
- repack_without_ref(): reimplement using do_for_each_ref_in_array()
- do_for_each_ref_in_arrays(): new function
- do_for_each_ref_in_array(): new function
- do_for_each_ref(): correctly terminate while processesing extra_refs
- add_ref(): take a (struct ref_entry *) parameter
- create_ref_entry(): extract function from add_ref()
- repack_without_ref(): remove temporary
- resolve_gitlink_ref_recursive(): change to work with struct ref_cache
- Pass a (ref_cache *) to the resolve_gitlink_*() helper functions
- resolve_gitlink_ref(): improve docstring
- get_ref_dir(): change signature
- refs: change signatures of get_packed_refs() and get_loose_refs()
- is_dup_ref(): extract function from sort_ref_array()
- add_ref(): add docstring
- parse_ref_line(): add docstring
- is_refname_available(): remove the "quiet" argument
- clear_ref_array(): rename from free_ref_array()
- refs: rename parameters result -> sha1
- refs: rename "refname" variables
- struct ref_entry: document name member
* nd/resolve-ref (2011-12-13) 3 commits
(merged to 'next' on 2011-12-13 at c7002e9)
+ Rename resolve_ref() to resolve_ref_unsafe()
+ Convert resolve_ref+xstrdup to new resolve_refdup function
+ revert: convert resolve_ref() to read_ref_full()
* tr/grep-threading (2011-12-12) 3 commits
- grep: disable threading in non-worktree case
- grep: enable threading with -p and -W using lazy attribute lookup
- grep: load funcname patterns for -W
Will merge to 'next' after taking another look.
* tr/pty-all (2011-12-12) 3 commits
- t/lib-terminal: test test-terminal's sanity
- test-terminal: set output terminals to raw mode
- test-terminal: give the child an empty stdin TTY
Will merge to 'next' after taking another look.
* jc/push-ignore-stale (2011-12-13) 2 commits
- push: --ignore-stale option
- set_ref_status_for_push(): use transport-flags abstraction
* jk/fetch-no-tail-match-refs (2011-12-13) 4 commits
(merged to 'next' on 2011-12-13 at 805c018)
+ connect.c: drop path_match function
+ fetch-pack: match refs exactly
+ t5500: give fully-qualified refs to fetch-pack
+ drop "match" parameter from get_remote_heads
* jk/maint-push-over-dav (2011-12-13) 2 commits
(merged to 'next' on 2011-12-13 at 45e376c)
+ http-push: enable "proactive auth"
+ t5540: test DAV push with authentication
--------------------------------------------------
[Cooking]
* rr/revert-cherry-pick (2011-12-09) 9 commits
. revert: simplify communicating command-line arguments
. revert: report fine-grained error messages from insn parser
. revert: allow mixed pick and revert instructions
. t3510 (cherry-pick-sequencer): remove malformed sheet 2
. t3510 (cherry-pick-sequencer): use exit status
. revert: simplify getting commit subject in format_todo()
. revert: tolerate extra spaces, tabs in insn sheet
. revert: make commit subjects in insn sheet optional
. revert: free msg in format_todo()
Ejected for now, to give higher priority to jn/maint-sequencer-fixes
topic.
* ew/keepalive (2011-12-05) 1 commit
(merged to 'next' on 2011-12-13 at 1b5d5c4)
+ enable SO_KEEPALIVE for connected TCP sockets
* jc/checkout-m-twoway (2011-12-11) 2 commits
(merged to 'next' on 2011-12-11 at b61057f)
+ Test 'checkout -m -- path'
(merged to 'next' on 2011-12-09 at c946009)
+ checkout -m: no need to insist on having all 3 stages
* tr/cache-tree (2011-12-06) 5 commits
(merged to 'next' on 2011-12-13 at e0da64d)
+ reset: update cache-tree data when appropriate
+ commit: write cache-tree data when writing index anyway
+ Refactor cache_tree_update idiom from commit
+ Test the current state of the cache-tree optimization
+ Add test-scrap-cache-tree
* tr/userdiff-c-returns-pointer (2011-12-06) 1 commit
(merged to 'next' on 2011-12-09 at 0b6a092)
+ userdiff: allow * between cpp funcname words
Will merge to 'master'.
* jc/commit-amend-no-edit (2011-12-08) 5 commits
(merged to 'next' on 2011-12-09 at b9cfa4e)
+ test: commit --amend should honor --no-edit
+ commit: honour --no-edit
+ t7501 (commit): modernize style
+ test: remove a porcelain test that hard-codes commit names
+ test: add missing "&&" after echo command
* jl/submodule-status-failure-report (2011-12-08) 1 commit
(merged to 'next' on 2011-12-09 at 53eb3b3)
+ diff/status: print submodule path when looking for changes fails
Will merge to 'master'.
* ks/tag-cleanup (2011-12-09) 1 commit
(merged to 'next' on 2011-12-09 at cbea045)
+ git-tag: introduce --cleanup option
Will merge to 'master'.
* rr/test-chaining (2011-12-11) 7 commits
(merged to 'next' on 2011-12-13 at b08445e)
+ t3401: use test_commit in setup
+ t3401: modernize style
+ t3040 (subprojects-basic): fix '&&' chaining, modernize style
+ t1510 (worktree): fix '&&' chaining
+ t3030 (merge-recursive): use test_expect_code
+ test: fix '&&' chaining
+ t3200 (branch): fix '&&' chaining
* bc/maint-apply-check-no-patch (2011-12-05) 2 commits
(merged to 'next' on 2011-12-09 at fc780cd)
+ builtin/apply.c: report error on failure to recognize input
+ t/t4131-apply-fake-ancestor.sh: fix broken test
Will merge to 'master'.
* aw/rebase-i-stop-on-failure-to-amend (2011-11-30) 1 commit
(merged to 'next' on 2011-12-09 at a117e83)
+ rebase -i: interrupt rebase when "commit --amend" failed during "reword"
* jc/split-blob (2011-12-01) 6 commits
. WIP (streaming chunked)
- chunked-object: fallback checkout codepaths
- bulk-checkin: support chunked-object encoding
- bulk-checkin: allow the same data to be multiply hashed
- new representation types in the packstream
- varint-in-pack: refactor varint encoding/decoding
(this branch uses jc/stream-to-pack.)
Not ready. At least pack-objects and fsck need to learn the new encoding
for the series to be usable locally, and then index-pack/unpack-objects
needs to learn it to be used remotely.
* jh/fast-import-notes (2011-11-28) 3 commits
(merged to 'next' on 2011-12-09 at 2b01132)
+ fast-import: Fix incorrect fanout level when modifying existing notes refs
+ t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling
+ t9301: Fix testcase covering up a bug in fast-import's notes fanout handling
Will merge to 'master'.
* tj/maint-imap-send-remove-unused (2011-11-23) 2 commits
(merged to 'next' on 2011-12-09 at 877cc11)
+ Merge branch 'maint' into tj/imap-send-remove-unused
+ imap-send: Remove unused 'use_namespace' variable
Will merge to 'master'.
* cn/maint-lf-to-crlf-filter (2011-11-28) 1 commit
(merged to 'next' on 2011-12-09 at c374d14)
+ convert: track state in LF-to-CRLF filter
Will merge to 'master'.
* jn/branch-move-to-self (2011-11-28) 2 commits
(merged to 'next' on 2011-12-09 at 7d27260)
+ Allow checkout -B <current-branch> to update the current branch
+ branch: allow a no-op "branch -M <current-branch> HEAD"
Will merge to 'master'.
* jk/credentials (2011-12-12) 24 commits
- contrib: add credential helper for OS X Keychain
- Makefile: OS X has /dev/tty
- Makefile: linux has /dev/tty
- credential: use git_prompt instead of git_getpass
- prompt: use git_terminal_prompt
- add generic terminal prompt function
- refactor git_getpass into generic prompt function
- move git_getpass to its own source file
- imap-send: don't check return value of git_getpass
- imap-send: avoid buffer overflow
(merged to 'next' on 2011-12-12 at 7a6d658)
+ t: add test harness for external credential helpers
+ credentials: add "store" helper
+ strbuf: add strbuf_add*_urlencode
+ Makefile: unix sockets may not available on some platforms
+ credentials: add "cache" helper
+ docs: end-user documentation for the credential subsystem
+ credential: make relevance of http path configurable
+ credential: add credential.*.username
+ credential: apply helper config
+ http: use credential API to get passwords
+ credential: add function for parsing url components
+ introduce credentials API
+ t5550: fix typo
+ test-lib: add test_config_global variant
Looking good. Probably split the later part into its own topic and
merge the parts already in 'next' to 'master' soonish.
* nd/ignore-might-be-precious (2011-11-28) 2 commits
(merged to 'next' on 2011-12-09 at 1a94553)
+ checkout,merge: disallow overwriting ignored files with --no-overwrite-ignore
+ Merge branch 'nd/maint-ignore-exclude' into nd/ignore-might-be-precious
Will merge to 'master'.
* jk/upload-archive-use-start-command (2011-11-21) 1 commit
(merged to 'next' on 2011-12-09 at 88cb83a)
+ upload-archive: use start_command instead of fork
* jk/maint-1.6.2-upload-archive (2011-11-21) 1 commit
+ archive: don't let remote clients get unreachable commits
(this branch is used by jk/maint-upload-archive.)
* jk/maint-upload-archive (2011-11-21) 1 commit
(merged to 'next' on 2011-12-09 at 03deb16)
+ Merge branch 'jk/maint-1.6.2-upload-archive' into jk/maint-upload-archive
(this branch uses jk/maint-1.6.2-upload-archive.)
Will merge to 'master'.
* ab/enable-i18n (2011-12-05) 1 commit
(merged to 'next' on 2011-12-13 at 65af8cd)
+ i18n: add infrastructure for translating Git with gettext
* jc/signed-commit (2011-11-29) 5 commits
- gpg-interface: allow use of a custom GPG binary
- pretty: %G[?GS] placeholders
- test "commit -S" and "log --show-signature"
- log: --show-signature
- commit: teach --gpg-sign option
Not exactly urgent.
* jc/stream-to-pack (2011-12-01) 5 commits
(merged to 'next' on 2011-12-09 at d0fd605)
+ bulk-checkin: replace fast-import based implementation
+ csum-file: introduce sha1file_checkpoint
+ finish_tmp_packfile(): a helper function
+ create_tmp_packfile(): a helper function
+ write_pack_header(): a helper function
(this branch is used by jc/split-blob.)
Teaches "git add" to send large-ish blob data straight to a packfile.
This is a continuation to the "large file support" topic. The codepath to
move data from worktree to repository is made aware of streaming, just
like the checkout codepath that goes the other way, which was done in the
previous "large file support" topic in the 1.7.7 cycle.
* jn/gitweb-side-by-side-diff (2011-10-31) 8 commits
(merged to 'next' on 2011-12-09 at 7662e58)
+ gitweb: Add navigation to select side-by-side diff
+ gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"
+ t9500: Add basic sanity tests for side-by-side diff in gitweb
+ t9500: Add test for handling incomplete lines in diff by gitweb
+ gitweb: Give side-by-side diff extra CSS styling
+ gitweb: Add a feature to show side-by-side diff
+ gitweb: Extract formatting of diff chunk header
+ gitweb: Refactor diff body line classification
Replaces a series from Kato Kazuyoshi on the same topic.
Will merge to 'master'.
^ 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