* Re: [PATCH v3 2/2] cache-tree: remove dead i-t-a code in verify_cache()
From: Junio C Hamano @ 2012-12-13 18:34 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Jeff King, Jonathon Mah
In-Reply-To: <1355362747-13474-2-git-send-email-pclouds@gmail.com>
Will replace the one in 'pu' with these two. Thanks.
^ permalink raw reply
* Re: [PATCH 0/2] mailmap from blobs
From: Junio C Hamano @ 2012-12-13 18:23 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20121213130447.GA4353@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Subject: [PATCH] mailmap: default mailmap.blob in bare repositories
>
> The motivation for mailmap.blob is to let users of bare
> repositories use the mailmap feature, as they would not have
> a checkout containing the .mailmap file. We can make it even
> easier for them by just looking in HEAD:.mailmap by default.
>
> We can't know for sure that this is where they would keep a
> mailmap, of course, but it is the best guess (and it matches
> the non-bare behavior, which reads from HEAD:.mailmap in the
> working tree). If it's missing, git will silently ignore the
> setting.
>
> We do not do the same magic in the non-bare case, because:
>
> 1. In the common case, HEAD:.mailmap will be the same as
> the .mailmap in the working tree, which is a no-op.
>
> 2. In the uncommon case, the user has modified .mailmap
> but not yet committed it, and would expect the working
> tree version to take precedence.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I went with defaulting mailmap.blob, because it provides an easy path
> for turning off the feature (you just override mailmap.blob).
Very sensibly explained. I like it when people clearly explain the
thinking behind the change in the log message.
Thanks, will queue.
> Documentation/config.txt | 8 +++++---
> mailmap.c | 5 +++++
> t/t4203-mailmap.sh | 25 +++++++++++++++++++++++++
> 3 files changed, 35 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 3760077..1a3c554 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1519,9 +1519,11 @@ mailmap.blob::
>
> mailmap.blob::
> Like `mailmap.file`, but consider the value as a reference to a
> - blob in the repository (e.g., `HEAD:.mailmap`). If both
> - `mailmap.file` and `mailmap.blob` are given, both are parsed,
> - with entries from `mailmap.file` taking precedence.
> + blob in the repository. If both `mailmap.file` and
> + `mailmap.blob` are given, both are parsed, with entries from
> + `mailmap.file` taking precedence. In a bare repository, this
> + defaults to `HEAD:.mailmap`. In a non-bare repository, it
> + defaults to empty.
>
> man.viewer::
> Specify the programs that may be used to display help in the
> diff --git a/mailmap.c b/mailmap.c
> index 5ffe48a..b16542f 100644
> --- a/mailmap.c
> +++ b/mailmap.c
> @@ -233,7 +233,12 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
> int read_mailmap(struct string_list *map, char **repo_abbrev)
> {
> int err = 0;
> +
> map->strdup_strings = 1;
> +
> + if (!git_mailmap_blob && is_bare_repository())
> + git_mailmap_blob = "HEAD:.mailmap";
> +
> err |= read_mailmap_file(map, ".mailmap", repo_abbrev);
> err |= read_mailmap_blob(map, git_mailmap_blob, repo_abbrev);
> err |= read_mailmap_file(map, git_mailmap_file, repo_abbrev);
> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
> index e7ea40c..aae30d9 100755
> --- a/t/t4203-mailmap.sh
> +++ b/t/t4203-mailmap.sh
> @@ -218,6 +218,31 @@ test_expect_success 'mailmap.blob can be missing' '
> test_cmp expect actual
> '
>
> +test_expect_success 'mailmap.blob defaults to off in non-bare repo' '
> + git init non-bare &&
> + (
> + cd non-bare &&
> + test_commit one .mailmap "Fake Name <author@example.com>" &&
> + echo " 1 Fake Name" >expect &&
> + git shortlog -ns HEAD >actual &&
> + test_cmp expect actual &&
> + rm .mailmap &&
> + echo " 1 A U Thor" >expect &&
> + git shortlog -ns HEAD >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> +test_expect_success 'mailmap.blob defaults to HEAD:.mailmap in bare repo' '
> + git clone --bare non-bare bare &&
> + (
> + cd bare &&
> + echo " 1 Fake Name" >expect &&
> + git shortlog -ns HEAD >actual &&
> + test_cmp expect actual
> + )
> +'
> +
> test_expect_success 'cleanup after mailmap.blob tests' '
> rm -f .mailmap
> '
^ permalink raw reply
* Re: [PATCH v2] index-format.txt: be more liberal on what can represent invalid cache tree
From: Junio C Hamano @ 2012-12-13 18:11 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <7v8v921zt6.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> How would that work with existing versions? If you write -2 in
>> cache-tree, the next time 1.8.0 updates cache tree it writes -1 back.
>> That loses whatever information you attach to -2. A new cache-tree
>> extension is probably better.
>
> You can easily imagine a definition like this:
> ...
As we clarified that we do not allow implementations to write
anything but -1 for invalidated entries until we decide what we will
use other values for, the whole log message needs to be updated, I
think.
-- >8 --
From: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date: Thu, 13 Dec 2012 08:14:47 +0700
Subject: [PATCH] index-format.txt: clarify what is "invalid"
A cache-tree entry with a negative entry count is considered "invalid"
in the current Git; it records that we do not know the object name
of a tree that would result by writing the directory covered by the
cache-tree as a tree object.
Clarify that any entry with a negative entry count is invalid, but
the implementations must write -1 there. This way, we can later
decide to allow writers to use negative values other than -1 to
encode optional information without harming interoperability; we do
not know what is encoded how, so keep these other negative values as
reserved for now.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/technical/index-format.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
index 9d25b30..ce28a7a 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/technical/index-format.txt
@@ -161,8 +161,9 @@ GIT index format
this span of index as a tree.
An entry can be in an invalidated state and is represented by having
- -1 in the entry_count field. In this case, there is no object name
- and the next entry starts immediately after the newline.
+ a negative number in the entry_count field. In this case, there is no
+ object name and the next entry starts immediately after the newline.
+ When writing an invalid entry, -1 should always be used as entry_count.
The entries are written out in the top-down, depth-first order. The
first entry represents the root level of the repository, followed by the
--
1.8.1.rc1.141.g0ffea5d
^ permalink raw reply related
* Re: [PATCH] Documentation/git: add missing info about --git-dir command-line option
From: Manlio Perillo @ 2012-12-13 18:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmwxj3vxx.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 12/12/2012 20:35, Junio C Hamano ha scritto:
> Manlio Perillo <manlio.perillo@gmail.com> writes:
>
>> The Documentation/git.txt file, in the GIT_DIR environment variable
>> section, did not mentioned that this value can also be set using the
>> --git-dir command line option.
>> ---
>
> s/mentioned/mention/; Also it may help to say
>
> Unlike other environment variables (e.g. GIT_WORK_TREE,
> GIT_NAMESPACE),
>
> somewhere in the description.
>
> Please sign-off your patch (see Documentation/SubmittingPatches).
>
> Thanks.
>
Thanks to you.
I have sent the updated patch, let me know if is ok.
Manlio Perillo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlDKF9YACgkQscQJ24LbaUQyHwCcDiaJjFZ5vwHzxjHyhEBCyFdd
GnIAn34MjoWmQOcLKJEl/EpE0ImeQBLG
=yrux
-----END PGP SIGNATURE-----
^ permalink raw reply
* [PATCH v2] git.txt: add missing info about --git-dir command-line option
From: Manlio Perillo @ 2012-12-13 17:57 UTC (permalink / raw)
To: git; +Cc: Manlio Perillo
Unlike other environment variables (e.g. GIT_WORK_TREE, GIT_NAMESPACE),
the Documentation/git.txt file did not mention that the GIT_DIR
environment variable can also be set using the --git-dir command line
option.
Signed-off-by: Manlio Perillo <manlio.perillo@gmail.com>
---
Documentation/git.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index e643683..60db292 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -650,6 +650,7 @@ git so take care if using Cogito etc.
If the 'GIT_DIR' environment variable is set then it
specifies a path to use instead of the default `.git`
for the base of the repository.
+ The '--git-dir' command-line option also sets this value.
'GIT_WORK_TREE'::
Set the path to the working tree. The value will not be
--
1.8.1.rc1.19.g2021cc5.dirty
^ permalink raw reply related
* RE: Build fixes for another obscure Unix
From: Pyeron, Jason J CTR (US) @ 2012-12-13 17:18 UTC (permalink / raw)
To: git@vger.kernel.org
In-Reply-To: <CAEvUa7nn9M5np3wD=Z1152K4pwNGhSKkC=rS9U=yc=UcaOxMCw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
> -----Original Message-----
> From: David Michael
> Sent: Thursday, December 13, 2012 10:23 AM
>
> Hi,
>
> I've been experimenting with git running on z/OS USS. It is not yet
> stable, but I have had to make a few fixes and generalizations in the
> build system to get it to compile.
Maybe it would help address other build issues on other platforms.
>
> Would there be any interest in applying such individual compatibility
> fixes for this system, even if a full port doesn't reach completion?
What are the down sides? Can your changes be shown to not impact builds on other systems?
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5615 bytes --]
^ permalink raw reply
* Re: [PATCH] Fix sizeof usage in get_permutations
From: Joachim Schmitz @ 2012-12-13 16:13 UTC (permalink / raw)
To: git
In-Reply-To: <1355405790-20302-1-git-send-email-mattjd@gmail.com>
Matthew Daley wrote:
> Currently it gets the size of an otherwise unrelated, unused variable
> instead of the expected struct size.
>
> Signed-off-by: Matthew Daley <mattjd@gmail.com>
> ---
> builtin/pack-redundant.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
> index f5c6afc..7544687 100644
> --- a/builtin/pack-redundant.c
> +++ b/builtin/pack-redundant.c
> @@ -301,14 +301,14 @@ static void pll_free(struct pll *l)
> */
> static struct pll * get_permutations(struct pack_list *list, int n)
> {
> - struct pll *subset, *ret = NULL, *new_pll = NULL, *pll;
> + struct pll *subset, *ret = NULL, *new_pll = NULL;
>
> if (list == NULL || pack_list_size(list) < n || n == 0)
> return NULL;
>
> if (n == 1) {
> while (list) {
> - new_pll = xmalloc(sizeof(pll));
> + new_pll = xmalloc(sizeof(struct pll));
> new_pll->pl = NULL;
> pack_list_insert(&new_pll->pl, list);
> new_pll->next = ret;
> @@ -321,7 +321,7 @@ static struct pll * get_permutations(struct
> pack_list *list, int n) while (list->next) {
> subset = get_permutations(list->next, n - 1);
> while (subset) {
> - new_pll = xmalloc(sizeof(pll));
> + new_pll = xmalloc(sizeof(struct pll));
Why not just
new_pll = xmalloc(sizeof(*new_pll));
> new_pll->pl = subset->pl;
> pack_list_insert(&new_pll->pl, list);
> new_pll->next = ret;
^ permalink raw reply
* Re: [PATCH v2] submodule: add 'deinit' command
From: Marc Branchaud @ 2012-12-13 15:47 UTC (permalink / raw)
To: Jens Lehmann
Cc: Junio C Hamano, Michael J Gruber, Phil Hord, W. Trevor King, Git,
Heiko Voigt, Jeff King, Shawn Pearce, Nahor
In-Reply-To: <50C90469.8080303@web.de>
On 12-12-12 05:25 PM, Jens Lehmann wrote:
>
> So unless people agree that deinit should also remove the work
> tree I'll prepare some patches teaching all git commands to
> consistently ignore deinitialized submodules. Opinions?
I agree with Trevor's suggestion that deinit should restore the user to the
state he would be in if he were never interested in the submodule. So clean
up .git/config and remove the work tree. (Maybe just issue a warning instead
if the submodule's work tree is dirty.)
Also, given that semantic, I agree with Michael that a bare "git submodule
deinit" should *not* deinitialize all the submodules. It should require a
"--all" for that. The bare command should just print a usage summary.
M.
^ permalink raw reply
* RE: FW: Git log --graph doesn't output color when redirected
From: Srb, Michal @ 2012-12-13 15:34 UTC (permalink / raw)
To: Jeff King; +Cc: git@vger.kernel.org
In-Reply-To: <20121213131329.GA5042@sigill.intra.peff.net>
From: Jeff King [peff@peff.net]
Sent: Thursday, December 13, 2012 1:13 PM
>> Is there a setting somewhere in config to change this?
> Yes. If you use "--color" on the command line, that means
> "unconditionally use color". If you set color.ui (or any other
> color config option) to "always", then you will always get color (and
> you can disable it for a particular run with "--no-color"). Setting a color
> config option to "true" is the same as "auto", which gets you
> the auto mode.
Setting color in gitconfig didn't work for me on msys, but --color
works like magic, thanks!
^ permalink raw reply
* Build fixes for another obscure Unix
From: David Michael @ 2012-12-13 15:22 UTC (permalink / raw)
To: git
Hi,
I've been experimenting with git running on z/OS USS. It is not yet
stable, but I have had to make a few fixes and generalizations in the
build system to get it to compile.
Would there be any interest in applying such individual compatibility
fixes for this system, even if a full port doesn't reach completion?
Thanks.
David
^ permalink raw reply
* [PATCH] Fix sizeof usage in get_permutations
From: Matthew Daley @ 2012-12-13 13:36 UTC (permalink / raw)
To: git; +Cc: Matthew Daley
Currently it gets the size of an otherwise unrelated, unused variable
instead of the expected struct size.
Signed-off-by: Matthew Daley <mattjd@gmail.com>
---
builtin/pack-redundant.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index f5c6afc..7544687 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -301,14 +301,14 @@ static void pll_free(struct pll *l)
*/
static struct pll * get_permutations(struct pack_list *list, int n)
{
- struct pll *subset, *ret = NULL, *new_pll = NULL, *pll;
+ struct pll *subset, *ret = NULL, *new_pll = NULL;
if (list == NULL || pack_list_size(list) < n || n == 0)
return NULL;
if (n == 1) {
while (list) {
- new_pll = xmalloc(sizeof(pll));
+ new_pll = xmalloc(sizeof(struct pll));
new_pll->pl = NULL;
pack_list_insert(&new_pll->pl, list);
new_pll->next = ret;
@@ -321,7 +321,7 @@ static struct pll * get_permutations(struct pack_list *list, int n)
while (list->next) {
subset = get_permutations(list->next, n - 1);
while (subset) {
- new_pll = xmalloc(sizeof(pll));
+ new_pll = xmalloc(sizeof(struct pll));
new_pll->pl = subset->pl;
pack_list_insert(&new_pll->pl, list);
new_pll->next = ret;
--
1.7.10.4
^ permalink raw reply related
* Re: FW: Git log --graph doesn't output color when redirected
From: Jeff King @ 2012-12-13 13:13 UTC (permalink / raw)
To: Srb, Michal; +Cc: git@vger.kernel.org
In-Reply-To: <72BB37CB88C48F4B925365539F1EE46C18261403@icexch-m3.ic.ac.uk>
On Wed, Dec 12, 2012 at 05:35:17PM +0000, Srb, Michal wrote:
> Unlike --pretty-format, --graph doesn’t output colors when the git log output
> is redirected.
I do not think it has anything to do with --graph in particular, but
rather that when colorization is set to the "auto" mode, it is enabled
only when stdout is a tty. Diff coloring, for example, follows the same
rules. If you are using --format="%C(red)" or similar placeholders,
they are the odd duck by not respecting the auto-color mode.
> Is there a setting somewhere in config to change this?
Yes. If you use "--color" on the command line, that means
"unconditionally use color". If you set color.ui (or any other color
config option) to "always", then you will always get color (and you can
disable it for a particular run with "--no-color"). Setting a color
config option to "true" is the same as "auto", which gets you the auto
mode.
-Peff
^ permalink raw reply
* Re: [PATCH 2/2] mailmap: support reading mailmap from blobs
From: Jeff King @ 2012-12-13 13:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20121212110404.GB19653@sigill.intra.peff.net>
On Wed, Dec 12, 2012 at 06:04:04AM -0500, Jeff King wrote:
> In a bare repository, there isn't a simple way to respect an
> in-tree mailmap without extracting it to a temporary file.
> This patch provides a config variable, similar to
> mailmap.file, which reads the mailmap from a blob in the
> repository.
While preparing the "default mailmap.blob" patch, I noticed a few loose
ends in the documentation. They can be squashed into this 2/2
(jk/mailmap-from-blob~1), or can go on top of the series:
-- >8 --
Subject: [PATCH] fix some documentation loose-ends for mailmap.blob
Anywhere we mention mailmap.file, it is probably worth
mentioning mailmap.blob, as well.
Signed-off-by: Jeff King <peff@peff.net>
---
Documentation/git-log.txt | 2 +-
Documentation/mailmap.txt | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 585dac4..08a185d 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -167,7 +167,7 @@ log.showroot::
`git log -p` output would be shown without a diff attached.
The default is `true`.
-mailmap.file::
+mailmap.*::
See linkgit:git-shortlog[1].
notes.displayRef::
diff --git a/Documentation/mailmap.txt b/Documentation/mailmap.txt
index 288f04e..bb349c2 100644
--- a/Documentation/mailmap.txt
+++ b/Documentation/mailmap.txt
@@ -1,5 +1,6 @@ If the file `.mailmap` exists at the toplevel of the repository, or at
If the file `.mailmap` exists at the toplevel of the repository, or at
-the location pointed to by the mailmap.file configuration option, it
+the location pointed to by the mailmap.file or mailmap.blob
+configuration options, it
is used to map author and committer names and email addresses to
canonical real names and email addresses.
--
1.8.0.2.4.g59402aa
^ permalink raw reply related
* Re: [PATCH 0/2] mailmap from blobs
From: Jeff King @ 2012-12-13 13:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20121212175900.GA32767@sigill.intra.peff.net>
On Wed, Dec 12, 2012 at 12:59:00PM -0500, Jeff King wrote:
> > Have you considered defaulting to read from HEAD:.mailmap even when
> > this new configuration is not there if core.bare is set? I would
> > imagine that it would be the most convenient and match people's
> > expectations.
>
> Yeah, I almost suggested that, but I figured it could wait for the
> feature to prove itself in the real world before turning it on by
> default. It _should_ be pretty harmless, though, so I don't mind turning
> it on by default.
That patch would look like this:
-- >8 --
Subject: [PATCH] mailmap: default mailmap.blob in bare repositories
The motivation for mailmap.blob is to let users of bare
repositories use the mailmap feature, as they would not have
a checkout containing the .mailmap file. We can make it even
easier for them by just looking in HEAD:.mailmap by default.
We can't know for sure that this is where they would keep a
mailmap, of course, but it is the best guess (and it matches
the non-bare behavior, which reads from HEAD:.mailmap in the
working tree). If it's missing, git will silently ignore the
setting.
We do not do the same magic in the non-bare case, because:
1. In the common case, HEAD:.mailmap will be the same as
the .mailmap in the working tree, which is a no-op.
2. In the uncommon case, the user has modified .mailmap
but not yet committed it, and would expect the working
tree version to take precedence.
Signed-off-by: Jeff King <peff@peff.net>
---
I went with defaulting mailmap.blob, because it provides an easy path
for turning off the feature (you just override mailmap.blob).
Another way of thinking about this would be that it is the bare analog
to "read .mailmap from the working tree", and the logic should be:
if (is_bare_repository())
read_mailmap_blob(map, "HEAD:.mailmap");
else
read_mailmap_file(map, ".mailmap");
read_mailmap_blob(map, git_mailmap_blob);
read_mailmap_file(map, git_mailmap_file);
However, the current is not exactly "read from the root of the working
tree". It is "read from the current directory", and it works because all
of the callers run from the toplevel of the working tree (when one
exists). That means that bare repositories have always read from
$GIT_DIR/.mailmap. I doubt that was intentional, but people with bare
repositories may be depending on it. So I think that falls into the
"how I might do it from scratch" bin.
We could still do:
if (is_bare_repository())
read_mailmap_blob(map, "HEAD:.mailmap");
read_mailmap_file(map, ".mailmap");
read_mailmap_blob(map, git_mailmap_blob);
read_mailmap_file(map, git_mailmap_file);
but IMHO that is just making the rules more complicated to explain for
little benefit (and in fact, you lose the ability to suppress the HEAD
mailmap, which you might care about if you are hosting multiple bits of
unrelated history in the same repo).
Documentation/config.txt | 8 +++++---
mailmap.c | 5 +++++
t/t4203-mailmap.sh | 25 +++++++++++++++++++++++++
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 3760077..1a3c554 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1519,9 +1519,11 @@ mailmap.blob::
mailmap.blob::
Like `mailmap.file`, but consider the value as a reference to a
- blob in the repository (e.g., `HEAD:.mailmap`). If both
- `mailmap.file` and `mailmap.blob` are given, both are parsed,
- with entries from `mailmap.file` taking precedence.
+ blob in the repository. If both `mailmap.file` and
+ `mailmap.blob` are given, both are parsed, with entries from
+ `mailmap.file` taking precedence. In a bare repository, this
+ defaults to `HEAD:.mailmap`. In a non-bare repository, it
+ defaults to empty.
man.viewer::
Specify the programs that may be used to display help in the
diff --git a/mailmap.c b/mailmap.c
index 5ffe48a..b16542f 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -233,7 +233,12 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
int read_mailmap(struct string_list *map, char **repo_abbrev)
{
int err = 0;
+
map->strdup_strings = 1;
+
+ if (!git_mailmap_blob && is_bare_repository())
+ git_mailmap_blob = "HEAD:.mailmap";
+
err |= read_mailmap_file(map, ".mailmap", repo_abbrev);
err |= read_mailmap_blob(map, git_mailmap_blob, repo_abbrev);
err |= read_mailmap_file(map, git_mailmap_file, repo_abbrev);
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index e7ea40c..aae30d9 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -218,6 +218,31 @@ test_expect_success 'mailmap.blob can be missing' '
test_cmp expect actual
'
+test_expect_success 'mailmap.blob defaults to off in non-bare repo' '
+ git init non-bare &&
+ (
+ cd non-bare &&
+ test_commit one .mailmap "Fake Name <author@example.com>" &&
+ echo " 1 Fake Name" >expect &&
+ git shortlog -ns HEAD >actual &&
+ test_cmp expect actual &&
+ rm .mailmap &&
+ echo " 1 A U Thor" >expect &&
+ git shortlog -ns HEAD >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'mailmap.blob defaults to HEAD:.mailmap in bare repo' '
+ git clone --bare non-bare bare &&
+ (
+ cd bare &&
+ echo " 1 Fake Name" >expect &&
+ git shortlog -ns HEAD >actual &&
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'cleanup after mailmap.blob tests' '
rm -f .mailmap
'
--
1.8.0.2.4.g59402aa
^ permalink raw reply related
* Re: [PATCH] git(1): remove a defunct link to "list of authors"
From: Jeff King @ 2012-12-13 12:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Nguyen Thai Ngoc Duy, git
In-Reply-To: <7v8v935en3.fsf@alter.siamese.dyndns.org>
On Wed, Dec 12, 2012 at 10:06:24AM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > I find the ohloh one a little more informative than the GitHub graph. I
> > couldn't find any others (Google Code does not seem to have one,
> > kernel.org and other gitweb sites do not, and I can't think of anywhere
> > else that hosts a mirror).
>
> Then let's do this.
>
> -- >8 --
> Subject: git(1): show link to contributor summary page
>
> We earlier removed a link to list of contributors that pointed to a
> defunct page; let's use a working one from Ohloh.net to replace it
> instead.
Looks good to me. Thanks.
-Peff
^ permalink raw reply
* Re: What's cooking in git.git (Dec 2012, #03; Wed, 12)
From: Max Horn @ 2012-12-13 12:04 UTC (permalink / raw)
To: Felipe Contreras; +Cc: Junio C Hamano, git
In-Reply-To: <CAMP44s3uyC0V6ycTv78mG36_i7ugMLwwNk2cqNZatEJuL7Ee1w@mail.gmail.com>
On 13.12.2012, at 11:08, Felipe Contreras wrote:
> On Thu, Dec 13, 2012 at 2:11 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>>>> New remote helper for bzr (v3). With minor fixes, this may be ready
>>>> for 'next'.
>>>
>>> What minor fixes?
>>
>> Lookng at the above (fixup), $gmane/210744 comes to mind
>
> That doesn't matter. The code and the tests would work just fine.
It doesn't matter? I find that statement hard to align with what the maintainer of git, and thus the person who decides whether your patch series gets merged or not, wrote just above? In fact, it seems to me that what Junio said matters a great deal...
This is a very strange attitude...
In another email, you complained about nobody reviewing your patches respectively nobody voicing any constructive criticism. Yet Junio did just that, and again in $gmane/210745 -- and you replied to neither, and acted on neither (not even by refuting the points brought up), and now summarily dismiss them as irrelevant. I find that quite disturbing :-(.
>
>> but there may be others. It is the responsibility of a contributor to keep
>> track of review comments others give to his or her patches and
>> reroll them, so I do not recall every minor details, sorry.
>
> There is nothing that prevents remote-bzr from being merged.
Well, I think that is up to Junio to decide in the end, though :-). He wrote
Cheers,
Max
^ permalink raw reply
* Re: What's cooking in git.git (Dec 2012, #03; Wed, 12)
From: Felipe Contreras @ 2012-12-13 10:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vvcc6z801.fsf@alter.siamese.dyndns.org>
On Thu, Dec 13, 2012 at 2:11 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>> New remote helper for bzr (v3). With minor fixes, this may be ready
>>> for 'next'.
>>
>> What minor fixes?
>
> Lookng at the above (fixup), $gmane/210744 comes to mind
That doesn't matter. The code and the tests would work just fine.
> but there may be others. It is the responsibility of a contributor to keep
> track of review comments others give to his or her patches and
> reroll them, so I do not recall every minor details, sorry.
There is nothing that prevents remote-bzr from being merged.
Cheers.
--
Felipe Contreras
^ permalink raw reply
* Re: What's cooking in git.git (Dec 2012, #03; Wed, 12)
From: Junio C Hamano @ 2012-12-13 8:11 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git
In-Reply-To: <CAMP44s2DAuhk5FkDm0-cYsikY0o6vuZ4FyAnXhbtsgqKQF1dpg@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Wed, Dec 12, 2012 at 5:58 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> [Stalled]
>>
>> * fc/remote-bzr (2012-11-28) 10 commits
>> - (fixup) test-bzr.sh: fix multi-line string assignment
>> - remote-bzr: detect local repositories
>> - remote-bzr: add support for older versions of bzr
>> - remote-bzr: add support to push special modes
>> - remote-bzr: add support for fecthing special modes
>> - remote-bzr: add simple tests
>> - remote-bzr: update working tree
>> - remote-bzr: add support for remote repositories
>> - remote-bzr: add support for pushing
>> - Add new remote-bzr transport helper
>>
>> New remote helper for bzr (v3). With minor fixes, this may be ready
>> for 'next'.
>
> What minor fixes?
Lookng at the above (fixup), $gmane/210744 comes to mind, but there
may be others. It is the responsibility of a contributor to keep
track of review comments others give to his or her patches and
reroll them, so I do not recall every minor details, sorry.
^ permalink raw reply
* unclear documentation of git fetch --tags option and tagopt config
From: 乙酸鋰 @ 2012-12-13 6:29 UTC (permalink / raw)
To: git
Hi,
With git fetch --tags
or remote.origin.tagopt = --tags
git fetch only fetches tags, but not branches.
Current documentation does not mention that no branches are fetched /
pulled when --tags option or remote.origin.tagopt = --tags is
specified.
Regards,
ch3cooli
^ permalink raw reply
* Re: possible Improving diff algoritm
From: Junio C Hamano @ 2012-12-13 6:26 UTC (permalink / raw)
To: Geert Bosch; +Cc: Morten Welinder, Kevin, git
In-Reply-To: <B1564B28-9BB9-48A2-B59E-7D7C0B0DDECF@adacore.com>
Geert Bosch <bosch@adacore.com> writes:
> It would seem that just looking at the line length (stripped) of
> the last line, might be sufficient for cost function to minimize.
> Here the some would be 3 vs 0. In case of ties, use the last
> possibility with minimum cost.
-- 8< --
#ifdef A
some stuff
about A
#endif
#ifdef Z
some more stuff
about Z
#endif
-- >8 --
If you insert a block for M following the existing formatting
convention in the middle, your heuristics will pick the blank line
after "about A" as having minimum cost, no?
You inherently have to know the nature of the payload, as your eyes
that judge the result use that knowledge when doing so, I am afraid.
I think your "define a function that gives a good score to lines
that are likely to be good breaking points" idea has merit, but I
think that should be tied to the content type, most likely via the
attribute mechanism.
In any case, I consider this as a low-impact (as Michael Haggerty
noted, it is impossible to introduce a bug that subtly break the
output; your result is either totally borked or is correct) and
low-hanging fruit (it can be done as a postprocessing phase after
the xdiff machinery has done the heavy-lifting of computing LCA), if
somebody wants to experiment and implement one. As long as the new
heuristics is hidden behind an explicit command line option to avoid
other "consequences", I wouldn't discourage interested parties from
working on it. It is not just my itch, though.
^ permalink raw reply
* Re: What's cooking in git.git (Dec 2012, #03; Wed, 12)
From: Felipe Contreras @ 2012-12-13 6:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vhanq257s.fsf@alter.siamese.dyndns.org>
On Wed, Dec 12, 2012 at 5:58 PM, Junio C Hamano <gitster@pobox.com> wrote:
> [Stalled]
>
> * fc/remote-bzr (2012-11-28) 10 commits
> - (fixup) test-bzr.sh: fix multi-line string assignment
> - remote-bzr: detect local repositories
> - remote-bzr: add support for older versions of bzr
> - remote-bzr: add support to push special modes
> - remote-bzr: add support for fecthing special modes
> - remote-bzr: add simple tests
> - remote-bzr: update working tree
> - remote-bzr: add support for remote repositories
> - remote-bzr: add support for pushing
> - Add new remote-bzr transport helper
>
> New remote helper for bzr (v3). With minor fixes, this may be ready
> for 'next'.
What minor fixes?
--
Felipe Contreras
^ permalink raw reply
* Submodule not updated automatically on merge conflict
From: 乙酸鋰 @ 2012-12-13 5:46 UTC (permalink / raw)
To: git
Hi,
If there are merge conflict files, then changed submodules are not
updated automatically.
Why not submodules?
Files do try to merge / update.
Regards,
ch3cooli
^ permalink raw reply
* Re: possible Improving diff algoritm
From: Geert Bosch @ 2012-12-13 4:58 UTC (permalink / raw)
To: Morten Welinder; +Cc: Junio C Hamano, Kevin, git
In-Reply-To: <CANv4PNnC1J54TSpHuBOpY=rbuU_naysYkmoyi=utNF0vWK1CnA@mail.gmail.com>
On Dec 12, 2012, at 20:55, Morten Welinder <mwelinder@gmail.com> wrote:
> I was merely asking if an algorithm to pick between the
> 2+ choices was allowed to look at the contents of the
> lines.
>
> I.e., an algorithm would look at the C comment
> example and determine that the choice starting containing
> a full inserted comment is preferable over the one that
> appears to close one comment and open a new.
>
> And the in inserted-function case it would prefer the one
> where the matching { and } are in correct order.
/** + /**
+ * Default parent + * Default parent
+ * + *
+ * @var int + * @var int
+ * @access protected + * @access protected
+ * @index + * @index
+ */ + */
+ protected $defaultParent; + protected $defaultParent;
+ +
+ /** /**
It would seem that just looking at the line length (stripped) of
the last line, might be sufficient for cost function to minimize.
Here the some would be 3 vs 0. In case of ties, use the last
possibility with minimum cost.
I think it would be nice if the cost function we choose does not
depend on file type, as that is something that is very dependent
on the exact local configuration and might hinder comparison of
patches. If something really simple gets us 90% there, that would
be preferable over extra complexity.
-Geert
Junio's other example:
}
+void new_function(void)
+{
+ printf("hello, world.\n");
+}
+
void existing_one(void)
{
printf("goodbye, world.\n");
=> Cost 0
+}
+
+void new_function(void)
+{
+ printf("hello, world.\n");
}
=> Cost 27
Kevin's example:
/**
+ * Default parent
+ *
+ * @var int
+ * @access protected
+ * @index
+ */
+ protected $defaultParent;
+
+ /**
=> Cost 3
+ /**
+ * Default parent
+ *
+ * @var int
+ * @access protected
+ * @index
+ */
+ protected $defaultParent;
+
/**
=> cost 0
^ permalink raw reply
* Re: [PATCH v3 1/2] cache-tree: invalidate i-t-a paths after generating trees
From: Junio C Hamano @ 2012-12-13 2:04 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Jeff King, Jonathon Mah
In-Reply-To: <1355362747-13474-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> Intent-to-add entries used to forbid writing trees so it was not a
> problem. After commit 3f6d56d (commit: ignore intent-to-add entries
> instead of refusing - 2012-02-07), we can generate trees from an index
> with i-t-a entries.
>
> However, the commit forgets to invalidate all paths leading to i-t-a
> entries. With fully valid cache-tree (e.g. after commit or
> write-tree), diff operations may prefer cache-tree to index and not
> see i-t-a entries in the index, because cache-tree does not have them.
>
> Reported-by: Jonathon Mah <me@JonathonMah.com>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> This version ensures that entry_count can only be >= -1 after
> update_one returns. Not ideal but good enough.
>
> cache-tree.c | 40 ++++++++++++++++++++++++++++++++++++----
> t/t2203-add-intent.sh | 20 ++++++++++++++++++++
> 2 files changed, 56 insertions(+), 4 deletions(-)
>
> diff --git a/cache-tree.c b/cache-tree.c
> index 28ed657..1fbc81a 100644
> --- a/cache-tree.c
> +++ b/cache-tree.c
> @@ -248,6 +248,7 @@ static int update_one(struct cache_tree *it,
> int missing_ok = flags & WRITE_TREE_MISSING_OK;
> int dryrun = flags & WRITE_TREE_DRY_RUN;
> int i;
> + int to_invalidate = 0;
>
> if (0 <= it->entry_count && has_sha1_file(it->sha1))
> return it->entry_count;
> @@ -324,7 +325,14 @@ static int update_one(struct cache_tree *it,
> if (!sub)
> die("cache-tree.c: '%.*s' in '%s' not found",
> entlen, path + baselen, path);
> - i += sub->cache_tree->entry_count - 1;
> + i--; /* this entry is already counted in "sub" */
Huh?
The "-1" in the original is the bog-standard compensation for the
for(;;i++) loop.
> + if (sub->cache_tree->entry_count < 0) {
> + i -= sub->cache_tree->entry_count;
> + sub->cache_tree->entry_count = -1;
> + to_invalidate = 1;
> + }
> + else
> + i += sub->cache_tree->entry_count;
While the rewritten version is not *wrong* per-se, I have a feeling
that it may be much easier to read if written like this:
if (sub->cache_tree_entry_count < 0) {
to_invalidate = 1;
to_skip = 0 - sub->cache_tree_entry_count;
sub->cache_tree_entry_count = -1;
} else {
to_skip = sub->cache_tree_entry_count;
}
i += to_skip - 1;
> @@ -360,7 +383,7 @@ static int update_one(struct cache_tree *it,
> }
>
> strbuf_release(&buffer);
> - it->entry_count = i;
> + it->entry_count = to_invalidate ? -i : i;
> #if DEBUG
> fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
> it->entry_count, it->subtree_nr,
> @@ -381,6 +404,15 @@ int cache_tree_update(struct cache_tree *it,
> i = update_one(it, cache, entries, "", 0, flags);
> if (i < 0)
> return i;
> + /*
> + * update_one() uses negative entry_count as a way to mark an
> + * entry invalid _and_ pass the number of entries back to
> + * itself at the parent level. This is for internal use and
> + * should not be leaked out after the top-level update_one
> + * exits.
> + */
> + if (it->entry_count < 0)
> + it->entry_count = -1;
Nice. I think what entry_count means immediately after update_one()
returned should be commented near the beginning of that function,
too, though.
Thanks.
^ permalink raw reply
* Re: Fwd: possible Improving diff algoritm
From: Morten Welinder @ 2012-12-13 1:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Kevin, git
In-Reply-To: <7vpq2f2az4.fsf@alter.siamese.dyndns.org>
>> Is there a reason why picking among the choices in a sliding window
>> must be contents neutral?
>
> Sorry, you might be getting at something interesting but I do not
> understand the question. I have no idea what you mean by "contents
> neutral".
I was merely asking if an algorithm to pick between the
2+ choices was allowed to look at the contents of the
lines.
I.e., an algorithm would look at the C comment
example and determine that the choice starting containing
a full inserted comment is preferable over the one that
appears to close one comment and open a new.
And the in inserted-function case it would prefer the one
where the matching { and } are in correct order.
Morten
^ 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