* [PATCH] Makefile: Replace merge-file.h with merge-blobs.h in LIB_H
From: Ramsay Jones @ 2013-01-22 16:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
Commit fa2364ec ("Which merge_file() function do you mean?", 06-12-2012)
renamed the files merge-file.[ch] to merge-blobs.[ch], but forgot to
rename the header file in the definition of the LIB_H macro.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1b30d7b..a786d4c 100644
--- a/Makefile
+++ b/Makefile
@@ -649,7 +649,7 @@ LIB_H += list-objects.h
LIB_H += ll-merge.h
LIB_H += log-tree.h
LIB_H += mailmap.h
-LIB_H += merge-file.h
+LIB_H += merge-blobs.h
LIB_H += merge-recursive.h
LIB_H += mergesort.h
LIB_H += notes-cache.h
--
1.8.1
^ permalink raw reply related
* Re: Version 1.8.1 does not compile on Cygwin 1.7.14
From: Ramsay Jones @ 2013-01-22 18:31 UTC (permalink / raw)
To: Jonathan Nieder
Cc: Mark Levedahl, Alex Riesen, Junio C Hamano, Jason Pyeron, git,
Torsten Bögershausen, Stephen & Linda Smith, Eric Blake
In-Reply-To: <20130120101007.GD16339@elie.Belkin>
Jonathan Nieder wrote:
> Ramsay Jones wrote:
>
>> --- a/git-compat-util.h
>> +++ b/git-compat-util.h
>> @@ -85,12 +85,6 @@
>> #define _NETBSD_SOURCE 1
>> #define _SGI_SOURCE 1
>>
>> -#ifdef WIN32 /* Both MinGW and MSVC */
>> -#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
>> -#include <winsock2.h>
>> -#include <windows.h>
>> -#endif
>
> So, do I understand correctly that the above conditional should be
> something like
>
> #if defined(WIN32) && !defined(__CYGWIN__)
>
> to allow dropping the CYGWIN_V15_WIN32API setting?
Yes, replacing the git-compat-util.h hunk above with:
diff --git a/git-compat-util.h b/git-compat-util.h
index e5a4b74..a38ae8d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,7 +85,7 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
-#ifdef WIN32 /* Both MinGW and MSVC */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
#include <winsock2.h>
#include <windows.h>
will also compile on cygwin 1.5.x
> "defined(WIN32)" is used throughout git to mean "win32 and not
> cygwin", so if I understand correctly we would either need to do
Hmm ... I remember being *very* nervous of commit 435bdf8c ("Make
usage of windows.h lean and mean", 16-09-2009) exactly because it
makes the code (on cygwin) much more fragile with respect to header
include order. ;-)
As I have mentioned here before, the claim that "WIN32 is not defined
on cygwin" is simply nonsense - it depends on if/when certain header
files are included. For example, *as soon as* you include <windows.h>
(and, I suspect, many other win32 headers) then "defined(WIN32)"
is true.
Note that commit 380a4d92 ("Update cygwin.c for new mingw-64 win32 api
headers", 11-11-2012) swaps the include order for the win32.h and
git-compat-util.h header files. [I don't know the details, Mark didn't
elaborate, but it is clearly an include order problem on cygwin 1.7.x :-D ]
This causes compilation errors on cygwin 1.5.x, exactly because win32.h
includes <windows.h>, which defines WIN32, which then leads to
git-compat-util.h including <winsock2.h>.
> #if defined(WIN32) && defined(__CYGWIN__)
> # undef WIN32
> #endif
Hmm, except when you want it defined on cygwin, of course ... ;-)
> Thanks for investigating.
No problem.
I've included the updated patch below, just for completeness.
HTH
ATB,
Ramsay Jones
-- >8 --
Subject: [PATCH] cygwin: Remove the CYGWIN_V15_WIN32API config
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Makefile | 7 -------
compat/cygwin.c | 5 -----
config.mak.uname | 1 -
git-compat-util.h | 2 +-
4 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index 1b30d7b..1c84f68 100644
--- a/Makefile
+++ b/Makefile
@@ -281,10 +281,6 @@ all::
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
#
-# Define CYGWIN_V15_WIN32API if you are using Cygwin v1.7.x but are not
-# using the current w32api packages. The recommended approach, however,
-# is to update your installation if compilation errors occur.
-#
# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
# user.
#
@@ -1402,9 +1398,6 @@ ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
-ifdef CYGWIN_V15_WIN32API
- COMPAT_CFLAGS += -DCYGWIN_V15_WIN32API
-endif
ifdef USE_NED_ALLOCATOR
COMPAT_CFLAGS += -Icompat/nedmalloc
diff --git a/compat/cygwin.c b/compat/cygwin.c
index 5428858..0a9aa6d 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -1,13 +1,8 @@
#define WIN32_LEAN_AND_MEAN
-#ifdef CYGWIN_V15_WIN32API
-#include "../git-compat-util.h"
-#include "win32.h"
-#else
#include <sys/stat.h>
#include <sys/errno.h>
#include "win32.h"
#include "../git-compat-util.h"
-#endif
#include "../cache.h" /* to read configuration */
static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
diff --git a/config.mak.uname b/config.mak.uname
index bea34f0..5e493c9 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -158,7 +158,6 @@ ifeq ($(uname_O),Cygwin)
NO_SYMLINK_HEAD = YesPlease
NO_IPV6 = YesPlease
OLD_ICONV = UnfortunatelyYes
- CYGWIN_V15_WIN32API = YesPlease
endif
NO_THREAD_SAFE_PREAD = YesPlease
NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index e5a4b74..a38ae8d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,7 +85,7 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
-#ifdef WIN32 /* Both MinGW and MSVC */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
#include <winsock2.h>
#include <windows.h>
--
1.8.1
^ permalink raw reply related
* Re: [msysGit] Re: Version 1.8.1 does not compile on Cygwin 1.7.14
From: Ramsay Jones @ 2013-01-22 18:38 UTC (permalink / raw)
To: Torsten Bögershausen
Cc: Jonathan Nieder, Mark Levedahl, Alex Riesen, Junio C Hamano,
Jason Pyeron, git, Stephen & Linda Smith, Eric Blake, msysGit
In-Reply-To: <50FCD017.6060607@web.de>
Torsten Bögershausen wrote:
> On 20.01.13 12:06, Jonathan Nieder wrote:
>> Torsten Bögershausen wrote:
>>
>>> I wonder, if if we can go one step further:
>>>
>>> Replace
>>> #ifdef WIN32 /* Both MinGW and MSVC */
>> [...]
>>> with
>>> #if defined(_MSC_VER)
>>
>> I thought Git for Windows was built using mingw, which doesn't define
>> _MSC_VER?
>>
>> Puzzled,
>> Jonathan
>>
> Yes,
> After removing these lines in the git-compat-util.h of msysgit
> v1.8.1 it still compiled.
> So I start to speculate if the comment is still valid for mingw,
> or if that was true in the old days and not now any more.
>
> More investigation is needed, sorry for confusion.
Yes, I compiled the last patch on MinGW before I sent it to the list.
I didn't bother with MSVC, since that build is already broken.
I have a patch which fixed the MSVC build, but it already needs to
be updated, since current master fails to build on MSVC.
ATB,
Ramsay Jones
^ permalink raw reply
* Re: [PATCH] Makefile: Replace merge-file.h with merge-blobs.h in LIB_H
From: Junio C Hamano @ 2013-01-22 18:48 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Git Mailing-list
In-Reply-To: <50FEC2B3.3010000@ramsay1.demon.co.uk>
Thanks.
^ permalink raw reply
* Re: Build broken for contrib/remote-helpers...
From: Jeff King @ 2013-01-22 19:41 UTC (permalink / raw)
To: John Szakmeister; +Cc: Felipe Contreras, git
In-Reply-To: <CAEBDL5U+Yrny-YgN1fZj1T+XTJRVaiFvMixT13Zzb2DhhYgQsA@mail.gmail.com>
On Tue, Jan 22, 2013 at 12:49:31AM -0500, John Szakmeister wrote:
> I tried running make in contrib/remote-helpers and it died with:
>
> :: make
> make -e -C ../../t test
> rm -f -r test-results
> duplicate test numbers: /Users/jszakmeister/sources/git
> make[1]: *** [test-lint-duplicates] Error 1
> make: *** [test] Error 2
>
> The path shown is not quite correct. I have the sources extracted to
> /Users/jszakmeister/sources/git-1.8.1.1. It appears that the Makefile
> in contrib/remote-helpers is exporting T, which is causing the
> duplicate test detection to fail.
It has to set T, because that is how t/Makefile knows what the set of
tests is. The problem is that test-lint-duplicates does not understand
absolute pathnames, as its regex is too simplistic:
sed 's/-.*//' | sort | uniq -d
So it finds whatever is before the first "-", which would be the test
number in "t0000-basic.sh" or similar, and then looks for duplicates.
We can make the regex more strict to handle full paths, like:
perl -lne 'print $1 if m{(?:^|/)(t\d{4})-}'
but that still would not help, as the tests in remote-helpers do not
follow the tXXXX convention. So I think even running
test-lint-duplicates on them is nonsensical.
Maybe something like this would be more appropriate, though it kills off
all test-lint checks, not just test-lint-duplicates:
diff --git a/contrib/remote-helpers/Makefile b/contrib/remote-helpers/Makefile
index 9a76575..9c18ed8 100644
--- a/contrib/remote-helpers/Makefile
+++ b/contrib/remote-helpers/Makefile
@@ -3,6 +3,7 @@ export PATH := $(CURDIR):$(PATH)
export T := $(addprefix $(CURDIR)/,$(TESTS))
export MAKE := $(MAKE) -e
export PATH := $(CURDIR):$(PATH)
+export TEST_LINT :=
test:
$(MAKE) -C ../../t $@
^ permalink raw reply related
* Re: [PATCH v2] unpack-trees: do not abort when overwriting an existing file with the same content
From: Jeff King @ 2013-01-22 20:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Duy Nguyen, git
In-Reply-To: <7vwqv6c7oe.fsf@alter.siamese.dyndns.org>
On Mon, Jan 21, 2013 at 05:45:05PM -0800, Junio C Hamano wrote:
> Duy Nguyen <pclouds@gmail.com> writes:
>
> > On Tue, Jan 22, 2013 at 6:15 AM, Jeff King <peff@peff.net> wrote:
> >> Can you elaborate on when this code is triggered?
> >>
> >> In the general case, shouldn't we already know the sha1 of what's on
> >> disk in the index, and be able to just compare the hashes? And if we
> >> don't, because the entry is start-dirty, should we be updating it
> >> (possibly earlier, so we do not even get into the "need to write" code
> >> path) instead of doing this ad-hoc byte comparison?
>
> If the index knows what is in the working tree, I think I agree.
Right. I was wondering why it didn't (and if it doesn't, why we are not
saving the information there).
But I think I was letting my inaccurate mental model of the index get in
the way. I tend to think of the stat information as "if the file matches
this stat info, then it has sha1 X". But that is not true. The sha1 we
store is the actual index entry, and if it does not match what is in the
working tree, we do not know or store the sha1 of what is in the working
tree. We cannot just "refresh" that value and compare it, which is what
I was implying.
So I think I was just confused. That is what I get for not actually
doing low-level index stuff enough.
> > git reset HEAD~10
> > # blah that was a mistake, undo it
> > git checkout HEAD@{1}
It seems like
git reset HEAD@{1}
would be the correct undo, as the original never touched the working
tree.
-Peff
^ permalink raw reply
* Re: [PATCH v3] Enable minimal stat checking
From: Robin Rosenberg @ 2013-01-22 20:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, j sixt, Shawn Pearce
In-Reply-To: <7va9s19lrb.fsf@alter.siamese.dyndns.org>
----- Ursprungligt meddelande -----
> Also, even though we settled on "default/minimal", we may regret in
> the future if old implementations died on an unrecognized value, as
> that will forbid users from using an old Git and a new Git on the
> same repository at the same time, so I'd suggest removing the "if
> not default or minimal, die" and replacing it with "treat unknown
> token as a do-no-harm no-op".
I decided on error after looking at how other configuration errors
are handled, but I can change, though I personally prefer to get
configuration mistakes thrown in my face so I know.
-- robin
^ permalink raw reply
* Re: Build broken for contrib/remote-helpers...
From: Torsten Bögershausen @ 2013-01-22 20:55 UTC (permalink / raw)
To: Jeff King; +Cc: John Szakmeister, Felipe Contreras, git
In-Reply-To: <20130122194135.GA23521@sigill.intra.peff.net>
On 22.01.13 20:41, Jeff King wrote:
> On Tue, Jan 22, 2013 at 12:49:31AM -0500, John Szakmeister wrote:
>
>> I tried running make in contrib/remote-helpers and it died with:
>>
>> :: make
>> make -e -C ../../t test
>> rm -f -r test-results
>> duplicate test numbers: /Users/jszakmeister/sources/git
>> make[1]: *** [test-lint-duplicates] Error 1
>> make: *** [test] Error 2
>>
>> The path shown is not quite correct. I have the sources extracted to
>> /Users/jszakmeister/sources/git-1.8.1.1. It appears that the Makefile
>> in contrib/remote-helpers is exporting T, which is causing the
>> duplicate test detection to fail.
>
> It has to set T, because that is how t/Makefile knows what the set of
> tests is. The problem is that test-lint-duplicates does not understand
> absolute pathnames, as its regex is too simplistic:
>
> sed 's/-.*//' | sort | uniq -d
>
> So it finds whatever is before the first "-", which would be the test
> number in "t0000-basic.sh" or similar, and then looks for duplicates.
would it help to filter for numbered tests before sorting like this:
sed 's/-.*//' | grep "[0-9][0-9][0-9][0-9]"| sort | uniq -d
^ permalink raw reply
* [PATCH] all: new command used for multi-repo operations
From: Lars Hjemli @ 2013-01-22 21:10 UTC (permalink / raw)
To: git; +Cc: Lars Hjemli
When working with multiple, unrelated (or loosly related) git repos,
there is often a need to locate all repos with uncommitted work and
perform some action on them (say, commit and push). Before this patch,
such tasks would require manually visiting all repositories, running
`git status` within each one and then decide what to do next.
This mundane task can now be automated by e.g. `git all --dirty status`,
which will find all git repositories below the current directory (even
nested ones), check if they are dirty (as defined by `git diff --quiet &&
git diff --cached --quiet`), and for each dirty repo print the path to the
repo and then execute `git status` within the repo.
The command also honours the option '--clean' which restricts the set of
repos to those which '--dirty' would skip.
Finally, the command to execute within each repo is optional. If none is
given, git-all will just print the path to each repo found.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
Documentation/git-all.txt | 37 ++++++++++++++++
Makefile | 1 +
builtin.h | 1 +
builtin/all.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++
command-list.txt | 1 +
git.c | 1 +
t/t0064-all.sh | 42 +++++++++++++++++++
7 files changed, 188 insertions(+)
create mode 100644 Documentation/git-all.txt
create mode 100644 builtin/all.c
create mode 100755 t/t0064-all.sh
diff --git a/Documentation/git-all.txt b/Documentation/git-all.txt
new file mode 100644
index 0000000..b25f23c
--- /dev/null
+++ b/Documentation/git-all.txt
@@ -0,0 +1,37 @@
+git-all(1)
+==========
+
+NAME
+----
+git-all - Execute a git command in multiple repositories
+
+SYNOPSIS
+--------
+[verse]
+'git all' [--dirty|--clean] [command]
+
+DESCRIPTION
+-----------
+The git-all command is used to locate all git repositoris within the
+current directory tree, and optionally execute a git command in each
+of the found repos.
+
+OPTIONS
+-------
+-c::
+--clean::
+ Only include repositories with a clean worktree.
+
+-d::
+--dirty::
+ Only include repositories with a dirty worktree.
+
+NOTES
+-----
+
+For the purpose of `git-all`, a dirty worktree is defined as a worktree
+with uncommitted changes.
+
+GIT
+---
+Part of the linkgit:git[1] suite
diff --git a/Makefile b/Makefile
index 1b30d7b..8bf0583 100644
--- a/Makefile
+++ b/Makefile
@@ -840,6 +840,7 @@ LIB_OBJS += xdiff-interface.o
LIB_OBJS += zlib.o
BUILTIN_OBJS += builtin/add.o
+BUILTIN_OBJS += builtin/all.o
BUILTIN_OBJS += builtin/annotate.o
BUILTIN_OBJS += builtin/apply.o
BUILTIN_OBJS += builtin/archive.o
diff --git a/builtin.h b/builtin.h
index 7e7bbd6..438c265 100644
--- a/builtin.h
+++ b/builtin.h
@@ -41,6 +41,7 @@ void finish_copy_notes_for_rewrite(struct notes_rewrite_cfg *c);
extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, int sha1_valid, char **buf, unsigned long *buf_size);
extern int cmd_add(int argc, const char **argv, const char *prefix);
+extern int cmd_all(int argc, const char **argv, const char *prefix);
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
extern int cmd_apply(int argc, const char **argv, const char *prefix);
extern int cmd_archive(int argc, const char **argv, const char *prefix);
diff --git a/builtin/all.c b/builtin/all.c
new file mode 100644
index 0000000..ee9270d
--- /dev/null
+++ b/builtin/all.c
@@ -0,0 +1,105 @@
+/*
+ * "git all" builtin command.
+ *
+ * Copyright (c) 2013 Lars Hjemli <hjemli@gmail.com>
+ */
+#include "cache.h"
+#include "color.h"
+#include "builtin.h"
+#include "run-command.h"
+#include "parse-options.h"
+
+static int only_dirty;
+static int only_clean;
+char root[PATH_MAX];
+
+static const char * const builtin_all_usage[] = {
+ N_("git all [options] [cmd]"),
+ NULL
+};
+
+static struct option builtin_all_options[] = {
+ OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
+ OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
+ OPT_END(),
+};
+
+static int is_dirty()
+{
+ const char *diffidx[] = {"diff", "--quiet", "--cached", NULL};
+ const char *diffwd[] = {"diff", "--quiet", NULL};
+
+ if (run_command_v_opt(diffidx, RUN_GIT_CMD) != 0)
+ return 1;
+ if (run_command_v_opt(diffwd, RUN_GIT_CMD) != 0)
+ return 1;
+ return 0;
+}
+
+static void handle_repo(char *path, const char **argv)
+{
+ int dirty;
+
+ if (path[0] == '.' && path[1] == '/')
+ path += 2;
+ if (only_dirty || only_clean) {
+ dirty = is_dirty();
+ if ((dirty && only_clean) ||
+ (!dirty && only_dirty))
+ return;
+ }
+ if (*argv) {
+ color_fprintf_ln(stdout, GIT_COLOR_YELLOW, "[%s]", path);
+ run_command_v_opt(argv, RUN_GIT_CMD);
+ } else
+ printf("%s\n", path);
+}
+
+static int walk(struct strbuf *path, int argc, const char **argv)
+{
+ DIR *dir;
+ struct dirent *ent;
+ size_t len;
+
+ dir = opendir(path->buf);
+ if (!dir)
+ return errno;
+ strbuf_addstr(path, "/");
+ len = path->len;
+ while ((ent = readdir(dir))) {
+ if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
+ continue;
+ if (!strcmp(ent->d_name, ".git")) {
+ strbuf_setlen(path, len - 1);
+ chdir(path->buf);
+ handle_repo(path->buf, argv);
+ chdir(root);
+ strbuf_addstr(path, "/");
+ continue;
+ }
+ if (ent->d_type != DT_DIR)
+ continue;
+ strbuf_setlen(path, len);
+ strbuf_addstr(path, ent->d_name);
+ walk(path, argc, argv);
+ }
+ closedir(dir);
+ return 0;
+}
+
+int cmd_all(int argc, const char **argv, const char *prefix)
+{
+ struct strbuf path = STRBUF_INIT;
+
+ if (!getcwd(root, sizeof(root)))
+ return 1;
+
+ argc = parse_options(argc, argv, prefix, builtin_all_options,
+ builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
+
+ unsetenv(GIT_DIR_ENVIRONMENT);
+ unsetenv(GIT_WORK_TREE_ENVIRONMENT);
+
+ strbuf_addstr(&path, ".");
+ return walk(&path, argc, argv);
+}
diff --git a/command-list.txt b/command-list.txt
index 7e8cfec..f955895 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -1,6 +1,7 @@
# List of known git commands.
# command name category [deprecated] [common]
git-add mainporcelain common
+git-all mainporcelain
git-am mainporcelain
git-annotate ancillaryinterrogators
git-apply plumbingmanipulators
diff --git a/git.c b/git.c
index ed66c66..53fd963 100644
--- a/git.c
+++ b/git.c
@@ -304,6 +304,7 @@ static void handle_internal_command(int argc, const char **argv)
const char *cmd = argv[0];
static struct cmd_struct commands[] = {
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
+ { "all", cmd_all },
{ "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive },
diff --git a/t/t0064-all.sh b/t/t0064-all.sh
new file mode 100755
index 0000000..932e374
--- /dev/null
+++ b/t/t0064-all.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Copyright (c) 2013 Lars Hjemli
+#
+
+test_description='Test the git-all command'
+
+. ./test-lib.sh
+
+test_expect_success "setup" '
+ test_create_repo clean &&
+ (cd clean && test_commit foo) &&
+ test_create_repo dirty-wt &&
+ (cd dirty-wt && test_commit foo && rm foo.t) &&
+ test_create_repo dirty-idx &&
+ (cd dirty-idx && test_commit foo && git rm foo.t)
+'
+
+test_expect_success "without flags, all repos are included" '
+ echo "." >expect &&
+ echo "clean" >>expect &&
+ echo "dirty-idx" >>expect &&
+ echo "dirty-wt" >>expect &&
+ git all | sort >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "--dirty only includes dirty repos" '
+ echo "dirty-idx" >expect &&
+ echo "dirty-wt" >>expect &&
+ git all --dirty | sort >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success "--clean only includes clean repos" '
+ echo "." >expect &&
+ echo "clean" >>expect &&
+ git all --clean | sort >actual &&
+ test_cmp expect actual
+'
+
+test_done
--
1.8.1.1.296.g725455c
^ permalink raw reply related
* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-22 21:31 UTC (permalink / raw)
To: Thomas Rast
Cc: Brian J. Murrell, git, kusmabite, Pyeron, Jason J CTR (US),
Maxime Boissonneault, Philippe Vaucher, Sébastien Boisvert
In-Reply-To: <87r4lejpx8.fsf@pctrast.inf.ethz.ch>
So, hum, do we have some sort of conclusion?
Shall it be a fix for git to get around that lustre "behavior"?
If something can be done in git it would be great: it is a *lot* easier
to change git than the lustre filesystem software for a cluster in
running in production mode... (words from cluster team) :-/
I hope this subject will not die in the list... :-/
Thanks,
Eric
On 01/21/2013 02:29 PM, Thomas Rast wrote:
> Please don't drop the Cc list!
>
> "Brian J. Murrell" <brian@interlinx.bc.ca> writes:
>
>>> What's odd is that while I cannot reproduce the original problem, there
>>> seems to be another issue/bug with utime():
>>
>> I wonder if this is related to http://jira.whamcloud.com/browse/LU-305.
>> That was reported as fixed in Lustre 2.0.0 and 2.1.0 but I thought I
>> saw it on 2.1.1 and added a comment to the above ticket about that.
>
> Aha, that's a very interesting bug report. My observations support
> yours: I managed to get EINTR during utime().
>
>>> In the absence of it, wouldn't we in theory have to write a simple
>>> loop-on-EINTR wrapper for *all* syscalls?
>>
>> IIUC, that's what SA_RESTART is all about.
>
> Yes, but there's precious little clear language on when SA_RESTART is
> supposed to act. In all cases?
>
> The wording on
>
> http://www.delorie.com/gnu/docs/glibc/libc_485.html
> http://www.delorie.com/gnu/docs/glibc/libc_498.html
>
> leads me to believe that SA_RESTART is actually used on the glibc side
> of things, so that any glibc syscall wrapper not specifically equipped
> with the restarting behavior would return EINTR unmodified. This might
> explain why utime() doesn't restart like it should (assuming we work on
> the theory that POSIX doesn't allow an EINTR from utime() to begin
> with).
>
^ permalink raw reply
* Re: [PATCH v3 01/10] wildmatch: fix "**" special case
From: Junio C Hamano @ 2013-01-22 21:36 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <1357008251-10014-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> "**" is adjusted to only be effective when surrounded by slashes, in
> 40bbee0 (wildmatch: adjust "**" behavior - 2012-10-15). Except that
> the commit did it wrong:
>
> 1. when it checks for "the preceding slash unless ** is at the
> beginning", it compares to wrong pointer. It should have compared
> to the beginning of the pattern, not the text.
So should
git ls-files '**/Makefile'
list the Makefile at the top-level of the repository (I think it
should)?
But that does not seem to be working.
I think the callpath goes like this:
match_pathspec()
-> match_one()
-> fnmatch_icase()
-> fnmatch()
-> wildmatch()
and the problem is that the fnmatch_icase() call made by match_one()
always passes 0 as the value for flags. Without WM_PATHNAME,
however, the underlying dowild() does not honor the "**/" magic.
We obviously do not want to set FNM_PATHNAME when we are not
substituting fnmatch() with wildmatch(), but I wonder if it may make
sense to unconditionally use WM_PATHNAME semantics when we build the
system with USE_WILDMATCH and calling wildmatch() in this codepath.
Users can always use "*/**/*" in place of "*" in their patterns
where they want to ignore directory boundaries.
^ permalink raw reply
* Re: [PATCH] all: new command used for multi-repo operations
From: Junio C Hamano @ 2013-01-22 22:01 UTC (permalink / raw)
To: Lars Hjemli; +Cc: git
In-Reply-To: <1358889019-4554-1-git-send-email-hjemli@gmail.com>
Lars Hjemli <hjemli@gmail.com> writes:
> diff --git a/builtin/all.c b/builtin/all.c
> new file mode 100644
> index 0000000..ee9270d
> --- /dev/null
> +++ b/builtin/all.c
> @@ -0,0 +1,105 @@
> +/*
> + * "git all" builtin command.
> + *
> + * Copyright (c) 2013 Lars Hjemli <hjemli@gmail.com>
> + */
> +#include "cache.h"
> +#include "color.h"
> +#include "builtin.h"
> +#include "run-command.h"
> +#include "parse-options.h"
> +
> +static int only_dirty;
> +static int only_clean;
> +char root[PATH_MAX];
> +
> +static const char * const builtin_all_usage[] = {
> + N_("git all [options] [cmd]"),
> + NULL
> +};
> +
> +static struct option builtin_all_options[] = {
> + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
> + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
> + OPT_END(),
> +};
Shouldn't this be more like OPT_SET_INT() on a same variable that is
initialized to "all"? Alternatively you could validate the input
and die when both are given.
> +int cmd_all(int argc, const char **argv, const char *prefix)
> +{
> + struct strbuf path = STRBUF_INIT;
> +
> + if (!getcwd(root, sizeof(root)))
> + return 1;
> +
> + argc = parse_options(argc, argv, prefix, builtin_all_options,
> + builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
> +
> + unsetenv(GIT_DIR_ENVIRONMENT);
> + unsetenv(GIT_WORK_TREE_ENVIRONMENT);
Don't you need to clear other variables whose uses are closely tied
to a single repository, like GIT_INDEX_FILE, etc.?
I suspect that explicitly exporting GIT_DIR and GIT_WORK_TREE (and
nothing else) in handle_repo() to the location you discovered before
you run the per-repository command via run_command_v_opt(), might be
a better alternative. The user could be sharing objects in all
repositories by permanently setting GIT_OBJECT_DIRECTORY to a single
place.
> diff --git a/command-list.txt b/command-list.txt
> index 7e8cfec..f955895 100644
> --- a/command-list.txt
> +++ b/command-list.txt
> @@ -1,6 +1,7 @@
> # List of known git commands.
> # command name category [deprecated] [common]
> git-add mainporcelain common
> +git-all mainporcelain
> git-am mainporcelain
> git-annotate ancillaryinterrogators
> git-apply plumbingmanipulators
I am not very interested in this topic in the first place, but this
does not (at least not yet) sound like a main Porcelain to me.
"all" may be a word other people may want to use to call collections
of things other than "Git repositories", and that use may turn out
to be more useful in general. A name that makes it clear that this
is about "repositories", i.e. along the lines of "git for-each-repo"
or something, would be a better name that does not squat on such a
short and sweet name.
^ permalink raw reply
* Re: GIT get corrupted on lustre
From: Junio C Hamano @ 2013-01-22 22:03 UTC (permalink / raw)
To: Eric Chamberland
Cc: Thomas Rast, Brian J. Murrell, git, kusmabite,
Pyeron, Jason J CTR (US), Maxime Boissonneault, Philippe Vaucher,
Sébastien Boisvert
In-Reply-To: <50FF051D.5090804@giref.ulaval.ca>
Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:
> So, hum, do we have some sort of conclusion?
>
> Shall it be a fix for git to get around that lustre "behavior"?
>
> If something can be done in git it would be great: it is a *lot*
> easier to change git than the lustre filesystem software for a cluster
> in running in production mode... (words from cluster team) :-/
Do we know the real cause of the symptom? I did not follow the
thread carefully, but the impression I was getting was that the
filesystem is broken around EINTR, and even if you "fix"ed Git,
your other more mission critical applications will be broken by
the same filesystem behaviour, no?
^ permalink raw reply
* Re: GIT get corrupted on lustre
From: Thomas Rast @ 2013-01-22 22:14 UTC (permalink / raw)
To: Eric Chamberland
Cc: Brian J. Murrell, git, kusmabite, Pyeron, Jason J CTR (US),
Maxime Boissonneault, Philippe Vaucher, Sébastien Boisvert
In-Reply-To: <50FF051D.5090804@giref.ulaval.ca>
Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:
> So, hum, do we have some sort of conclusion?
>
> Shall it be a fix for git to get around that lustre "behavior"?
>
> If something can be done in git it would be great: it is a *lot*
> easier to change git than the lustre filesystem software for a cluster
> in running in production mode... (words from cluster team) :-/
I thought you already established that simply disabling the progress
display is a sufficient workaround? If that doesn't help, you can try
patching out all use of SIGALRM within git.
Other than that I agree with Junio, from what we've seen so far, Lustre
returns EINTR on all sorts of calls that simply aren't allowed to do so.
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply
* Re: Build broken for contrib/remote-helpers...
From: Junio C Hamano @ 2013-01-22 22:22 UTC (permalink / raw)
To: Torsten Bögershausen
Cc: Jeff King, John Szakmeister, Felipe Contreras, git
In-Reply-To: <50FEFCD7.2060402@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
>> So it finds whatever is before the first "-", which would be the test
>> number in "t0000-basic.sh" or similar, and then looks for duplicates.
>
> would it help to filter for numbered tests before sorting like this:
>
> sed 's/-.*//' | grep "[0-9][0-9][0-9][0-9]"| sort | uniq -d
If you are using sed you do not need grep. Just do that in a single
process, perhaps like
sed -ne 's|\(.*/\)*t\([0-9][0-9][0-9][0-9]\)-.*|\2|p'
But more importantly, what do we want "duplicate numbers" sanity
check to mean in this context? Is this other directory allowed to
have a numbered test that shares the same number as the main test
suite? Is uniqueness inside the contrib/remote-helpers/ directory
sufficient?
Do we envision that perhaps someday the contrib material becomes
mature enough and will want to migrate to the main part of the tree?
If that is the case, perhaps should the check complain that these
tests are not numbered, instead of ignoring?
^ permalink raw reply
* What's cooking in git.git (Jan 2013, #08; Tue, 22)
From: Junio C Hamano @ 2013-01-22 22:44 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'.
As usual, this cycle is expected to last for 8 to 10 weeks, with a
preview -rc0 sometime in the middle of next month.
You can find the changes described here in the integration branches of the
repositories listed at
http://git-blame.blogspot.com/p/git-public-repositories.html
--------------------------------------------------
[New Topics]
* bc/fix-array-syntax-for-3.0-in-completion-bash (2013-01-18) 1 commit
- git-completion.bash: replace zsh notation that breaks bash 3.X
Fix use of an array notation that older versions of bash do not
understand.
Will merge to 'next'.
* jc/help (2013-01-18) 1 commit
- help: include <common-cmds.h> only in one file
A header file that has the definition of a static array was
included in two places, wasting the space.
Will merge to 'next'.
* jc/hidden-refs (2013-01-18) 2 commits
- upload-pack: allow hiding ref hiearchies
- upload-pack: share more code
Allow the server side to unclutter the refs/ namespace it shows by
default, while still allowing requests for histories leading to the
tips of hidden refs by updated clients (which are not written yet).
* jk/update-install-for-p4 (2013-01-20) 1 commit
- INSTALL: git-p4 doesn't support Python 3
Will merge to 'next'.
* tb/t0050-maint (2013-01-21) 3 commits
- t0050: Use TAB for indentation
- t0050: honor CASE_INSENSITIVE_FS in add (with different case)
- t0050: known breakage vanished in merge (case change)
Will merge to 'next'.
* nd/magic-pathspec-from-root (2013-01-21) 2 commits
- grep: avoid accepting ambiguous revision
- Update :/abc ambiguity check
Will merge to 'next'.
* ta/doc-no-small-caps (2013-01-21) 7 commits
- Add rule for when to use 'git' and when to use 'Git'
- Change 'git' to 'Git' whenever the whole system is referred to #4
- Change 'git' to 'Git' whenever the whole system is referred to #3
- Change 'git' to 'Git' whenever the whole system is referred to #2
- Change 'git' to 'Git' whenever the whole system is referred to #1
- Documentation: update two leftover small caps
- Documentation: avoid poor-man's small caps
Update documentation to change "GIT" which was a poor-man's small
caps to "Git" which was the intended spelling. Also change "git"
spelled in all-lowercase to "Git" when it refers to the system as
the whole or the concept it embodies, as opposed to the command the
end users would type.
* rr/minimal-stat (2013-01-22) 1 commit
- Enable minimal stat checking
Some reimplementations of Git does not write all the stat info back
to the index due to their implementation limitations (e.g. jgit
running on Java). A configuration option can tell Git to ignore
changes to most of the stat fields and only pay attention to mtime
and size, which these implementations can reliably update. This
avoids excessive revalidation of contents.
Will merge to 'next'.
--------------------------------------------------
[Graduated to "master"]
* ap/log-mailmap (2013-01-10) 11 commits
(merged to 'next' on 2013-01-10 at 8544084)
+ log --use-mailmap: optimize for cases without --author/--committer search
+ log: add log.mailmap configuration option
+ log: grep author/committer using mailmap
+ test: add test for --use-mailmap option
+ log: add --use-mailmap option
+ pretty: use mailmap to display username and email
+ mailmap: add mailmap structure to rev_info and pp
+ mailmap: simplify map_user() interface
+ mailmap: remove email copy and length limitation
+ Use split_ident_line to parse author and committer
+ string-list: allow case-insensitive string list
Teach commands in the "log" family to optionally pay attention to
the mailmap.
* ds/completion-silence-in-tree-path-probe (2013-01-11) 1 commit
(merged to 'next' on 2013-01-15 at 7542d21)
+ git-completion.bash: silence "not a valid object" errors
An internal ls-tree call made by completion code only to probe if
a path exists in the tree recorded in a commit object leaked error
messages when the path is not there. It is not an error at all and
should not be shown to the end user.
* fc/remote-hg-fixup-url (2013-01-15) 1 commit
(merged to 'next' on 2013-01-15 at d2acb2d)
+ remote-hg: store converted URL
Update to the Hg remote helper (in contrib/).
* jn/maint-trim-vim-contrib (2013-01-10) 1 commit
(merged to 'next' on 2013-01-15 at ad80a9d)
+ contrib/vim: simplify instructions for old vim support
Remove stale insn to support older versions of vim and point users
to the upstream resources.
* mh/remote-hg-mode-bits-fix (2013-01-15) 1 commit
(merged to 'next' on 2013-01-15 at ad57d9f)
+ remote-hg: fix handling of file perms when pushing
Update to the Hg remote helper (in contrib/).
* mk/complete-tcsh (2013-01-07) 1 commit
(merged to 'next' on 2013-01-11 at b8b30b1)
+ Prevent space after directories in tcsh completion
Update tcsh command line completion so that an unwanted space is
not added to a single directory name.
* mz/reset-misc (2013-01-16) 20 commits
(merged to 'next' on 2013-01-16 at 937bc20)
+ reset: update documentation to require only tree-ish with paths
(merged to 'next' on 2013-01-15 at a93b394)
+ reset [--mixed]: use diff-based reset whether or not pathspec was given
+ reset: allow reset on unborn branch
+ reset $sha1 $pathspec: require $sha1 only to be treeish
+ reset.c: inline update_index_refresh()
+ reset.c: finish entire cmd_reset() whether or not pathspec is given
+ reset [--mixed]: only write index file once
+ reset.c: move lock, write and commit out of update_index_refresh()
+ reset.c: move update_index_refresh() call out of read_from_tree()
+ reset.c: replace switch by if-else
+ reset: avoid redundant error message
+ reset --keep: only write index file once
+ reset.c: share call to die_if_unmerged_cache()
+ reset.c: extract function for updating {ORIG_,}HEAD
+ reset.c: remove unnecessary variable 'i'
+ reset.c: extract function for parsing arguments
+ reset: don't allow "git reset -- $pathspec" in bare repo
+ reset.c: pass pathspec around instead of (prefix, argv) pair
+ reset $pathspec: exit with code 0 if successful
+ reset $pathspec: no need to discard index
Various 'reset' optimizations and clean-ups, followed by a change
to allow "git reset" to work even on an unborn branch.
* nd/attr-debug-fix (2013-01-15) 1 commit
(merged to 'next' on 2013-01-15 at 8460acf)
+ attr: make it build with DEBUG_ATTR again
Fix debugging support that was broken in earlier change.
* nd/clone-no-separate-git-dir-with-bare (2013-01-10) 1 commit
(merged to 'next' on 2013-01-15 at 64f441a)
+ clone: forbid --bare --separate-git-dir <dir>
Forbid a useless combination of options to "git clone".
* nd/fix-directory-attrs-off-by-one (2013-01-16) 2 commits
(merged to 'next' on 2013-01-16 at bd63e61)
+ attr: avoid calling find_basename() twice per path
(merged to 'next' on 2013-01-15 at e0a0129)
+ attr: fix off-by-one directory component length calculation
Fix performance regression introduced by an earlier change to let
attributes apply to directories.
* nd/fix-perf-parameters-in-tests (2013-01-15) 1 commit
(merged to 'next' on 2013-01-15 at fedbdb9)
+ test-lib.sh: unfilter GIT_PERF_*
Allow GIT_PERF_* environment variables to be passed through the
test framework.
* pe/doc-email-env-is-trumped-by-config (2013-01-10) 1 commit
(merged to 'next' on 2013-01-14 at 6b4d555)
+ git-commit-tree(1): correct description of defaults
In the precedence order, the environment variable $EMAIL comes
between the built-in default (i.e. taking value by asking the
system's gethostname() etc.) and the user.email configuration
variable; the documentation implied that it is stronger than the
configuration like $GIT_COMMITTER_EMAIL is, which is wrong.
* ph/rebase-preserve-all-merges (2013-01-14) 1 commit
(merged to 'next' on 2013-01-15 at 3a67878)
+ rebase --preserve-merges: keep all merge commits including empty ones
An earlier change to add --keep-empty option broke "git rebase
--preserve-merges" and lost merge commits that end up being the
same as its parent.
* pw/p4-branch-fixes (2013-01-15) 14 commits
(merged to 'next' on 2013-01-15 at 1ee379e)
+ git p4: fix submit when no master branch
+ git p4 test: keep P4CLIENT changes inside subshells
+ git p4: fix sync --branch when no master branch
+ git p4: fail gracefully on sync with no master branch
+ git p4: rearrange self.initialParent use
+ git p4: allow short ref names to --branch
+ git p4 doc: fix branch detection example
+ git p4: clone --branch should checkout master
+ git p4: verify expected refs in clone --bare test
+ git p4: create p4/HEAD on initial clone
+ git p4: inline listExistingP4GitBranches
+ git p4: add comments to p4BranchesInGit
+ git p4: rearrange and simplify hasOrigin handling
+ git p4: test sync/clone --branch behavior
Fix "git p4" around branch handling.
* rs/pretty-use-prefixcmp (2013-01-14) 1 commit
(merged to 'next' on 2013-01-15 at d76452d)
+ pretty: use prefixcmp instead of memcmp on NUL-terminated strings
* rt/commit-cleanup-config (2013-01-10) 1 commit
(merged to 'next' on 2013-01-15 at c4742ae)
+ commit: make default of "cleanup" option configurable
Add a configuration variable to set default clean-up mode other
than "strip".
* ss/help-htmlpath-config-doc (2013-01-15) 1 commit
(merged to 'next' on 2013-01-17 at 99bfae2)
+ config.txt: Document help.htmlpath config parameter
Add missing doc.
* zk/clean-report-failure (2013-01-14) 1 commit
(merged to 'next' on 2013-01-15 at 5b31614)
+ git-clean: Display more accurate delete messages
"git clean" states what it is going to remove and then goes on to
remove it, but sometimes it only discovers things that cannot be
removed after recursing into a directory, which makes the output
confusing and even wrong.
--------------------------------------------------
[Stalled]
* mp/complete-paths (2013-01-11) 1 commit
- git-completion.bash: add support for path completion
The completion script used to let the default completer to suggest
pathnames, which gave too many irrelevant choices (e.g. "git add"
would not want to add an unmodified path). Teach it to use a more
git-aware logic to enumerate only relevant ones.
Waiting for area-experts' help and review.
* jl/submodule-deinit (2012-12-04) 1 commit
- submodule: add 'deinit' command
There was no Porcelain way to say "I no longer am interested in
this submodule", once you express your interest in a submodule with
"submodule init". "submodule deinit" is the way to do so.
Expecting a reroll.
$gmane/212884
* jk/lua-hackery (2012-10-07) 6 commits
- pretty: fix up one-off format_commit_message calls
- Minimum compilation fixup
- Makefile: make "lua" a bit more configurable
- add a "lua" pretty format
- add basic lua infrastructure
- pretty: make some commit-parsing helpers more public
Interesting exercise. When we do this for real, we probably would want
to wrap a commit to make it more like an "object" with methods like
"parents", etc.
* rc/maint-complete-git-p4 (2012-09-24) 1 commit
- Teach git-completion about git p4
Comment from Pete will need to be addressed ($gmane/206172).
* jc/maint-name-rev (2012-09-17) 7 commits
- describe --contains: use "name-rev --algorithm=weight"
- name-rev --algorithm=weight: tests and documentation
- name-rev --algorithm=weight: cache the computed weight in notes
- name-rev --algorithm=weight: trivial optimization
- name-rev: --algorithm option
- name_rev: clarify the logic to assign a new tip-name to a commit
- name-rev: lose unnecessary typedef
"git name-rev" names the given revision based on a ref that can be
reached in the smallest number of steps from the rev, but that is
not useful when the caller wants to know which tag is the oldest one
that contains the rev. This teaches a new mode to the command that
uses the oldest ref among those which contain the rev.
I am not sure if this is worth it; for one thing, even with the help
from notes-cache, it seems to make the "describe --contains" even
slower. Also the command will be unusably slow for a user who does
not have a write access (hence unable to create or update the
notes-cache).
Stalled mostly due to lack of responses.
* jc/xprm-generation (2012-09-14) 1 commit
- test-generation: compute generation numbers and clock skews
A toy to analyze how bad the clock skews are in histories of real
world projects.
Stalled mostly due to lack of responses.
* jc/add-delete-default (2012-08-13) 1 commit
- git add: notice removal of tracked paths by default
"git add dir/" updated modified files and added new files, but does
not notice removed files, which may be "Huh?" to some users. They
can of course use "git add -A dir/", but why should they?
Resurrected from graveyard, as I thought it was a worthwhile thing
to do in the longer term.
Stalled mostly due to lack of responses.
* mb/remote-default-nn-origin (2012-07-11) 6 commits
- Teach get_default_remote to respect remote.default.
- Test that plain "git fetch" uses remote.default when on a detached HEAD.
- Teach clone to set remote.default.
- Teach "git remote" about remote.default.
- Teach remote.c about the remote.default configuration setting.
- Rename remote.c's default_remote_name static variables.
When the user does not specify what remote to interact with, we
often attempt to use 'origin'. This can now be customized via a
configuration variable.
Expecting a reroll.
$gmane/210151
"The first remote becomes the default" bit is better done as a
separate step.
--------------------------------------------------
[Cooking]
* mh/imap-send-shrinkage (2013-01-15) 14 commits
(merged to 'next' on 2013-01-18 at 1b7c5ba)
+ imap-send.c: simplify logic in lf_to_crlf()
+ imap-send.c: fold struct store into struct imap_store
+ imap-send.c: remove unused field imap_store::uidvalidity
+ imap-send.c: use struct imap_store instead of struct store
+ imap-send.c: remove unused field imap_store::trashnc
+ imap-send.c: remove namespace fields from struct imap
+ imap-send.c: remove struct imap argument to parse_imap_list_l()
+ imap-send.c: inline parse_imap_list() in parse_list()
+ imap-send.c: remove some unused fields from struct store
+ imap-send.c: remove struct message
+ imap-send.c: remove struct store_conf
+ iamp-send.c: remove unused struct imap_store_conf
+ imap-send.c: remove struct msg_data
+ imap-send.c: remove msg_data::flags, which was always zero
Remove a lot of unused code from "git imap-send".
Will merge to 'master'.
* cr/push-force-tag-update (2013-01-21) 4 commits
- push: further simplify the logic to assign rejection status
- push: introduce REJECT_FETCH_FIRST and REJECT_NEEDS_FORCE
- push: further clean up fields of "struct ref"
(merged to 'next' on 2013-01-18 at c9091d5)
+ push: fix "refs/tags/ hierarchy cannot be updated without --force"
Regression fix (the bottom one), and error/advice message
improvements (the rest).
Will merge to 'master' the bottom one soonish.
The remainder can cook in 'next' like any other topic.
* jk/suppress-clang-warning (2013-01-16) 1 commit
(merged to 'next' on 2013-01-18 at 7c0bda7)
+ fix clang -Wunused-value warnings for error functions
Will merge to 'master'.
* rs/clarify-entry-cmp-sslice (2013-01-16) 1 commit
(merged to 'next' on 2013-01-18 at d584dc6)
+ refs: use strncmp() instead of strlen() and memcmp()
Will merge to 'master'.
* ch/add-auto-submitted-in-sample-post-receive-email (2013-01-17) 1 commit
(merged to 'next' on 2013-01-18 at e3205db)
+ Add Auto-Submitted header to post-receive-email
Will merge to 'master'.
* jc/remove-treesame-parent-in-simplify-merges (2013-01-17) 1 commit
- simplify-merges: drop merge from irrelevant side branch
The --simplify-merges logic did not cull irrelevant parents from a
merge that is otherwise not interesting with respect to the paths
we are following.
As this touches a fairly core part of the revision traversal
infrastructure, it is appreciated to have an extra set of eyes for
sanity check.
Waiting for comments.
* jk/remote-helpers-in-python-3 (2013-01-20) 8 commits
- git-remote-testpy: call print as a function
- git-remote-testpy: don't do unbuffered text I/O
- git-remote-testpy: hash bytes explicitly
- svn-fe: allow svnrdump_sim.py to run with Python 3
- git_remote_helpers: use 2to3 if building with Python 3
- git_remote_helpers: force rebuild if python version changes
- git_remote_helpers: fix input when running under Python 3
- git_remote_helpers: allow building with Python 3
Prepare remote-helper test written in Python to be run with Python3.
Will merge to 'next'.
* jc/cvsimport-upgrade (2013-01-14) 8 commits
- t9600: adjust for new cvsimport
- t9600: further prepare for sharing
- cvsimport-3: add a sample test
- cvsimport: make tests reusable for cvsimport-3
- cvsimport: start adding cvsps 3.x support
- cvsimport: introduce a version-switch wrapper
- cvsimport: allow setting a custom cvsps (2.x) program name
- Makefile: add description on PERL/PYTHON_PATH
The most important part of this series is the addition of the new
cvsimport by Eric Raymond that works with cvsps 3.x. Given some
distros have inertia to be conservative, Git with cvsimport that
does not work with both 3.x will block adoption of cvsps 3.x by
them, and shipping Git with cvsimport that does not work with cvsps
2.x will block such a version of Git, so we'll do the proven "both
old and new are available, but we aim to deprecate and remove the
old one in due time" strategy that we used successfully in the
past.
Will merge to 'next'.
* as/pre-push-hook (2013-01-18) 3 commits
(merged to 'next' on 2013-01-18 at 37fc4e8)
+ Add sample pre-push hook script
+ push: Add support for pre-push hooks
+ hooks: Add function to check if a hook exists
Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).
Will merge to 'master'.
* dl/am-hg-locale (2013-01-18) 1 commit
- am: invoke perl's strftime in C locale
Datestamp recorded in "Hg" format patch was reformatted incorrectly
to an e-mail looking date using locale dependant strftime, causing
patch application to fail.
Will merge to 'next'.
* jk/config-parsing-cleanup (2013-01-14) 7 commits
- [DONTMERGE] reroll coming
- submodule: simplify memory handling in config parsing
- submodule: use match_config_key when parsing config
- userdiff: drop parse_driver function
- convert some config callbacks to match_config_key
- archive-tar: use match_config_key when parsing config
- config: add helper function for parsing key names
Expecting a reroll.
* mp/diff-algo-config (2013-01-16) 3 commits
- diff: Introduce --diff-algorithm command line option
- config: Introduce diff.algorithm variable
- git-completion.bash: Autocomplete --minimal and --histogram for git-diff
Add diff.algorithm configuration so that the user does not type
"diff --histogram".
Looking better; may want tests to protect it from future breakages,
but otherwise it looks ready for 'next'.
Waiting for a follow-up to add tests.
* rs/archive-tar-config-parsing-fix (2013-01-14) 1 commit
- archive-tar: fix sanity check in config parsing
Configuration parsing for tar.* configuration variables were
broken; Peff's config parsing clean-up topic will address the same
breakage, so this may be superseded by that other topic.
Waiting for the other topic to make this unneeded.
* jc/custom-comment-char (2013-01-16) 1 commit
- Allow custom "comment char"
An illustration to show codepaths that need to be touched to change
the hint lines in the edited text to begin with something other
than '#'.
This is half my work and half by Ralf Thielow. There may still be
leftover '#' lurking around, though. My "git grep" says C code
should be already fine, but git-rebase--interactive.sh could be
converted (it should not matter, as the file is not really a
free-form text).
I don't know how useful this will be in real life, though.
Will merge to 'next'.
* nd/fetch-depth-is-broken (2013-01-11) 3 commits
(merged to 'next' on 2013-01-15 at 70a5ca7)
+ fetch: elaborate --depth action
+ upload-pack: fix off-by-one depth calculation in shallow clone
+ fetch: add --unshallow for turning shallow repo into complete one
"git fetch --depth" was broken in at least three ways. The
resulting history was deeper than specified by one commit, it was
unclear how to wipe the shallowness of the repository with the
command, and documentation was misleading.
Will cook in 'next'.
* jc/no-git-config-in-clone (2013-01-11) 1 commit
(merged to 'next' on 2013-01-15 at feeffe1)
+ clone: do not export and unexport GIT_CONFIG
We stopped paying attention to $GIT_CONFIG environment that points
at a single configuration file from any command other than "git config"
quite a while ago, but "git clone" internally set, exported, and
then unexported the variable during its operation unnecessarily.
Will cook in 'next'.
* dg/subtree-fixes (2013-01-08) 7 commits
- contrib/subtree: mkdir the manual directory if needed
- contrib/subtree: honor $(DESTDIR)
- contrib/subtree: fix synopsis and command help
- contrib/subtree: better error handling for "add"
- contrib/subtree: add --unannotate option
- contrib/subtree: use %B for split Subject/Body
- t7900: remove test number comments
contrib/subtree updates; there are a few more from T. Zheng that
were posted separately, with an overlap.
Expecting a reroll.
* jc/push-2.0-default-to-simple (2013-01-16) 14 commits
(merged to 'next' on 2013-01-16 at 23f5df2)
+ t5570: do not assume the "matching" push is the default
+ t5551: do not assume the "matching" push is the default
+ t5550: do not assume the "matching" push is the default
(merged to 'next' on 2013-01-09 at 74c3498)
+ doc: push.default is no longer "matching"
+ push: switch default from "matching" to "simple"
+ t9401: do not assume the "matching" push is the default
+ t9400: do not assume the "matching" push is the default
+ t7406: do not assume the "matching" push is the default
+ t5531: do not assume the "matching" push is the default
+ t5519: do not assume the "matching" push is the default
+ t5517: do not assume the "matching" push is the default
+ t5516: do not assume the "matching" push is the default
+ t5505: do not assume the "matching" push is the default
+ t5404: do not assume the "matching" push is the default
Will cook in 'next' until Git 2.0 ;-).
* nd/parse-pathspec (2013-01-11) 20 commits
. Convert more init_pathspec() to parse_pathspec()
. Convert add_files_to_cache to take struct pathspec
. Convert {read,fill}_directory to take struct pathspec
. Convert refresh_index to take struct pathspec
. Convert report_path_error to take struct pathspec
. checkout: convert read_tree_some to take struct pathspec
. Convert unmerge_cache to take struct pathspec
. Convert read_cache_preload() to take struct pathspec
. add: convert to use parse_pathspec
. archive: convert to use parse_pathspec
. ls-files: convert to use parse_pathspec
. rm: convert to use parse_pathspec
. checkout: convert to use parse_pathspec
. rerere: convert to use parse_pathspec
. status: convert to use parse_pathspec
. commit: convert to use parse_pathspec
. clean: convert to use parse_pathspec
. Export parse_pathspec() and convert some get_pathspec() calls
. Add parse_pathspec() that converts cmdline args to struct pathspec
. pathspec: save the non-wildcard length part
Uses the parsed pathspec structure in more places where we used to
use the raw "array of strings" pathspec.
Ejected from 'pu' for now; will take a look at the rerolled one
later ($gmane/213340).
* jc/doc-maintainer (2013-01-03) 2 commits
(merged to 'next' on 2013-01-11 at f35d582)
+ howto/maintain: mark titles for asciidoc
+ Documentation: update "howto maintain git"
Describe tools for automation that were invented since this
document was originally written.
* mo/cvs-server-updates (2012-12-09) 18 commits
(merged to 'next' on 2013-01-08 at 75e2d11)
+ t9402: Use TABs for indentation
+ t9402: Rename check.cvsCount and check.list
+ t9402: Simplify git ls-tree
+ t9402: Add missing &&; Code style
+ t9402: No space after IO-redirection
+ t9402: Dont use test_must_fail cvs
+ t9402: improve check_end_tree() and check_end_full_tree()
+ t9402: sed -i is not portable
+ cvsserver Documentation: new cvs ... -r support
+ cvsserver: add t9402 to test branch and tag refs
+ cvsserver: support -r and sticky tags for most operations
+ cvsserver: Add version awareness to argsfromdir
+ cvsserver: generalize getmeta() to recognize commit refs
+ cvsserver: implement req_Sticky and related utilities
+ cvsserver: add misc commit lookup, file meta data, and file listing functions
+ cvsserver: define a tag name character escape mechanism
+ cvsserver: cleanup extra slashes in filename arguments
+ cvsserver: factor out git-log parsing logic
Various git-cvsserver updates.
Will merge to 'master'.
* as/check-ignore (2013-01-16) 13 commits
(merged to 'next' on 2013-01-18 at ef45aff)
+ clean.c, ls-files.c: respect encapsulation of exclude_list_groups
(merged to 'next' on 2013-01-14 at 9df2afc)
+ t0008: avoid brace expansion
+ add git-check-ignore sub-command
+ setup.c: document get_pathspec()
+ add.c: extract new die_if_path_beyond_symlink() for reuse
+ add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
+ pathspec.c: rename newly public functions for clarity
+ add.c: move pathspec matchers into new pathspec.c for reuse
+ add.c: remove unused argument from validate_pathspec()
+ dir.c: improve docs for match_pathspec() and match_pathspec_depth()
+ dir.c: provide clear_directory() for reclaiming dir_struct memory
+ dir.c: keep track of where patterns came from
+ dir.c: use a single struct exclude_list per source of excludes
Add a new command "git check-ignore" for debugging .gitignore
files.
The variable names may want to get cleaned up but that can be done
in-tree.
Will merge to 'master'.
* nd/retire-fnmatch (2013-01-01) 7 commits
(merged to 'next' on 2013-01-07 at ab31f9b)
+ Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
+ wildmatch: advance faster in <asterisk> + <literal> patterns
+ wildmatch: make a special case for "*/" with FNM_PATHNAME
+ test-wildmatch: add "perf" command to compare wildmatch and fnmatch
+ wildmatch: support "no FNM_PATHNAME" mode
+ wildmatch: make dowild() take arbitrary flags
+ wildmatch: rename constants and update prototype
Originally merged to 'next' on 2013-01-04
Replace our use of fnmatch(3) with a more feature-rich wildmatch.
A handful patches at the bottom have been moved to nd/wildmatch to
graduate as part of that branch, before this series solidifies.
Will merge to 'master'.
* mb/gitweb-highlight-link-target (2012-12-20) 1 commit
- Highlight the link target line in Gitweb using CSS
Expecting a reroll.
$gmane/211935
* bc/append-signed-off-by (2013-01-21) 10 commits
- Unify appending signoff in format-patch, commit and sequencer
- format-patch: update append_signoff prototype
- t4014: more tests about appending s-o-b lines
- sequencer.c: teach append_signoff to avoid adding a duplicate newline
- sequencer.c: teach append_signoff how to detect duplicate s-o-b
- sequencer.c: always separate "(cherry picked from" from commit body
- sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
- t/t3511: add some tests of 'cherry-pick -s' functionality
- t/test-lib-functions.sh: allow to specify the tag name to test_commit
- sequencer.c: remove broken support for rfc2822 continuation in footer
Rerolled.
Seems that we will see another round.
--------------------------------------------------
[Discarded]
* er/replace-cvsimport (2013-01-12) 7 commits
. t/lib-cvs: cvsimport no longer works without Python >= 2.7
. t9605: test for cvsps commit ordering bug
. t9604: fixup for new cvsimport
. t9600: fixup for new cvsimport
. t/lib-cvs.sh: allow cvsps version 3.x.
. t/t960[123]: remove leftover scripts
. cvsimport: rewrite to use cvsps 3.x to fix major bugs
Rerolled as jc/cvsimport-upgrade.
* jc/valgrind-memcmp-bsearch (2013-01-14) 1 commit
. ignore memcmp() overreading in bsearch() callback
Squelch false positive in valgrind tests; made unnecessary by
rewriting the callsite that confuses the tool.
^ permalink raw reply
* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-22 22:46 UTC (permalink / raw)
To: Thomas Rast
Cc: Brian J. Murrell, git, kusmabite, Pyeron, Jason J CTR (US),
Maxime Boissonneault, Philippe Vaucher, Sébastien Boisvert
In-Reply-To: <878v7keuh3.fsf@pctrast.inf.ethz.ch>
On 01/22/2013 05:14 PM, Thomas Rast wrote:
> Eric Chamberland <Eric.Chamberland@giref.ulaval.ca> writes:
>
>> So, hum, do we have some sort of conclusion?
>>
>> Shall it be a fix for git to get around that lustre "behavior"?
>>
>> If something can be done in git it would be great: it is a *lot*
>> easier to change git than the lustre filesystem software for a cluster
>> in running in production mode... (words from cluster team) :-/
>
> I thought you already established that simply disabling the progress
> display is a sufficient workaround? If that doesn't help, you can try
> patching out all use of SIGALRM within git.
>
I tried that solution after Brian told me to try it, but it didn't
solved the problem for me! :-(
> Other than that I agree with Junio, from what we've seen so far, Lustre
> returns EINTR on all sorts of calls that simply aren't allowed to do so.
>
Ok, so now the "good" move would be to have all this reported to lustre
development team? Brian, have you seen anything new from what you have
already reported? I have to admit that I am not a fs expert...
And I also agree with Junio point of view: The problem may impact
mission critical applications....
Eric
^ permalink raw reply
* Re: [PATCH v3 01/10] wildmatch: fix "**" special case
From: Junio C Hamano @ 2013-01-22 22:51 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <7vr4lcnbn5.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> We obviously do not want to set FNM_PATHNAME when we are not
> substituting fnmatch() with wildmatch(), but I wonder if it may make
> sense to unconditionally use WM_PATHNAME semantics when we build the
> system with USE_WILDMATCH and calling wildmatch() in this codepath.
> Users can always use "*/**/*" in place of "*" in their patterns
> where they want to ignore directory boundaries.
Another possibility, which _might_ make more practical sense, is to
update dowild() so that any pattern that has (^|/)**(/|$) in it
implicitly turns the WM_PATHNAME flag on. There is no reason for
the user to feed it a double-asterisk unless it is an attempt to
defeat some directory boundaries, so we already know that the user
expects WM_PATHNAME behaviour at that point. Otherwise, the user
would have simply said '*' instead, wouldn't he?
I said "_might_" because it sounds a bit too magical to my taste.
I dunno.
^ permalink raw reply
* Re: [PATCH] all: new command used for multi-repo operations
From: Lars Hjemli @ 2013-01-22 23:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmww0nahd.fsf@alter.siamese.dyndns.org>
On Tue, Jan 22, 2013 at 11:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Lars Hjemli <hjemli@gmail.com> writes:
>
>> +static struct option builtin_all_options[] = {
>> + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
>> + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
>> + OPT_END(),
>> +};
>
> Shouldn't this be more like OPT_SET_INT() on a same variable that is
> initialized to "all"? Alternatively you could validate the input
> and die when both are given.
OPT_SET_INT() seems appropriate, will fix.
>
>> +int cmd_all(int argc, const char **argv, const char *prefix)
>> +{
>> + struct strbuf path = STRBUF_INIT;
>> +
>> + if (!getcwd(root, sizeof(root)))
>> + return 1;
>> +
>> + argc = parse_options(argc, argv, prefix, builtin_all_options,
>> + builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
>> +
>> + unsetenv(GIT_DIR_ENVIRONMENT);
>> + unsetenv(GIT_WORK_TREE_ENVIRONMENT);
>
> Don't you need to clear other variables whose uses are closely tied
> to a single repository, like GIT_INDEX_FILE, etc.?
>
> I suspect that explicitly exporting GIT_DIR and GIT_WORK_TREE (and
> nothing else) in handle_repo() to the location you discovered before
> you run the per-repository command via run_command_v_opt(), might be
> a better alternative. The user could be sharing objects in all
> repositories by permanently setting GIT_OBJECT_DIRECTORY to a single
> place.
>
This sounds like a nice plan, I'll test it and send an updated patch.
>> diff --git a/command-list.txt b/command-list.txt
>> index 7e8cfec..f955895 100644
>> --- a/command-list.txt
>> +++ b/command-list.txt
>> @@ -1,6 +1,7 @@
>> # List of known git commands.
>> # command name category [deprecated] [common]
>> git-add mainporcelain common
>> +git-all mainporcelain
>> git-am mainporcelain
>> git-annotate ancillaryinterrogators
>> git-apply plumbingmanipulators
>
> I am not very interested in this topic in the first place, but this
> does not (at least not yet) sound like a main Porcelain to me.
There doesn't seem to be a better category, but I'm open for suggestions.
>
> "all" may be a word other people may want to use to call collections
> of things other than "Git repositories", and that use may turn out
> to be more useful in general. A name that makes it clear that this
> is about "repositories", i.e. along the lines of "git for-each-repo"
> or something, would be a better name that does not squat on such a
> short and sweet name.
>
In principle I agree with your reasoning on this, but in practice I
fail to see what other kind of things `git all` could naturally refer
to. Also, having a short and sweet way to perform the tasks
implemented by this patch was my main motivation for writing it [1],
hence `git for-each-repo` isn't as compelling (too much typing).
There's always aliases, but I'd prefer it if future git supported `git
all` by default.
--
larsh
[1] Originally as a shell script, used at $WORK for ~2 years
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2013, #08; Tue, 22)
From: John Keeping @ 2013-01-22 23:45 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7va9s0n8gv.fsf@alter.siamese.dyndns.org>
On Tue, Jan 22, 2013 at 02:44:48PM -0800, Junio C Hamano wrote:
> * jc/cvsimport-upgrade (2013-01-14) 8 commits
> - t9600: adjust for new cvsimport
> - t9600: further prepare for sharing
> - cvsimport-3: add a sample test
> - cvsimport: make tests reusable for cvsimport-3
> - cvsimport: start adding cvsps 3.x support
> - cvsimport: introduce a version-switch wrapper
> - cvsimport: allow setting a custom cvsps (2.x) program name
> - Makefile: add description on PERL/PYTHON_PATH
>
> The most important part of this series is the addition of the new
> cvsimport by Eric Raymond that works with cvsps 3.x. Given some
> distros have inertia to be conservative, Git with cvsimport that
> does not work with both 3.x will block adoption of cvsps 3.x by
> them, and shipping Git with cvsimport that does not work with cvsps
> 2.x will block such a version of Git, so we'll do the proven "both
> old and new are available, but we aim to deprecate and remove the
> old one in due time" strategy that we used successfully in the
> past.
>
> Will merge to 'next'.
Would you mind holding off on this? As it stands there are a couple of
issues with the cvsimport-3 script including:
* It doesn't read any configuration from "git config" as
git-cvsimport-2 does.
* Incremental import is copmletely broken - it needs to pass "-i" to
cvsps-3 and even then timestamp handling is completely broken.
I have fixes for these that are nearly ready, but to fully fix the
incremental import issue I'll need to persuade ESR to take a patch which
lets us feed cvsps-3 a mapping from branch names to last commit times.
I suspect people are already used to the ways in which cvsimport-2 is
broken so I think we should take a bit more time to get this right with
cvsimport-3, especially since the people most likely to be using this
will be those regularly updating from a CVS repository with incremental
updates.
John
^ permalink raw reply
* Re: [PATCH v3 2/6] Change 'git' to 'Git' whenever the whole system is referred to #1
From: Junio C Hamano @ 2013-01-22 23:48 UTC (permalink / raw)
To: Thomas Ackermann; +Cc: davvid, git
In-Reply-To: <1430594044.632790.1358795873467.JavaMail.ngmail@webmail20.arcor-online.net>
Thomas Ackermann <th.acker@arcor.de> writes:
> Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
> ---
> diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
> index 9f42c0d..14bdbbb 100644
> --- a/Documentation/git-clean.txt
> +++ b/Documentation/git-clean.txt
> @@ -33,7 +33,7 @@ OPTIONS
>
> -f::
> --force::
> - If the git configuration variable clean.requireForce is not set
> + If the Git configuration variable clean.requireForce is not set
> to false, 'git clean' will refuse to run unless given -f or -n.
Before this description, -d option talks about a different Git
repository; s/git/Git/ is needed there.
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index 597048b..47d9880 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -214,7 +214,7 @@ objects from the source repository into a pack in the cloned repository.
> Instead of placing the cloned repository where it is supposed
> to be, place the cloned repository at the specified directory,
> then make a filesytem-agnostic git symbolic link to there.
Shouldn't this be "Git symbolic link"?
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 971977b..a7a4f75 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -347,7 +347,7 @@ install-webdoc : html
> '$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
>
> # You must have a clone of git-htmldocs and git-manpages repositories
> -# next to the git repository itself for the following to work.
> +# next to the Git repository itself for the following to work.
>
> quick-install: quick-install-man
This is *wrong*. It refers to the name of the repository whose
natural name is "git", as most people get it by
git clone git://git.kernel.org/pub/scm/git/git.git
and telling the users to do
git clone git://git.kernel.org/pub/scm/git/git-htmldocs.git
git clone git://git.kernel.org/pub/scm/git/git-manpages.git
in the same directory as they cloned git.git into (i.e. have these
two next to their clone of git.git, which is typically called "git").
I'll revert this part.
> diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
> index 262436b..1e5ef3b 100644
> --- a/Documentation/git-rm.txt
> +++ b/Documentation/git-rm.txt
> @@ -74,7 +74,7 @@ DISCUSSION
>
> The <file> list given to the command can be exact pathnames,
> file glob patterns, or leading directory names. The command
> -removes only the paths that are known to git. Giving the name of
> +removes only the paths that are known to Git. Giving the name of
> a file that you have not told git about does not remove that file.
This should be "you have not told Git about".
> diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
> index e2301f5..c07ad61 100644
> --- a/Documentation/git-filter-branch.txt
> +++ b/Documentation/git-filter-branch.txt
> @@ -29,7 +29,7 @@ The command will only rewrite the _positive_ refs mentioned in the
> command line (e.g. if you pass 'a..b', only 'b' will be rewritten).
> If you specify no filters, the commits will be recommitted without any
> changes, which would normally have no effect. Nevertheless, this may be
> -useful in the future for compensating for some git bugs or such,
> +useful in the future for compensating for some Git bugs or such,
> therefore such a usage is permitted.
The description before this hunk begins with "Lets you rewrite git
version history", which you need s/git/Git/.
> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
> index 9a914d0..3a62f50 100644
> --- a/Documentation/git-format-patch.txt
> +++ b/Documentation/git-format-patch.txt
> @@ -525,8 +525,8 @@ $ git format-patch -M -B origin
> Additionally, it detects and handles renames and complete rewrites
> intelligently to produce a renaming patch. A renaming patch reduces
> the amount of text output, and generally makes it easier to review.
> -Note that non-git "patch" programs won't understand renaming patches, so
> -use it only when you know the recipient uses git to apply your patch.
> +Note that non-Git "patch" programs won't understand renaming patches, so
> +use it only when you know the recipient uses Git to apply your patch.
Unrelated to the topic of this series, but didn't GNU patch add this
recently? Somebody needs a fact-check and may have to update the
above with something like "prior to GNU patch x.y..."
> diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
> index 9e0b3f6..071e947 100644
> --- a/Documentation/git-help.txt
> +++ b/Documentation/git-help.txt
> @@ -14,7 +14,7 @@ DESCRIPTION
> -----------
>
> With no options and no COMMAND given, the synopsis of the 'git'
> -command and a list of the most commonly used git commands are printed
> +command and a list of the most commonly used Git commands are printed
> on the standard output.
>
> If the option '--all' or '-a' is given, then all available commands are
After this hunk there is
If a git command is named, a manual page for that...
It is trying to refer to things like "cat-file" as "git command"
(even though technically I would call them "subcommands"), and I
would say "cat-file" is a subcommand of the system whose whole is
known as "Git". So I think s/git/Git/ is warranted here.
> diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
> index 9ac2bba..2571f56 100644
> --- a/Documentation/git-init.txt
> +++ b/Documentation/git-init.txt
> @@ -58,19 +58,19 @@ DIRECTORY" section below.)
> --separate-git-dir=<git dir>::
>
> Instead of initializing the repository where it is supposed to be,
> -place a filesytem-agnostic git symbolic link there, pointing to the
> -specified git path, and initialize a git repository at the path. The
> -result is git repository can be separated from working tree. If this
> +place a filesytem-agnostic Git symbolic link there, pointing to the
> +specified Git path, and initialize a Git repository at the path. The
> +result is Git repository can be separated from working tree. If this
Not a problem with this conversion, but I think "pointing to the
specified [gG]it path" should be without "[gG]it". There is nothing
specially Git about the path to the directory the user specifies. It
is just an ordinary filesystem path.
I'll try to fix all of the above up locally and re-queue, so please
eyeball the results once it is pushed out.
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2013, #08; Tue, 22)
From: Junio C Hamano @ 2013-01-23 0:11 UTC (permalink / raw)
To: John Keeping; +Cc: git, Eric S. Raymond, Chris Rorvick
In-Reply-To: <20130122234554.GI7498@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
> On Tue, Jan 22, 2013 at 02:44:48PM -0800, Junio C Hamano wrote:
>> * jc/cvsimport-upgrade (2013-01-14) 8 commits
>> - t9600: adjust for new cvsimport
>> - t9600: further prepare for sharing
>> - cvsimport-3: add a sample test
>> - cvsimport: make tests reusable for cvsimport-3
>> - cvsimport: start adding cvsps 3.x support
>> - cvsimport: introduce a version-switch wrapper
>> - cvsimport: allow setting a custom cvsps (2.x) program name
>> - Makefile: add description on PERL/PYTHON_PATH
>>
>> The most important part of this series is the addition of the new
>> cvsimport by Eric Raymond that works with cvsps 3.x. Given some
>> distros have inertia to be conservative, Git with cvsimport that
>> does not work with both 3.x will block adoption of cvsps 3.x by
>> them, and shipping Git with cvsimport that does not work with cvsps
>> 2.x will block such a version of Git, so we'll do the proven "both
>> old and new are available, but we aim to deprecate and remove the
>> old one in due time" strategy that we used successfully in the
>> past.
>>
>> Will merge to 'next'.
>
> Would you mind holding off on this? As it stands there are a couple of
> issues with the cvsimport-3 script including: ...
Actually I do. I think this, at least the early part of it, should
be merged to 'next' as soon as possible, *unless*
(1) The cvsimport-2 & cvsps2 combo this series ships gives worse
experience than cvsimport we ship in v1.8.1 to end users of the
current cvsimport with cvsps2; and/or
(2) The cvsimport-3 in this series, which is a copy of an older
version of what Eric has, is so broken that we are better off
starting cvsimport-3 by getting a fresh copy from Eric which
has been rewritten in a major way, than applying huge
incremental update patches that amounts to a total rewrite.
The point (1) is important from "no regression" point of view, and
in a sense more important between the two because it is the first
step in the overall transition plan.
Even though there may be remaining issues in cvsimport-3 and cvsps3
(what new piece of software don't have issues?), my limited
observation of the exchanges between you and Eric suggests me that
the problem is not something that requires a total rewrite of how
cvsimport-3 works, so I do not expect the point (2) to be true,
either, but if I am mistaken, please let me know.
By advancing the topic to 'next', we will give people a more solid
(read: not getting rewound) foundation to work with than "if you are
really interested, grab the tip of 'pu', replace it with even newer
copy from Eric's repository and try it out", so that more people can
help us polish the scaffolding to let us ship two versions and also
find issues in the new cvsimport-3 and help fixing them. At least,
that is what I've been hoping.
I could stop at the first three patches, that is, introducing the
version switch wrapper that switches between cvsps2+cvsimport-2
combo and nothing, and then let you and Eric redo the "start adding
cvsps 3.x support" and later patches when cvsimport-3 is ready.
That would give you a larger lattitude to rework cvsimport-3. Is
that preferrable?
^ permalink raw reply
* Re: [PATCH] all: new command used for multi-repo operations
From: Junio C Hamano @ 2013-01-23 0:13 UTC (permalink / raw)
To: Lars Hjemli; +Cc: git
In-Reply-To: <CAFXTnz62H24G9Zp5EgG47MyNdDz0KddX2n34G_1-RV_yP-ELkA@mail.gmail.com>
Lars Hjemli <hjemli@gmail.com> writes:
> In principle I agree with your reasoning on this, but in practice I
> fail to see what other kind of things `git all` could naturally refer
> to.
For example, the designers of 'for-each-ref' could have called it
"git all", as it is to iterate over all refs.
^ permalink raw reply
* Re: [PATCH v3 2/6] Change 'git' to 'Git' whenever the whole system is referred to #1
From: Junio C Hamano @ 2013-01-23 0:19 UTC (permalink / raw)
To: Thomas Ackermann; +Cc: davvid, git
In-Reply-To: <7vsj5slqz1.fsf@alter.siamese.dyndns.org>
This is the summary of the review comments in a patch form.
Subject: [PATCH] fixup! Change 'git' to 'Git' whenever the whole system is referred to #1
---
Documentation/Makefile | 4 ++--
Documentation/git-clean.txt | 2 +-
Documentation/git-clone.txt | 2 +-
Documentation/git-filter-branch.txt | 2 +-
Documentation/git-help.txt | 2 +-
Documentation/git-init.txt | 2 +-
Documentation/git-rm.txt | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index a7a4f75..c2d3ec1 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -346,8 +346,8 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
install-webdoc : html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
-# You must have a clone of git-htmldocs and git-manpages repositories
-# next to the Git repository itself for the following to work.
+# You must have a clone of 'git-htmldocs' and 'git-manpages' repositories
+# next to the 'git' repository itself for the following to work.
quick-install: quick-install-man
diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt
index 14bdbbb..bdc3ab8 100644
--- a/Documentation/git-clean.txt
+++ b/Documentation/git-clean.txt
@@ -27,7 +27,7 @@ OPTIONS
-------
-d::
Remove untracked directories in addition to untracked files.
- If an untracked directory is managed by a different git
+ If an untracked directory is managed by a different Git
repository, it is not removed by default. Use -f option twice
if you really want to remove such a directory.
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 47d9880..5c16e31 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -213,7 +213,7 @@ objects from the source repository into a pack in the cloned repository.
--separate-git-dir=<git dir>::
Instead of placing the cloned repository where it is supposed
to be, place the cloned repository at the specified directory,
- then make a filesytem-agnostic git symbolic link to there.
+ then make a filesytem-agnostic Git symbolic link to there.
The result is Git repository can be separated from working
tree.
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index c07ad61..dfd12c9 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -18,7 +18,7 @@ SYNOPSIS
DESCRIPTION
-----------
-Lets you rewrite git revision history by rewriting the branches mentioned
+Lets you rewrite Git revision history by rewriting the branches mentioned
in the <rev-list options>, applying custom filters on each revision.
Those filters can modify each tree (e.g. removing a file or running
a perl rewrite on all files) or information about each commit.
diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
index 071e947..835fba0 100644
--- a/Documentation/git-help.txt
+++ b/Documentation/git-help.txt
@@ -20,7 +20,7 @@ on the standard output.
If the option '--all' or '-a' is given, then all available commands are
printed on the standard output.
-If a git command is named, a manual page for that command is brought
+If a Git subcommand is named, a manual page for that subcommand is brought
up. The 'man' program is used by default for this purpose, but this
can be overridden by other options or configuration variables.
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 2571f56..afd721e 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -59,7 +59,7 @@ DIRECTORY" section below.)
Instead of initializing the repository where it is supposed to be,
place a filesytem-agnostic Git symbolic link there, pointing to the
-specified Git path, and initialize a Git repository at the path. The
+specified path, and initialize a Git repository at the path. The
result is Git repository can be separated from working tree. If this
is reinitialization, the repository will be moved to the specified
path.
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 1e5ef3b..92bac27 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -75,7 +75,7 @@ DISCUSSION
The <file> list given to the command can be exact pathnames,
file glob patterns, or leading directory names. The command
removes only the paths that are known to Git. Giving the name of
-a file that you have not told git about does not remove that file.
+a file that you have not told Git about does not remove that file.
File globbing matches across directory boundaries. Thus, given
two directories `d` and `d2`, there is a difference between
--
1.8.1.1.507.g1754052
^ permalink raw reply related
* Re: [PATCH] all: new command used for multi-repo operations
From: David Aguilar @ 2013-01-23 0:43 UTC (permalink / raw)
To: Lars Hjemli; +Cc: git
In-Reply-To: <1358889019-4554-1-git-send-email-hjemli@gmail.com>
On Tue, Jan 22, 2013 at 1:10 PM, Lars Hjemli <hjemli@gmail.com> wrote:
> When working with multiple, unrelated (or loosly related) git repos,
> there is often a need to locate all repos with uncommitted work and
> perform some action on them (say, commit and push). Before this patch,
> such tasks would require manually visiting all repositories, running
> `git status` within each one and then decide what to do next.
>
> This mundane task can now be automated by e.g. `git all --dirty status`,
> which will find all git repositories below the current directory (even
> nested ones), check if they are dirty (as defined by `git diff --quiet &&
> git diff --cached --quiet`), and for each dirty repo print the path to the
> repo and then execute `git status` within the repo.
>
> The command also honours the option '--clean' which restricts the set of
> repos to those which '--dirty' would skip.
>
> Finally, the command to execute within each repo is optional. If none is
> given, git-all will just print the path to each repo found.
>
> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
> ---
> Documentation/git-all.txt | 37 ++++++++++++++++
> Makefile | 1 +
> builtin.h | 1 +
> builtin/all.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++
> command-list.txt | 1 +
> git.c | 1 +
> t/t0064-all.sh | 42 +++++++++++++++++++
> 7 files changed, 188 insertions(+)
> create mode 100644 Documentation/git-all.txt
> create mode 100644 builtin/all.c
> create mode 100755 t/t0064-all.sh
>
> diff --git a/Documentation/git-all.txt b/Documentation/git-all.txt
> new file mode 100644
> index 0000000..b25f23c
> --- /dev/null
> +++ b/Documentation/git-all.txt
> @@ -0,0 +1,37 @@
> +git-all(1)
> +==========
> +
> +NAME
> +----
> +git-all - Execute a git command in multiple repositories
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'git all' [--dirty|--clean] [command]
> +
> +DESCRIPTION
> +-----------
> +The git-all command is used to locate all git repositoris within the
> +current directory tree, and optionally execute a git command in each
> +of the found repos.
> +
> +OPTIONS
> +-------
> +-c::
> +--clean::
> + Only include repositories with a clean worktree.
> +
> +-d::
> +--dirty::
> + Only include repositories with a dirty worktree.
> +
> +NOTES
> +-----
> +
> +For the purpose of `git-all`, a dirty worktree is defined as a worktree
> +with uncommitted changes.
> +
> +GIT
> +---
> +Part of the linkgit:git[1] suite
> diff --git a/Makefile b/Makefile
> index 1b30d7b..8bf0583 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -840,6 +840,7 @@ LIB_OBJS += xdiff-interface.o
> LIB_OBJS += zlib.o
>
> BUILTIN_OBJS += builtin/add.o
> +BUILTIN_OBJS += builtin/all.o
> BUILTIN_OBJS += builtin/annotate.o
> BUILTIN_OBJS += builtin/apply.o
> BUILTIN_OBJS += builtin/archive.o
> diff --git a/builtin.h b/builtin.h
> index 7e7bbd6..438c265 100644
> --- a/builtin.h
> +++ b/builtin.h
> @@ -41,6 +41,7 @@ void finish_copy_notes_for_rewrite(struct notes_rewrite_cfg *c);
> extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, int sha1_valid, char **buf, unsigned long *buf_size);
>
> extern int cmd_add(int argc, const char **argv, const char *prefix);
> +extern int cmd_all(int argc, const char **argv, const char *prefix);
> extern int cmd_annotate(int argc, const char **argv, const char *prefix);
> extern int cmd_apply(int argc, const char **argv, const char *prefix);
> extern int cmd_archive(int argc, const char **argv, const char *prefix);
> diff --git a/builtin/all.c b/builtin/all.c
> new file mode 100644
> index 0000000..ee9270d
> --- /dev/null
> +++ b/builtin/all.c
> @@ -0,0 +1,105 @@
> +/*
> + * "git all" builtin command.
> + *
> + * Copyright (c) 2013 Lars Hjemli <hjemli@gmail.com>
> + */
> +#include "cache.h"
> +#include "color.h"
> +#include "builtin.h"
> +#include "run-command.h"
> +#include "parse-options.h"
> +
> +static int only_dirty;
> +static int only_clean;
> +char root[PATH_MAX];
> +
> +static const char * const builtin_all_usage[] = {
> + N_("git all [options] [cmd]"),
> + NULL
> +};
> +
> +static struct option builtin_all_options[] = {
> + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean repositories")),
> + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty repositories")),
> + OPT_END(),
> +};
> +
> +static int is_dirty()
> +{
> + const char *diffidx[] = {"diff", "--quiet", "--cached", NULL};
> + const char *diffwd[] = {"diff", "--quiet", NULL};
> +
> + if (run_command_v_opt(diffidx, RUN_GIT_CMD) != 0)
> + return 1;
> + if (run_command_v_opt(diffwd, RUN_GIT_CMD) != 0)
> + return 1;
> + return 0;
> +}
> +
> +static void handle_repo(char *path, const char **argv)
> +{
> + int dirty;
> +
> + if (path[0] == '.' && path[1] == '/')
> + path += 2;
> + if (only_dirty || only_clean) {
> + dirty = is_dirty();
> + if ((dirty && only_clean) ||
> + (!dirty && only_dirty))
> + return;
> + }
> + if (*argv) {
> + color_fprintf_ln(stdout, GIT_COLOR_YELLOW, "[%s]", path);
> + run_command_v_opt(argv, RUN_GIT_CMD);
> + } else
> + printf("%s\n", path);
> +}
> +
> +static int walk(struct strbuf *path, int argc, const char **argv)
> +{
> + DIR *dir;
> + struct dirent *ent;
> + size_t len;
> +
> + dir = opendir(path->buf);
> + if (!dir)
> + return errno;
> + strbuf_addstr(path, "/");
> + len = path->len;
> + while ((ent = readdir(dir))) {
> + if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
> + continue;
> + if (!strcmp(ent->d_name, ".git")) {
> + strbuf_setlen(path, len - 1);
> + chdir(path->buf);
> + handle_repo(path->buf, argv);
> + chdir(root);
> + strbuf_addstr(path, "/");
> + continue;
> + }
Does this section above properly handle .git files (where .git is a
file, not a directory)? I wonder whether the check should be tighter,
e.g. something closer to what's done in setup.c:is_git_repository().
The name of this function leads me to believe that this walks
everything below the current directory looking for Git repos. How
deep does it walk? Does this handle nested repositories, e.g.
foo/bar/ and foo/bar/baz/ when you are inside foo/ ? After re-reading
the documentation I am led to believe that it only walks one level
deep.
I did not notice a test for nested repos which is what sparked my
curiosity. ;-) If we do not expect to handle them in the first
version then we should have a test to ensure the expected behavior.
It would also be nice to see a test with a .git file.
I do wonder what the end user experience is with this command when
used alongside other Git aggregate commands such as "repo" or "git
submodule". This command is basically "git submodule foreach ..."
without needing to buy into the whole submodule thing. This is an
argument for naming it something like "git foreach-repo" since it
would be named more closely to the "foreach" submodule command.
While "all" is less to type than "foreach-repo", most of the extra
work can be eliminated by installing the wonderful git completion
scripts for bash/zsh.
All that said, I have very real use cases for this command. Thanks
for writing it.
> + if (ent->d_type != DT_DIR)
> + continue;
> + strbuf_setlen(path, len);
> + strbuf_addstr(path, ent->d_name);
> + walk(path, argc, argv);
> + }
> + closedir(dir);
> + return 0;
> +}
> +
> +int cmd_all(int argc, const char **argv, const char *prefix)
> +{
> + struct strbuf path = STRBUF_INIT;
> +
> + if (!getcwd(root, sizeof(root)))
> + return 1;
> +
> + argc = parse_options(argc, argv, prefix, builtin_all_options,
> + builtin_all_usage, PARSE_OPT_STOP_AT_NON_OPTION);
> +
> + unsetenv(GIT_DIR_ENVIRONMENT);
> + unsetenv(GIT_WORK_TREE_ENVIRONMENT);
> +
> + strbuf_addstr(&path, ".");
> + return walk(&path, argc, argv);
> +}
> diff --git a/command-list.txt b/command-list.txt
> index 7e8cfec..f955895 100644
> --- a/command-list.txt
> +++ b/command-list.txt
> @@ -1,6 +1,7 @@
> # List of known git commands.
> # command name category [deprecated] [common]
> git-add mainporcelain common
> +git-all mainporcelain
> git-am mainporcelain
> git-annotate ancillaryinterrogators
> git-apply plumbingmanipulators
> diff --git a/git.c b/git.c
> index ed66c66..53fd963 100644
> --- a/git.c
> +++ b/git.c
> @@ -304,6 +304,7 @@ static void handle_internal_command(int argc, const char **argv)
> const char *cmd = argv[0];
> static struct cmd_struct commands[] = {
> { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> + { "all", cmd_all },
> { "annotate", cmd_annotate, RUN_SETUP },
> { "apply", cmd_apply, RUN_SETUP_GENTLY },
> { "archive", cmd_archive },
> diff --git a/t/t0064-all.sh b/t/t0064-all.sh
> new file mode 100755
> index 0000000..932e374
> --- /dev/null
> +++ b/t/t0064-all.sh
> @@ -0,0 +1,42 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2013 Lars Hjemli
> +#
> +
> +test_description='Test the git-all command'
> +
> +. ./test-lib.sh
> +
> +test_expect_success "setup" '
> + test_create_repo clean &&
> + (cd clean && test_commit foo) &&
> + test_create_repo dirty-wt &&
> + (cd dirty-wt && test_commit foo && rm foo.t) &&
> + test_create_repo dirty-idx &&
> + (cd dirty-idx && test_commit foo && git rm foo.t)
> +'
> +
> +test_expect_success "without flags, all repos are included" '
> + echo "." >expect &&
> + echo "clean" >>expect &&
> + echo "dirty-idx" >>expect &&
> + echo "dirty-wt" >>expect &&
> + git all | sort >actual &&
> + test_cmp expect actual
> +'
> +
> +test_expect_success "--dirty only includes dirty repos" '
> + echo "dirty-idx" >expect &&
> + echo "dirty-wt" >>expect &&
> + git all --dirty | sort >actual &&
> + test_cmp expect actual
> +'
> +
> +test_expect_success "--clean only includes clean repos" '
> + echo "." >expect &&
> + echo "clean" >>expect &&
> + git all --clean | sort >actual &&
> + test_cmp expect actual
> +'
> +
> +test_done
> --
> 1.8.1.1.296.g725455c
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
David
^ 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