* Release notes link on homepage 404
From: Lionel Elie Mamane @ 2011-10-11 15:58 UTC (permalink / raw)
To: git
The "Release Notes" link on http://git-scm.com/ is a 404
--
Lionel
^ permalink raw reply
* [PATCH v4] attr.c: respect core.ignorecase when matching attribute patterns
From: Brandon Casey @ 2011-10-11 15:53 UTC (permalink / raw)
To: gitster; +Cc: git, mhagger, Brandon Casey
In-Reply-To: <4E93BBA8.6080403@alum.mit.edu>
From: Brandon Casey <drafnel@gmail.com>
When core.ignorecase is true, the file globs configured in the
.gitattributes file should be matched case-insensitively against the paths
in the working directory. Let's do so.
Plus, add some tests.
The last set of tests is performed only on a case-insensitive filesystem.
Those tests make sure that git handles the case where the .gitignore file
resides in a subdirectory and the user supplies a path that does not match
the case in the filesystem. In that case^H^H^H^Hsituation, part of the
path supplied by the user is effectively interpreted case-insensitively,
and part of it is dependent on the setting of core.ignorecase. git will
currently only match the portion of the path below the directory holding
the .gitignore file according to the setting of core.ignorecase.
This is also partly future-proofing. Currently, git builds the attr stack
based on the path supplied by the user, so we don't have to do anything
special (like use strcmp_icase) to handle the parts of that path that don't
match the filesystem with respect to case. If git instead built the attr
stack by scanning the repository, then the paths in the origin field would
not necessarily match the paths supplied by the user. If someone makes a
change like that in the future, these tests will notice.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
On Mon, Oct 10, 2011 at 10:44 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> On 10/10/2011 08:01 PM, Brandon Casey wrote:
>> On Sun, Oct 9, 2011 at 10:16 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
>> Maybe my commit message is not clear that it is describing the current
>> behavior and not defining it. Instead of
>>
>> git should only match the portion of the path below the directory
>> holding the .gitignore file according to the setting of
>> core.ignorecase.
>>
>> maybe I should say
>>
>> git will currently only match the portion of the path...
>>
>> I could also remove the following test from the CASE_INSENSITIVE_FS
>> tests since it is really a dontcare:
>>
>> attr_check A/b/h a/b/h "-c core.ignorecase=0"
>>
>> We don't care what happens when the user supplies A/b/h and a/b/h
>> exists on disk when core.ignorecase=0, we only care that A/b/h is
>> interpreted correctly when core.ignorecase=1.
>
> Sounds good to me.
Ok, here it is.
Minor tweak which, hopefully, adds clarity to the commit message and
removes an unnecessary test.
On top of bc/attr-ignore-case^ 64589a03a8ffb3eb4fb2ff8f416ff638a9aaa439.
-Brandon
attr.c | 5 ++-
t/t0003-attributes.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/attr.c b/attr.c
index 124337d..76b079f 100644
--- a/attr.c
+++ b/attr.c
@@ -11,6 +11,7 @@
#include "cache.h"
#include "exec_cmd.h"
#include "attr.h"
+#include "dir.h"
const char git_attr__true[] = "(builtin)true";
const char git_attr__false[] = "\0(builtin)false";
@@ -631,7 +632,7 @@ static int path_matches(const char *pathname, int pathlen,
/* match basename */
const char *basename = strrchr(pathname, '/');
basename = basename ? basename + 1 : pathname;
- return (fnmatch(pattern, basename, 0) == 0);
+ return (fnmatch_icase(pattern, basename, 0) == 0);
}
/*
* match with FNM_PATHNAME; the pattern has base implicitly
@@ -645,7 +646,7 @@ static int path_matches(const char *pathname, int pathlen,
return 0;
if (baselen != 0)
baselen++;
- return fnmatch(pattern, pathname + baselen, FNM_PATHNAME) == 0;
+ return fnmatch_icase(pattern, pathname + baselen, FNM_PATHNAME) == 0;
}
static int macroexpand_one(int attr_nr, int rem);
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index ae2f1da..6946c4b 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -9,7 +9,7 @@ attr_check () {
path="$1"
expect="$2"
- git check-attr test -- "$path" >actual 2>err &&
+ git $3 check-attr test -- "$path" >actual 2>err &&
echo "$path: test: $2" >expect &&
test_cmp expect actual &&
test_line_count = 0 err
@@ -27,6 +27,7 @@ test_expect_success 'setup' '
echo "onoff test -test"
echo "offon -test test"
echo "no notest"
+ echo "A/e/F test=A/e/F"
) >.gitattributes &&
(
echo "g test=a/g" &&
@@ -93,6 +94,62 @@ test_expect_success 'attribute test' '
'
+test_expect_success 'attribute matching is case sensitive when core.ignorecase=0' '
+
+ test_must_fail attr_check F f "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/F f "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/c/F f "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/G a/g "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/B/g a/b/g "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/b/G a/b/g "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/b/H a/b/h "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=0" &&
+ test_must_fail attr_check oNoFf unset "-c core.ignorecase=0" &&
+ test_must_fail attr_check oFfOn set "-c core.ignorecase=0" &&
+ attr_check NO unspecified "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
+ attr_check a/b/d/YES a/b/d/* "-c core.ignorecase=0" &&
+ test_must_fail attr_check a/E/f "A/e/F" "-c core.ignorecase=0"
+
+'
+
+test_expect_success 'attribute matching is case insensitive when core.ignorecase=1' '
+
+ attr_check F f "-c core.ignorecase=1" &&
+ attr_check a/F f "-c core.ignorecase=1" &&
+ attr_check a/c/F f "-c core.ignorecase=1" &&
+ attr_check a/G a/g "-c core.ignorecase=1" &&
+ attr_check a/B/g a/b/g "-c core.ignorecase=1" &&
+ attr_check a/b/G a/b/g "-c core.ignorecase=1" &&
+ attr_check a/b/H a/b/h "-c core.ignorecase=1" &&
+ attr_check a/b/D/g "a/b/d/*" "-c core.ignorecase=1" &&
+ attr_check oNoFf unset "-c core.ignorecase=1" &&
+ attr_check oFfOn set "-c core.ignorecase=1" &&
+ attr_check NO unspecified "-c core.ignorecase=1" &&
+ attr_check a/b/D/NO "a/b/d/*" "-c core.ignorecase=1" &&
+ attr_check a/b/d/YES unspecified "-c core.ignorecase=1" &&
+ attr_check a/E/f "A/e/F" "-c core.ignorecase=1"
+
+'
+
+test_expect_success 'check whether FS is case-insensitive' '
+ mkdir junk &&
+ echo good >junk/CamelCase &&
+ echo bad >junk/camelcase &&
+ if test "$(cat junk/CamelCase)" != good
+ then
+ test_set_prereq CASE_INSENSITIVE_FS
+ fi
+'
+
+test_expect_success CASE_INSENSITIVE_FS 'additional case insensitivity tests' '
+ test_must_fail attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=0" &&
+ test_must_fail attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=0" &&
+ attr_check A/b/h a/b/h "-c core.ignorecase=1" &&
+ attr_check a/B/D/g "a/b/d/*" "-c core.ignorecase=1" &&
+ attr_check A/B/D/NO "a/b/d/*" "-c core.ignorecase=1"
+'
+
test_expect_success 'unnormalized paths' '
attr_check ./f f &&
--
1.7.7.138.g7f41b6
^ permalink raw reply related
* Re: [PATCHv5/RFC 1/6] Documentation: Preparation for gitweb manpages
From: Jakub Narebski @ 2011-10-11 15:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Drew Northup, Jonathan Nieder
In-Reply-To: <7v62jwjvdk.fsf@alter.siamese.dyndns.org>
On Tue, 11 Oct 2011, Junio C Hamano wrote:
> I probably do not have time to look into this, but just FYI my trial merge
> to 'pu' of this topic is failing like this:
>
> asciidoc: ERROR: gitweb.conf.txt: line 484: illegal style name: Default: ()
> asciidoc: ERROR: gitweb.conf.txt: line 494: illegal style name: Default: 300
Damn, I thought I have fixed that. This probably depends on AsciiDoc
version ("make doc" on 'master' generates a few _warnings_ for me related
to similar situation), but the problem is with
[Default: <value>]
that was copied from gitweb/README. But [<sth>] is an attribute list
(style name in simplest form), used more often in newer AsciiDoc.
So either we have to escape '[' and ']', i.e. use {startsb} and {endsb},
which would reduce human-friendliness, or move to different way of marking
default values, e.g. _italic_.
What do you think?
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCHv5/RFC 3/6] gitweb: Add manpage for gitweb (APPLICATION!!!)
From: Jakub Narebski @ 2011-10-11 14:20 UTC (permalink / raw)
To: Drew Northup; +Cc: Junio C Hamano, git, Jonathan Nieder
In-Reply-To: <1318341714.22324.46.camel@drew-northup.unet.maine.edu>
On Tue, 11 Oct 2011, Drew Northup wrote:
> On Tue, 2011-10-11 at 15:51 +0200, Jakub Narebski wrote:
> > On Tue, 11 Oct 2011, Drew Northup wrote:
>
> > > This would be why I included a synopsis with my original submission. As
> > > this was supposed to be a description of the configuration files of said
> > > application it does not make much sense to put the executable in the
> > > synopsis. Please forgive me for attempting to make sense!
> >
> > But this manpage is about _gitweb itself_, not about gitweb config file(s).
> > Gitweb itself is application, though it is not runnable directly (yet).
> >
> > Web apps either don't use manpages as documentation, and those that do
> > that I found (SVN::Web for example) include runnable server-starting script.
>
> Hmm, Couldn't tell from the mail header _which_ we were talking about in
> this subthread. I'll have to read the _whole_ patch apparently next
> time.
I'm sorry. I guess better subjects would be:
gitweb: Add gitweb.conf(5) manpage
gitweb: Add gitweb(1) manpage
instead of current
gitweb: Add manpage for gitweb configuration files
gitweb: Add manpage for gitweb
Or perhaps:
gitweb: Add manpage for gitweb configuration files
gitweb: Add manpage for gitweb itself
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: Display line numbers in gitk?
From: Sebastian Schuberth @ 2011-10-11 14:16 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git
In-Reply-To: <CABNJ2GLaquXK7o_V_6KmOtnbcCGXMgbupbVJzXU_yK=2a=wKSg@mail.gmail.com>
On Tue, Oct 11, 2011 at 16:00, Pat Thoyts <patthoyts@gmail.com> wrote:
(putting the list back on CC)
> Not currently possible. It can be done though. Is this just for the
> file view or patch view as well?
> The following seems to work reasonably well for just the file view.
Thanks, from my tests it seems to work indeed very well. Although I
was initially thinking about the patch view.
A downside of line numbers in the file view could be that they'll be
copied to the clipboard, too, if you copy and paste code from there,
so they should probably be implemented as an option.
> From 0e18a9a2789838925f2ed50b05ce9d7e6c3a9a38 Mon Sep 17 00:00:00 2001
> From: Pat Thoyts <patthoyts@users.sourceforge.net>
> Date: Tue, 11 Oct 2011 14:57:24 +0100
> Subject: [PATCH] gitk: display line numbers for file view
>
> Suggested-by: Sebastian Schuberth <sschuberth@gmail.com>
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
> ---
> gitk | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/gitk b/gitk
> index 4cde0c4..70d8f57 100755
> --- a/gitk
> +++ b/gitk
> @@ -2277,6 +2277,9 @@ proc makewindow {} {
> if {$have_tk85} {
> $ctext conf -tabstyle wordprocessor
> }
> + catch {eval font create linenofont [font configure textfont] \
> + -size [expr {[font configure textfont -size] - 2}]}
> + $ctext tag configure lineno -foreground #808080 -font linenofont
> ${NS}::scrollbar .bleft.bottom.sb -command "$ctext yview"
> ${NS}::scrollbar .bleft.bottom.sbhorizontal -command "$ctext
> xview" -orient h
> pack .bleft.top -side top -fill x
> @@ -7316,7 +7319,7 @@ proc getblobline {bf id} {
> $ctext config -state normal
> set nl 0
> while {[incr nl] <= 1000 && [gets $bf line] >= 0} {
> - $ctext insert end "$line\n"
> + $ctext insert end $nl lineno "\t" {} "$line\n"
> }
> if {[eof $bf]} {
> global jump_to_here ctext_file_names commentend
> --
> 1.7.7.1.gbba15
^ permalink raw reply
* Re: [PATCHv5/RFC 3/6] gitweb: Add manpage for gitweb (APPLICATION!!!)
From: Drew Northup @ 2011-10-11 14:01 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Junio C Hamano, git, Jonathan Nieder
In-Reply-To: <201110111551.09621.jnareb@gmail.com>
On Tue, 2011-10-11 at 15:51 +0200, Jakub Narebski wrote:
> On Tue, 11 Oct 2011, Drew Northup wrote:
> > This would be why I included a synopsis with my original submission. As
> > this was supposed to be a description of the configuration files of said
> > application it does not make much sense to put the executable in the
> > synopsis. Please forgive me for attempting to make sense!
>
> But this manpage is about _gitweb itself_, not about gitweb config file(s).
> Gitweb itself is application, though it is not runnable directly (yet).
>
> Web apps either don't use manpages as documentation, and those that do
> that I found (SVN::Web for example) include runnable server-starting script.
Hmm, Couldn't tell from the mail header _which_ we were talking about in
this subthread. I'll have to read the _whole_ patch apparently next
time.
Crawling back into my cave...
--
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
^ permalink raw reply
* Re: [PATCH v3] Teach merge the '[-e|--edit]' option
From: Peter Krefting @ 2011-10-11 13:57 UTC (permalink / raw)
To: Jay Soffian; +Cc: Git Mailing List, Junio C Hamano, Todd A. Jacobs
In-Reply-To: <1318099192-60860-1-git-send-email-jaysoffian@gmail.com>
Jay Soffian:
> +--edit::
> +-e::
> ++
> + Invoke editor before committing successful merge to further
> + edit the default merge message.
I have a feature request, and that is to also add a configuration option to
make this the default behaviour.
--
\\// Peter - http://www.softwolves.pp.se/
^ permalink raw reply
* Re: [PATCHv5/RFC 3/6] gitweb: Add manpage for gitweb
From: Jakub Narebski @ 2011-10-11 13:51 UTC (permalink / raw)
To: Drew Northup; +Cc: Junio C Hamano, git, Jonathan Nieder
In-Reply-To: <1318338135.22324.33.camel@drew-northup.unet.maine.edu>
On Tue, 11 Oct 2011, Drew Northup wrote:
> On Mon, 2011-10-10 at 17:18 -0500, Jonathan Nieder wrote:
> > Jakub Narebski wrote:
> >
> > > The problem is that catering to old AsciiDoc (but still used by some of
> > > long-term-support Linux distributions) requires to have "SYNOPSIS"
> > > section... but there is no natural synopsis for non self-hostable web
> > > application, is there?
> >
> > I personally think something like
> >
> > SYNOPSIS
> > --------
> > /usr/share/gitweb/gitweb.cgi
> > git instaweb
> >
> > or perhaps something like
> >
> > SYNOPSIS
> > --------
> > http://<site>/?p=<project>.git;a=<action>;h=<object>;<parameters>
> > http://<site>/<project>/<action>/<object>?<parameters>
> >
> > would be best.
>
> This would be why I included a synopsis with my original submission. As
> this was supposed to be a description of the configuration files of said
> application it does not make much sense to put the executable in the
> synopsis. Please forgive me for attempting to make sense!
But this manpage is about _gitweb itself_, not about gitweb config file(s).
Gitweb itself is application, though it is not runnable directly (yet).
Web apps either don't use manpages as documentation, and those that do
that I found (SVN::Web for example) include runnable server-starting script.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCHv5/RFC 3/6] gitweb: Add manpage for gitweb
From: Drew Northup @ 2011-10-11 13:02 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Junio C Hamano, git, Jonathan Nieder
In-Reply-To: <20111010221811.GA21367@elie.hsd1.il.comcast.net>
On Mon, 2011-10-10 at 17:18 -0500, Jonathan Nieder wrote:
> Jakub Narebski wrote:
>
> > The problem is that catering to old AsciiDoc (but still used by some of
> > long-term-support Linux distributions) requires to have "SYNOPSIS"
> > section... but there is no natural synopsis for non self-hostable web
> > application, is there?
>
> I personally think something like
>
> SYNOPSIS
> --------
> /usr/share/gitweb/gitweb.cgi
> git instaweb
>
> or perhaps something like
>
> SYNOPSIS
> --------
> http://<site>/?p=<project>.git;a=<action>;h=<object>;<parameters>
> http://<site>/<project>/<action>/<object>?<parameters>
>
> would be best.
This would be why I included a synopsis with my original submission. As
this was supposed to be a description of the configuration files of said
application it does not make much sense to put the executable in the
synopsis. Please forgive me for attempting to make sense!
--
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
^ permalink raw reply
* Re: [PATCH] Improving performance with pthreads in refresh_index().
From: Michael J Gruber @ 2011-10-11 11:50 UTC (permalink / raw)
To: klinkert; +Cc: gitster, git
In-Reply-To: <1318325521-23262-1-git-send-email-klinkert@webgods.de>
klinkert@webgods.de venit, vidit, dixit 11.10.2011 11:32:
> Git performs for every file in a repository at least one (with a cold cache)
> lstat(). In larger repositories operations like git status take a
> long time. In case your local repository is located on a remote server
> (e. g. mounted via nfs) it ends up in an *incredible* slow git.
>
> With this patch you're able to determine a number of threads (maxthreads)
> in your config file to run these tons of lstats in threads. There
> won't be created any pthreads if you haven't set maxthreads. In my
> test cases a git status with this patch performs enormously faster (over
> two minutes before and approximately 25 seconds now). Of course, it
> has a positive impact on other git commands, too.
Can you specify under which circumstances one should get a speedup? Our
NFS isn't slow enough... but on a dead slow sshfs work tree I get the
following for "git status -s":
maxthreads: 0, preloadindex: false, time: 14.73
maxthreads: 1, preloadindex: false, time: 14.25
maxthreads: 2, preloadindex: false, time: 13.32
maxthreads: 3, preloadindex: false, time: 12.40
maxthreads: 4, preloadindex: false, time: 12.65
maxthreads: 5, preloadindex: false, time: 12.16
maxthreads: 8, preloadindex: false, time: 12.32
maxthreads: 10, preloadindex: false, time: 11.98
maxthreads: 15, preloadindex: false, time: 12.31
maxthreads: 20, preloadindex: false, time: 12.00
maxthreads: 0, preloadindex: true, time: 12.17
maxthreads: 1, preloadindex: true, time: 11.98
maxthreads: 2, preloadindex: true, time: 12.21
maxthreads: 3, preloadindex: true, time: 11.99
maxthreads: 4, preloadindex: true, time: 12.14
maxthreads: 5, preloadindex: true, time: 12.21
maxthreads: 8, preloadindex: true, time: 12.14
maxthreads: 10, preloadindex: true, time: 12.08
maxthreads: 15, preloadindex: true, time: 12.16
maxthreads: 20, preloadindex: true, time: 11.96
So it seams it gives me what preloadindex does, which is not much.
Note: I'm not saying the patch is bad. I'm just wondering whether that
is expected.
Michael
P.S.: It's actually sshfs with ssh to an NFSv3 client (server restricts
exports) :(
^ permalink raw reply
* Re: [PATCH] Improving performance with pthreads in refresh_index().
From: Nguyen Thai Ngoc Duy @ 2011-10-11 10:59 UTC (permalink / raw)
To: klinkert; +Cc: gitster, git
In-Reply-To: <1318325521-23262-1-git-send-email-klinkert@webgods.de>
On Tue, Oct 11, 2011 at 8:32 PM, <klinkert@webgods.de> wrote:
> Git performs for every file in a repository at least one (with a cold cache)
> lstat(). In larger repositories operations like git status take a
> long time. In case your local repository is located on a remote server
> (e. g. mounted via nfs) it ends up in an *incredible* slow git.
This sounds really similar to what Linus did with preload-index.c..
--
Duy
^ permalink raw reply
* Re: [PATCH] Improving performance with pthreads in refresh_index().
From: Johannes Sixt @ 2011-10-11 10:46 UTC (permalink / raw)
To: klinkert; +Cc: gitster, git
In-Reply-To: <1318325521-23262-1-git-send-email-klinkert@webgods.de>
First of all, thanks for your contribution!
When you submit a patch, you should make sure that the "From:" line of
your mail includes your full name. You included it in the Signed-off-by
line and that is a good start.
Am 10/11/2011 11:32, schrieb klinkert@webgods.de:
> Git performs for every file in a repository at least one (with a cold cache)
> lstat().
It doesn't do the lstat() when the cache is warm? I doubt it.
> In larger repositories operations like git status take a
> long time. In case your local repository is located on a remote server
> (e. g. mounted via nfs) it ends up in an *incredible* slow git.
"Incredible" is very subjective. You should back your claim with benchmarks.
> With this patch you're able to determine a number of threads (maxthreads)
> in your config file to run these tons of lstats in threads. There
> won't be created any pthreads if you haven't set maxthreads. In my
> test cases a git status with this patch performs enormously faster (over
> two minutes before and approximately 25 seconds now).
Ok, so here you have something that you can turn into a benchmark. Just
replace the hand-waving by hard facts.
You report an improvement by a factor 4. How many threads did you use? How
does the number of threads change the improvement. How does the number of
threads influence the performance on a repository that is not on a network
partition? Can I set it to 25 even on a dual core machine without
noticable degradation?
> Of course, it
> has a positive impact on other git commands, too.
What other commands? Benchmarks?
> diff --git a/attr.c b/attr.c
> index 33cb4e4..d296fe8 100644
> --- a/attr.c
> +++ b/attr.c
> @@ -8,10 +8,14 @@
> */
>
> #define NO_THE_INDEX_COMPATIBILITY_MACROS
> +#include <pthread.h>
This and all pthread usages should be bracketed by NO_PTHREADS, or you
could use thread-utils.h instead. And it should be included *after* cache.h.
> +#undef _FILE_OFFSET_BITS
What is this good for?
> #include "cache.h"
> #include "exec_cmd.h"
> #include "attr.h"
>
> +pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
This should be static, no? Otherwise, the name is *WAY* too generic for a
global variable.
What does the mutex protect? Please write some comment. It is not obvious.
Or perhaps it is sufficient to move the variable near the data that it
protects.
PTHREAD_MUTEX_INITIALIZER does not work on Windows. Please call
pthread_mutex_init() from a suitable place.
> +
> const char git_attr__true[] = "(builtin)true";
> const char git_attr__false[] = "\0(builtin)false";
> static const char git_attr__unknown[] = "(builtin)unknown";
> @@ -748,6 +752,9 @@ int git_check_attr(const char *path, int num, struct git_attr_check *check)
> {
> int i;
>
> + if (max_threads)
> + pthread_mutex_lock(&mutex);
As I said, this should be bracketed by #ifndef NO_PTHREADS. But since you
also bracket all mutex uses by max_threads anyway, you should factor this
into a small helper function.
> --- a/cache.h
> +++ b/cache.h
> @@ -600,6 +600,7 @@ extern int read_replace_refs;
> extern int fsync_object_files;
> extern int core_preload_index;
> extern int core_apply_sparse_checkout;
> +extern int max_threads;
This name is *WAY* too generic for a global variable. Please choose a more
specific name.
> --- a/config.c
> +++ b/config.c
> @@ -466,6 +466,11 @@ int git_config_pathname(const char **dest, const char *var, const char *value)
>
> static int git_default_core_config(const char *var, const char *value)
> {
> + if (!strcmp(var, "core.maxthreads")) {
Same here. core.maxthreads is *WAY* too generic for its current use.
Please paint the bikeshed in a more distiguishing color. ;)
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -5,6 +5,8 @@
> */
> #define NO_THE_INDEX_COMPATIBILITY_MACROS
> #include "cache.h"
> +#undef _FILE_OFFSET_BITS
Again: why this?
> +#include <pthread.h>
> #include "cache-tree.h"
> #include "refs.h"
> #include "dir.h"
> @@ -13,6 +15,8 @@
> #include "blob.h"
> #include "resolve-undo.h"
>
> +pthread_mutex_t mutex_refresh_index = PTHREAD_MUTEX_INITIALIZER;
Should be static, no?
> static void show_file(const char * fmt, const char * name, int in_porcelain,
> - int * first, const char *header_msg)
> + int * first, char *header_msg)
Why?
> -int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,
> - char *seen, const char *header_msg)
> +struct t_ctx {
> + int flags;
> + int has_errors;
> + struct index_state *istate;
> + const char **pathspec;
> + char *seen, header_msg;
> +
> + int tasks_done;
> +} ctx;
Should this be static? Is this the only global data that is protected by
the mutex?
> +
> +int
> +thread_manager(void)
Style: the type is on the same line as the function name.
> +void *
> +thread_refresh_index(void *p)
> {
> + struct cache_entry *ce, *new;
> + int cache_errno = 0;
> int i;
> - int has_errors = 0;
> +
> + while ((i = thread_manager()) != -1) {
> + struct index_state *istate = ctx.istate;
> + int flags = ctx.flags;
> +
> int really = (flags & REFRESH_REALLY) != 0;
> int allow_unmerged = (flags & REFRESH_UNMERGED) != 0;
> int quiet = (flags & REFRESH_QUIET) != 0;
> int not_new = (flags & REFRESH_IGNORE_MISSING) != 0;
> - int ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;
> + int ignore_submodules =
> + (flags & REFRESH_IGNORE_SUBMODULES) != 0;
Indentation?
Perhaps it is worthwhile to factor the body of the loop into a helper
function in a preparatory patch to reduce churn in the "real" patch.
> ce = istate->cache[i];
> - if (ignore_submodules && S_ISGITLINK(ce->ce_mode))
> + if (ignore_submodules && S_ISGITLINK(ce->ce_mode)) {
> continue;
> + }
Style: do not add braces unnecessarily.
> +
> + if (max_threads)
> + pthread_mutex_lock(&mutex_refresh_index);
>
> if (ce_stage(ce)) {
> while ((i < istate->cache_nr) &&
> ! strcmp(istate->cache[i]->name, ce->name))
> i++;
> i--;
> - if (allow_unmerged)
> + if (allow_unmerged) {
> + if (max_threads)
> + pthread_mutex_unlock(&mutex_refresh_index);
> continue;
> - show_file(needs_merge_fmt, ce->name, in_porcelain, &first, header_msg);
> - has_errors = 1;
> + }
> + show_file(needs_merge_fmt, ce->name, in_porcelain,
> + &first, &ctx.header_msg);
You are calling show_file() from the thread. Does that mean that the
output is not in index order anymore? Are there guarantees that the output
of different threads does not overlap?
> + ctx.has_errors = 1;
> + if (max_threads)
> + pthread_mutex_unlock(&mutex_refresh_index);
So, at least the second worry is unfounded since output is produced while
the mutex is held.
BTW, would it be possible to use a different mutex for this purpose?
> + /* create threads */
> + for (i = 0; i < max_threads; i++) {
> + ret = pthread_create(&threads[created_threads], NULL,
> + thread_refresh_index, NULL);
> + if (ret) {
> + printf("pthread_create failed ret=%d\n", ret);
We have warning() to write warnings.
-- Hannes
^ permalink raw reply
* [PATCH] Improving performance with pthreads in refresh_index().
From: klinkert @ 2011-10-11 9:32 UTC (permalink / raw)
To: gitster; +Cc: git
Git performs for every file in a repository at least one (with a cold cache)
lstat(). In larger repositories operations like git status take a
long time. In case your local repository is located on a remote server
(e. g. mounted via nfs) it ends up in an *incredible* slow git.
With this patch you're able to determine a number of threads (maxthreads)
in your config file to run these tons of lstats in threads. There
won't be created any pthreads if you haven't set maxthreads. In my
test cases a git status with this patch performs enormously faster (over
two minutes before and approximately 25 seconds now). Of course, it
has a positive impact on other git commands, too.
Signed-off-by: Simon Klinkert <klinkert@webgods.de>
---
attr.c | 22 +++++++++
cache.h | 1 +
config.c | 5 ++
environment.c | 1 +
read-cache.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++-------
5 files changed, 151 insertions(+), 18 deletions(-)
diff --git a/attr.c b/attr.c
index 33cb4e4..d296fe8 100644
--- a/attr.c
+++ b/attr.c
@@ -8,10 +8,14 @@
*/
#define NO_THE_INDEX_COMPATIBILITY_MACROS
+#include <pthread.h>
+#undef _FILE_OFFSET_BITS
#include "cache.h"
#include "exec_cmd.h"
#include "attr.h"
+pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
const char git_attr__true[] = "(builtin)true";
const char git_attr__false[] = "\0(builtin)false";
static const char git_attr__unknown[] = "(builtin)unknown";
@@ -748,6 +752,9 @@ int git_check_attr(const char *path, int num, struct git_attr_check *check)
{
int i;
+ if (max_threads)
+ pthread_mutex_lock(&mutex);
+
collect_all_attrs(path);
for (i = 0; i < num; i++) {
@@ -757,6 +764,9 @@ int git_check_attr(const char *path, int num, struct git_attr_check *check)
check[i].value = value;
}
+ if (max_threads)
+ pthread_mutex_unlock(&mutex);
+
return 0;
}
@@ -764,6 +774,9 @@ int git_all_attrs(const char *path, int *num, struct git_attr_check **check)
{
int i, count, j;
+ if (max_threads)
+ pthread_mutex_lock(&mutex);
+
collect_all_attrs(path);
/* Count the number of attributes that are set. */
@@ -785,6 +798,9 @@ int git_all_attrs(const char *path, int *num, struct git_attr_check **check)
}
}
+ if (max_threads)
+ pthread_mutex_unlock(&mutex);
+
return 0;
}
@@ -795,8 +811,14 @@ void git_attr_set_direction(enum git_attr_direction new, struct index_state *ist
if (is_bare_repository() && new != GIT_ATTR_INDEX)
die("BUG: non-INDEX attr direction in a bare repo");
+ if (max_threads)
+ pthread_mutex_lock(&mutex);
+
direction = new;
if (new != old)
drop_attr_stack();
use_index = istate;
+
+ if (max_threads)
+ pthread_mutex_unlock(&mutex);
}
diff --git a/cache.h b/cache.h
index 607c2ea..ab1b3e4 100644
--- a/cache.h
+++ b/cache.h
@@ -600,6 +600,7 @@ extern int read_replace_refs;
extern int fsync_object_files;
extern int core_preload_index;
extern int core_apply_sparse_checkout;
+extern int max_threads;
enum branch_track {
BRANCH_TRACK_UNSPECIFIED = -1,
diff --git a/config.c b/config.c
index 4183f80..24de139 100644
--- a/config.c
+++ b/config.c
@@ -466,6 +466,11 @@ int git_config_pathname(const char **dest, const char *var, const char *value)
static int git_default_core_config(const char *var, const char *value)
{
+ if (!strcmp(var, "core.maxthreads")) {
+ max_threads = git_config_int(var, value);
+ return 0;
+ }
+
/* This needs a better name */
if (!strcmp(var, "core.filemode")) {
trust_executable_bit = git_config_bool(var, value);
diff --git a/environment.c b/environment.c
index e96edcf..8bca4d5 100644
--- a/environment.c
+++ b/environment.c
@@ -59,6 +59,7 @@ char *notes_ref_name;
int grafts_replace_parents = 1;
int core_apply_sparse_checkout;
struct startup_info *startup_info;
+int max_threads = 1;
/* Parallel index stat data preload? */
int core_preload_index = 0;
diff --git a/read-cache.c b/read-cache.c
index 01a0e25..350bf4b 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -5,6 +5,8 @@
*/
#define NO_THE_INDEX_COMPATIBILITY_MACROS
#include "cache.h"
+#undef _FILE_OFFSET_BITS
+#include <pthread.h>
#include "cache-tree.h"
#include "refs.h"
#include "dir.h"
@@ -13,6 +15,8 @@
#include "blob.h"
#include "resolve-undo.h"
+pthread_mutex_t mutex_refresh_index = PTHREAD_MUTEX_INITIALIZER;
+
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really);
/* Index extensions.
@@ -1080,7 +1084,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
}
static void show_file(const char * fmt, const char * name, int in_porcelain,
- int * first, const char *header_msg)
+ int * first, char *header_msg)
{
if (in_porcelain && *first && header_msg) {
printf("%s\n", header_msg);
@@ -1089,45 +1093,96 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,
printf(fmt, name);
}
-int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,
- char *seen, const char *header_msg)
+struct t_ctx {
+ int flags;
+ int has_errors;
+ struct index_state *istate;
+ const char **pathspec;
+ char *seen, header_msg;
+
+ int tasks_done;
+} ctx;
+
+int
+thread_manager(void)
+{
+ if (max_threads)
+ pthread_mutex_lock(&mutex_refresh_index);
+
+ if (ctx.tasks_done >= ctx.istate->cache_nr) {
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
+ return -1;
+ }
+
+ int task = ctx.tasks_done++;
+
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
+
+ return task;
+}
+
+void *
+thread_refresh_index(void *p)
{
+ struct cache_entry *ce, *new;
+ int cache_errno = 0;
int i;
- int has_errors = 0;
+
+ while ((i = thread_manager()) != -1) {
+ struct index_state *istate = ctx.istate;
+ int flags = ctx.flags;
+
int really = (flags & REFRESH_REALLY) != 0;
int allow_unmerged = (flags & REFRESH_UNMERGED) != 0;
int quiet = (flags & REFRESH_QUIET) != 0;
int not_new = (flags & REFRESH_IGNORE_MISSING) != 0;
- int ignore_submodules = (flags & REFRESH_IGNORE_SUBMODULES) != 0;
+ int ignore_submodules =
+ (flags & REFRESH_IGNORE_SUBMODULES) != 0;
int first = 1;
int in_porcelain = (flags & REFRESH_IN_PORCELAIN);
unsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;
const char *needs_update_fmt;
const char *needs_merge_fmt;
- needs_update_fmt = (in_porcelain ? "M\t%s\n" : "%s: needs update\n");
- needs_merge_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
- for (i = 0; i < istate->cache_nr; i++) {
- struct cache_entry *ce, *new;
- int cache_errno = 0;
+ needs_update_fmt =
+ (in_porcelain ? "M\t%s\n" : "%s: needs update\n");
+ needs_merge_fmt =
+ (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
ce = istate->cache[i];
- if (ignore_submodules && S_ISGITLINK(ce->ce_mode))
+ if (ignore_submodules && S_ISGITLINK(ce->ce_mode)) {
continue;
+ }
+
+ if (max_threads)
+ pthread_mutex_lock(&mutex_refresh_index);
if (ce_stage(ce)) {
while ((i < istate->cache_nr) &&
! strcmp(istate->cache[i]->name, ce->name))
i++;
i--;
- if (allow_unmerged)
+ if (allow_unmerged) {
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
continue;
- show_file(needs_merge_fmt, ce->name, in_porcelain, &first, header_msg);
- has_errors = 1;
+ }
+ show_file(needs_merge_fmt, ce->name, in_porcelain,
+ &first, &ctx.header_msg);
+ ctx.has_errors = 1;
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
continue;
}
- if (pathspec && !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
+
+ if (ctx.pathspec && !match_pathspec(ctx.pathspec, ce->name,
+ strlen(ce->name), 0,
+ ctx.seen))
continue;
new = refresh_cache_ent(istate, ce, options, &cache_errno);
@@ -1145,14 +1200,63 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
}
if (quiet)
continue;
- show_file(needs_update_fmt, ce->name, in_porcelain, &first, header_msg);
- has_errors = 1;
+
+ if (max_threads)
+ pthread_mutex_lock(&mutex_refresh_index);
+
+ show_file(needs_update_fmt, ce->name, in_porcelain,
+ &first, &ctx.header_msg);
+
+ if (max_threads)
+ pthread_mutex_unlock(&mutex_refresh_index);
+
+ ctx.has_errors = 1;
continue;
}
replace_index_entry(istate, i, new);
}
- return has_errors;
+ return NULL;
+}
+
+int refresh_index(struct index_state *istate, unsigned int flags,
+ const char **pathspec, char *seen, const char *header_msg)
+{
+ int i;
+ int ret;
+ unsigned int created_threads = 0;
+
+ ctx.has_errors = 0;
+ ctx.tasks_done = 0;
+ ctx.istate = istate;
+ ctx.flags = flags;
+ ctx.pathspec = &pathspec[0];
+
+ if (istate->cache_nr < max_threads)
+ max_threads = istate->cache_nr;
+
+ if (max_threads > 1) {
+ pthread_t threads[max_threads];
+
+ /* create threads */
+ for (i = 0; i < max_threads; i++) {
+ ret = pthread_create(&threads[created_threads], NULL,
+ thread_refresh_index, NULL);
+ if (ret) {
+ printf("pthread_create failed ret=%d\n", ret);
+ break;
+ }
+ ++created_threads;
+ }
+
+ /* collect threads */
+ for (i = 0; i < created_threads; i++) {
+ ret = pthread_join(threads[i], NULL);
+ }
+ } else {
+ thread_refresh_index(NULL);
+ }
+ return ctx.has_errors;
}
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really)
--
1.7.7
^ permalink raw reply related
* Submodule confusion when checking out branch
From: Howard Miller @ 2011-10-11 9:38 UTC (permalink / raw)
To: git
I added a submodule to my project like this (all from the root of the project)
git submodule add git@..... path/to/submodule
git submodule init
git add path/to/submodule
git commit -m 'I added a submodule!'
git push
All looks good and 'git status' reports 'nothing to commit'
However, I now cannot change branches. On checkout, I get...
"error: The following untracked working tree files would be
overwritten by checkout:"
(followed by a big list of all the files in the submodule)
Where did I go wrong and what can I do to sort it?
Thanks again!
^ permalink raw reply
* Re: [PATCH 2/2] submodule::module_clone(): silence die() message from module_name()
From: Tay Ray Chuan @ 2011-10-11 8:44 UTC (permalink / raw)
To: Jens Lehmann; +Cc: git, Junio C Hamano, David Aguilar
In-Reply-To: <4E9348A8.5000500@web.de>
On Tue, Oct 11, 2011 at 3:34 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> BTW: this patch applies to next
>
> Am 07.10.2011 11:04, schrieb Tay Ray Chuan:
>> The die() message that may occur in module_name() is not really relevant
>> to the user when called from module_clone(); the latter handles the
>> "failure" (no submodule mapping) anyway.
>
> Makes tons of sense, especially as adding a new submodule currently always
> spews out the "No submodule mapping found in .gitmodules for path 'sub'"
> message right before that mapping is added there. Thanks for noticing that
> and ACK on that change from my side.
Thanks for the review.
>> Leave other callers of module_name() unchanged, as the die() message
>> shown is either relevant for user consumption (such as those that exit()
>> when the call fails), or will not occur at all (when called with paths
>> returned by module_list()).
>
> Hmm, while I agree on the first reasoning I'm not sure about the second.
> module_list() asks the index for the submodule paths while module_name()
> gets it's input from .gitmodules, so they can (and sometimes will)
> disagree.
Oh, you're right. I neglected to see how module_list() actually worked.
> When cmd_foreach() passes an empty "name" variable to the
> spawned command that might still work (and even make sense), but using the
> empty name in cmd_sync() to access the config is looking like an error to
> me. It might make sense to add an "|| exit" at least to the callsite in
> cmd_sync(). Or am I missing something here?
Cc-ed David, who authored cmd_sync().
David, what do you think of Jens' analysis?
In the meantime, I'll probably reword the second paragraph to say that
future work will be needed to analyze non- || exit callsites.
--
Cheers,
Ray Chuan
^ permalink raw reply
* Re: [PATCH v2 0/7] Provide API to invalidate refs cache
From: Julian Phillips @ 2011-10-11 8:09 UTC (permalink / raw)
To: Michael Haggerty
Cc: Junio C Hamano, git, Jeff King, Drew Northup, Jakub Narebski,
Heiko Voigt, Johan Herland, Martin Fick, Christian Couder,
Christian Couder, Thomas Rast
In-Reply-To: <4E93D932.6020001@alum.mit.edu>
On Tue, 11 Oct 2011 07:50:42 +0200, Michael Haggerty wrote:
> And this rebase will be work with no benefit, because my series
> includes
> all of the improvements of jp/get-ref-dir-unsorted plus much more.
> But
> my change to the data structure is implemented in a different order
> and
> following other improvements. For example, I add a lot of comments,
> change a lot of code to use the cached_refs data structure more
> consistently, and accommodate partly-sorted lists by the time my
> patch
> series includes everything that is in jp/get-ref-dir-unsorted.
>
> Rebasing 78 patches is going to be a morass of clerical work. Is
> there
> any alternative?
If you create a new commit that reverts the problematic changes to
refs.c with some suitable message about doing the same thing more
piecemeal as the first change of a new series, and rebase your changes
on top, you should be able to create a 79 patch series with little work.
Dunno if that would acceptable for merging?
--
Julian
^ permalink raw reply
* Re: [PATCH 0/9] i18n: add PO files to po/
From: Peter Krefting @ 2011-10-11 7:58 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ævar Arnfjörð Bjarmason, Jonathan Nieder,
Git Mailing List, Ramkumar Ramachandra, Marcin Cieślak,
Sam Reed, Jan Engelhardt, Jan Krüger,
Nguyễn Thái Ngọc
In-Reply-To: <alpine.DEB.2.00.1110061025590.18528@ds9.cixit.se>
Peter Krefting:
> I have experience working with Translation Project, both as a software
> maintainer requesting translation, and as a translator doing translations,
> and I am interested in setting up a po repository for Git and use TP to
> maintain translations (or directly, for those that would prefer that).
I have now extracted the po/ directory from Ævar's ab/i18n branch and made
them available in a repository on Github: https://github.com/nafmo/git-po
--
\\// Peter - http://www.softwolves.pp.se/
^ permalink raw reply
* Re: [PATCH] commit: teach --gpg-sign option
From: Michael J Gruber @ 2011-10-11 6:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vaa98okwl.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 10.10.2011 18:45:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
>
>> What norm? --amend keeps some header fields and discards others. In
>> fact, signing a commit "without changing it" (i.e. keeping tree, parents
>> etc., alias "--amend -C HEAD") should be the normal use case for signing
>> the tip of an existing branch. I mean, I have no problems adding to this:
>>
>> git help fixup
>> `git fixup' is aliased to `commit --amend -C HEAD'
>
> You are *additionally* saying "-C HEAD" in an non-standard alias. Isn't
> that enough indication that a vanila "--amend" is intended to record the
> commit based on the updated context in which the new commit is made?
> E.g. the authorship of the patch is still the same but committer
> information is updated.
I was more referring to leaving "parent" and "tree" headers in place,
which is a bit of a screwed comparison (because it relies on an
unchanged index).
>> But what is the best default for the workflows that we encourage (commit
>> early, ...)? You answer a pull-request which happens to be a
>> fast-forward, sign the tip and suddenly you've taken over ownership (and
>> changed dates)??? Signing a commit should not do this.
>
> I personally think a pull that is made in response to a pull-request,
> i.e. the upstream merging from lieutenant, especially when the
> authenticity of the puller matters, is perfectly fine with --no-ff.
Yeah, --no-ff would work. I guess we should find out what our "main
customers" need here, since our own patch-based workflow is irrelevant,
and either approach works with our "single push authority". Seems
--no-ff is an easy solution to multiple sigs.
> Unlike the sign-less "we together made these history and nobody really
> owns the result" (aka "Linus hates --no-ff merge because people do that to
> leave a mark by peeing in the snow, without adding anything of value in
> the history"), the whole purpose of signing a commit in the scenario you
> mentioned is for the puller to leave his mark in the history.
diff --git i/Documentation/merge-options.txt
w/Documentation/merge-options.txt
index b613d4e..74d6a05 100644
--- i/Documentation/merge-options.txt
+++ w/Documentation/merge-options.txt
@@ -7,6 +7,13 @@ With --no-commit perform the merge but pretend the merge
failed and do not autocommit, to give the user a chance to
inspect and further tweak the merge result before committing.
+--pee::
+--no-pee::
+ This activates `--commit` and `--no-ff` and passes
+ `--gpg-sign` to `commit`.
++
+Use `--no-pee` if you do not want or need to pee.
+
--ff::
--no-ff::
Do not generate a merge commit if the merge resolved as
:)
Michael
^ permalink raw reply related
* Re: [PATCH v2 1/7] invalidate_ref_cache(): rename function from invalidate_cached_refs()
From: Michael Haggerty @ 2011-10-11 5:53 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Drew Northup, Jakub Narebski, Heiko Voigt,
Johan Herland
In-Reply-To: <7vfwj0iehl.fsf@alter.siamese.dyndns.org>
On 10/11/2011 02:00 AM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>
>> It is the cache that is being invalidated, not the references.
>>
>> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
>> ---
>
> Although I think one can say "ref cache is the container for cached refs"
> and invalidating the "ref cache" as the container and invalidating the
> "cached refs" as a collection mean essentially the same thing, probably
> the new name makes more sense.
I certainly didn't mean to imply that the old name was incorrect. I
just think that the new name removes a tiny bit of ambiguity.
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* Re: [PATCH v2 0/7] Provide API to invalidate refs cache
From: Michael Haggerty @ 2011-10-11 5:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Jeff King, Drew Northup, Jakub Narebski, Heiko Voigt,
Johan Herland, Julian Phillips, Martin Fick, Christian Couder,
Christian Couder, Thomas Rast
In-Reply-To: <7vty7ggzum.fsf@alter.siamese.dyndns.org>
On 10/11/2011 02:02 AM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>> These patches apply on top of mh/iterate-refs, which is in next but
>> not in master.
>
> Building your series on mh/iterate-refs would unfortunately make the
> conflict resolution worse. It would have been better if this were based on
> a merge between mh/iterate-refs and jp/get-ref-dir-unsorted (which already
> has happened on 'master' as of fifteen minutes ago).
AAAAaaaarrrgghh did that really have to happen?!?
> I could rebase your series, but it always is more error prone to have
> somebody who is not the original author rebase a series than the original
> author build for the intended base tree from the beginning.
I don't mind rebasing this little series on jp/get-ref-dir-unsorted.
But it's going to be an utter nightmare (as in, "can I even muster the
energy to do so much pointless work") to rebase my much bigger
hierarchical-refs series [1] onto jp/get-ref-dir-unsorted. The latter
makes changes all over refs.c and changes several things at once
(separate ref_entry out of ref_list, change current_ref to a ref_entry*,
rename ref_list to ref_array, change data structure to array plus
rewrite all loops, change to binary search). And
jp/get-ref-dir-unsorted includes a change that was inspired by my patch
series [2], so it is not like jp/get-ref-dir-unsorted was developed in
complete isolation from hierarchical-refs.
And this rebase will be work with no benefit, because my series includes
all of the improvements of jp/get-ref-dir-unsorted plus much more. But
my change to the data structure is implemented in a different order and
following other improvements. For example, I add a lot of comments,
change a lot of code to use the cached_refs data structure more
consistently, and accommodate partly-sorted lists by the time my patch
series includes everything that is in jp/get-ref-dir-unsorted.
Rebasing 78 patches is going to be a morass of clerical work. Is there
any alternative?
Michael
PS: I see that some confusion might have been caused by one of my emails
[3], where I mistakenly approved of the merge of jp/get-ref-dir-unsorted
(meaning the "Don't sort ref_list too early" part) just before asking
that jp/get-ref-dir-unsorted not be merged (meaning the rest). So maybe
I brought this whole mess down on my own head :-(
[1] branch hierarchical-refs on git://github.com/mhagger/git.git
[2] http://marc.info/?l=git&m=131740585620461&w=2
[3] http://marc.info/?l=git&m=131753257824405&w=2
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* Re: [PATCH 6/6] Retain caches of submodule refs
From: Michael Haggerty @ 2011-10-11 4:12 UTC (permalink / raw)
To: Heiko Voigt; +Cc: Junio C Hamano, git, Jeff King, Drew Northup, Jakub Narebski
In-Reply-To: <20111010195325.GA5981@sandbox-rc>
On 10/10/2011 09:53 PM, Heiko Voigt wrote:
> On Sun, Oct 09, 2011 at 01:12:20PM +0200, Michael Haggerty wrote:
> Since the setup_revision() api can currently not be used to safely
> iterate twice over the same submodule my patch
>
> allow multiple calls to submodule merge search for the same path
>
> rewrites the search into using a child process. AFAIK the submodule ref
> iteration api would then even be unused.
If your patch is accepted, then we should check whether anything should
be ripped out.
> At least in my code there is no place where a submodule ref is changed.
> I only used it for merging submodule which only modifies the main
> module. So I would say its currently safe to assume that submodule refs
> do not get modified. If we do need that later on we can still add
> invalidation for submodule refs.
OK, thanks!
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* Re: [PATCH v3 5/5] attr.c: respect core.ignorecase when matching attribute patterns
From: Michael Haggerty @ 2011-10-11 3:44 UTC (permalink / raw)
To: Brandon Casey; +Cc: Brandon Casey, gitster, git, peff, j.sixt
In-Reply-To: <CA+sFfMd9exQcGfTGLJFPXG3-bq-ukn7K4m1R=LvLKqc1-jDVQw@mail.gmail.com>
On 10/10/2011 08:01 PM, Brandon Casey wrote:
> On Sun, Oct 9, 2011 at 10:16 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> Maybe my commit message is not clear that it is describing the current
> behavior and not defining it. Instead of
>
> git should only match the portion of the path below the directory
> holding the .gitignore file according to the setting of
> core.ignorecase.
>
> maybe I should say
>
> git will currently only match the portion of the path...
>
> I could also remove the following test from the CASE_INSENSITIVE_FS
> tests since it is really a dontcare:
>
> attr_check A/b/h a/b/h "-c core.ignorecase=0"
>
> We don't care what happens when the user supplies A/b/h and a/b/h
> exists on disk when core.ignorecase=0, we only care that A/b/h is
> interpreted correctly when core.ignorecase=1.
Sounds good to me.
Thanks,
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply
* What's cooking snapshot
From: Junio C Hamano @ 2011-10-11 3:25 UTC (permalink / raw)
To: git
I am planning to merge the following topics that are queued in 'pu' to
'next' soonish.
* tm/completion-commit-fixup-squash (2011-10-06) 2 commits
- completion: commit --fixup and --squash
- completion: unite --reuse-message and --reedit-message handling
(this branch is used by sg/completion.)
* tm/completion-push-set-upstream (2011-10-06) 1 commit
- completion: push --set-upstream
* bc/attr-ignore-case (2011-10-06) 5 commits
- attr.c: respect core.ignorecase when matching attribute patterns
- attr: read core.attributesfile from git_default_core_config
- builtin/mv.c: plug miniscule memory leak
- cleanup: use internal memory allocation wrapper functions everywhere
- attr.c: avoid inappropriate access to strbuf "buf" member
* ef/mingw-syslog (2011-10-07) 1 commit
- mingw: avoid using strbuf in syslog
* jk/name-hash-dirent (2011-10-07) 1 commit
- fix phantom untracked files when core.ignorecase is set
* rs/pickaxe (2011-10-07) 7 commits
- pickaxe: factor out pickaxe
- pickaxe: give diff_grep the same signature as has_changes
- pickaxe: pass diff_options to contains and has_changes
- pickaxe: factor out has_changes
- pickaxe: plug regex/kws leak
- pickaxe: plug regex leak
- pickaxe: plug diff filespec leak with empty needle
* tc/fetch-leak (2011-10-07) 1 commit
- fetch: plug two leaks on error exit in store_updated_refs
* mm/maint-config-explicit-bool-display (2011-10-10) 1 commit
- config: display key_delim for config --bool --get-regexp
* rs/diff-whole-function (2011-10-10) 2 commits
- diff: add option to show whole functions as context
- xdiff: factor out get_func_line()
* sc/difftool-skip (2011-10-10) 1 commit
- git-difftool: allow skipping file by typing 'n' at prompt
* sg/completion (2011-10-10) 2 commits
- completion: unite --format and --pretty for 'log' and 'show'
- completion: unite --reuse-message and --reedit-message for 'notes'
(this branch uses tm/completion-commit-fixup-squash.)
Comments welcome.
^ permalink raw reply
* Re: [PATCH] commit: teach --gpg-sign option
From: Robin H. Johnson @ 2011-10-11 0:38 UTC (permalink / raw)
To: Junio C Hamano, Git Mailing List; +Cc: Robin H. Johnson, Michael J Gruber
In-Reply-To: <7vmxd9pxd2.fsf@alter.siamese.dyndns.org>
On Sun, Oct 09, 2011 at 04:18:49PM -0700, Junio C Hamano wrote:
> "Robin H. Johnson" <robbat2@gentoo.org> writes:
> > Workflow example:
> > 1. Dev1 creates a commit, signs it, pushes to central repo.
> > 2. Dev2 pulls, signs the tip commit, pushes it back.
>
> I personally am not sympathetic to such a "sign every and all commits by
> multiple people" workflow. If you really want to do such a thing, you can
> have the second and subsequent one to create a new commit on top whose
> sole purpose is to hold such a signature (commit --allow-empty --gpg-sig),
> or use signed tags.
For this case, I think having the push certificates works much better.
No easy solution to all of this, just lots of yak-shaving :-(.
--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
^ permalink raw reply
* Re: [PATCH v3] Teach merge the '[-e|--edit]' option
From: Jay Soffian @ 2011-10-11 0:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Todd A. Jacobs
In-Reply-To: <7v1uukieh2.fsf@alter.siamese.dyndns.org>
On Mon, Oct 10, 2011 at 5:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
> So if we drop the "conditionally add '\n'" part in builtin/merge.c from my
> "how about this on top" patch and we should be ready to go, right?
Yes. I can send a followup patch adding an additional test case next
week (for the case where the editor zeros out the message).
Thanks Junio!
j.
^ 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