* Re: [PATCH] revision: allow selection of commits that do not match a pattern
From: Johannes Schindelin @ 2007-07-07 17:33 UTC (permalink / raw)
To: skimo; +Cc: Junio C Hamano, git
In-Reply-To: <20070707165208.GC1528MdfPADPa@greensroom.kotnet.org>
Hi,
On Sat, 7 Jul 2007, Sven Verdoolaege wrote:
> On Sat, Jul 07, 2007 at 05:27:23PM +0100, Johannes Schindelin wrote:
> > I suspect that with this patch,
> >
> > git rev-list --not --grep bugfix HEAD
> >
> > does not work as expected. Why?
>
> Well... I guess that depends on what you expect...
Well, at least you hopefully that it is confusing. To use --not for grep
patterns _as well_ as for revision arguments.
> > Why not make "git rev-list --grep '!bugfix' HEAD" work?
> >
> > Yes, you would have to have a special exception that the prefix "!!"
> > actually matches an exclamation mark, but I'd be willing to live with
> > that.
>
> Hmm... what if you want to (not) match anything starting with
> one or more '!' ?
Yeah, that would not work.
> How about I add a '--invert-match' option that would
> apply to all following match options?
> Or we could escape the '!' with backslash.
If we want to match it at the beginning. Yes, that sounds more reasonable
to me.
Ciao,
Dscho
^ permalink raw reply
* [PATCH 2/2] Simplify "external diff from attributes" logic
From: Johannes Schindelin @ 2007-07-07 17:21 UTC (permalink / raw)
To: git, gitster
Since we already store the given diff attribute in the filespec,
we can just as well reuse that, instead of going through the whole
attributes checking process again, when checking for an external
diff program.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
diff.c | 39 +++++++++++++++++----------------------
1 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/diff.c b/diff.c
index a5444df..121524e 100644
--- a/diff.c
+++ b/diff.c
@@ -1195,6 +1195,20 @@ int diff_filespec_is_binary(struct diff_filespec *one)
return one->is_binary;
}
+static const char *external_diff_attr(struct diff_filespec *one)
+{
+ diff_filespec_check_attr(one);
+ if (one->diff_attr) {
+ struct ll_diff_driver *drv;
+
+ read_config_if_needed();
+ for (drv = user_diff; drv; drv = drv->next)
+ if (!strcmp(drv->name, one->diff_attr))
+ return drv->cmd;
+ }
+ return NULL;
+}
+
static const char *funcname_pattern(const char *ident)
{
struct funcname_pattern *pp;
@@ -1860,27 +1874,6 @@ static void run_external_diff(const char *pgm,
}
}
-static const char *external_diff_attr(const char *name)
-{
- struct git_attr_check attr_diff_check;
-
- setup_diff_attr_check(&attr_diff_check);
- if (!git_checkattr(name, 1, &attr_diff_check)) {
- const char *value = attr_diff_check.value;
- if (!ATTR_TRUE(value) &&
- !ATTR_FALSE(value) &&
- !ATTR_UNSET(value)) {
- struct ll_diff_driver *drv;
-
- read_config_if_needed();
- for (drv = user_diff; drv; drv = drv->next)
- if (!strcmp(drv->name, value))
- return drv->cmd;
- }
- }
- return NULL;
-}
-
static void run_diff_cmd(const char *pgm,
const char *name,
const char *other,
@@ -1893,7 +1886,9 @@ static void run_diff_cmd(const char *pgm,
if (!o->allow_external)
pgm = NULL;
else {
- const char *cmd = external_diff_attr(name);
+ const char *cmd = external_diff_attr(one);
+ if (!cmd)
+ cmd = external_diff_attr(two);
if (cmd)
pgm = cmd;
}
--
1.5.3.rc0.2712.g125b7f
^ permalink raw reply related
* [PATCH 1/2] Change funcname_pattern_ident to diff_attr
From: Johannes Schindelin @ 2007-07-07 17:20 UTC (permalink / raw)
To: git, gitster
What we store in diff_filespec_check_attr() is really what is specified
in the diff attribute. So better use the name "diff_attr".
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
These two patches are on top of "Fix configuration syntax..."
diff.c | 13 ++++---------
diffcore.h | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/diff.c b/diff.c
index e92db5c..a5444df 100644
--- a/diff.c
+++ b/diff.c
@@ -1168,7 +1168,7 @@ static void diff_filespec_check_attr(struct diff_filespec *one)
setup_diff_attr_check(&attr_diff_check);
one->is_binary = 0;
- one->funcname_pattern_ident = NULL;
+ one->diff_attr = NULL;
if (!one->data && DIFF_FILE_VALID(one))
diff_populate_filespec(one, 0);
@@ -1179,18 +1179,13 @@ static void diff_filespec_check_attr(struct diff_filespec *one)
if (!git_checkattr(one->path, 1, &attr_diff_check)) {
const char *value;
- /* binaryness */
value = attr_diff_check.value;
if (ATTR_TRUE(value))
one->is_binary = 0;
else if (ATTR_FALSE(value))
one->is_binary = 1;
-
- /* funcname pattern ident */
- if (ATTR_TRUE(value) || ATTR_FALSE(value) || ATTR_UNSET(value))
- ;
- else
- one->funcname_pattern_ident = value;
+ else if (!ATTR_UNSET(value))
+ one->diff_attr = value;
}
}
@@ -1216,7 +1211,7 @@ static const char *diff_funcname_pattern(struct diff_filespec *one)
const char *ident, *pattern;
diff_filespec_check_attr(one);
- ident = one->funcname_pattern_ident;
+ ident = one->diff_attr;
if (!ident)
/*
diff --git a/diffcore.h b/diffcore.h
index eef17c4..f905bf5 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -27,7 +27,7 @@ struct diff_filespec {
char *path;
void *data;
void *cnt_data;
- const char *funcname_pattern_ident;
+ const char *diff_attr;
unsigned long size;
int xfrm_flags; /* for use by the xfrm */
unsigned short mode; /* file mode */
--
1.5.3.rc0.2712.g125b7f
^ permalink raw reply related
* Re: git describe origin ?
From: Francis Moreau @ 2007-07-07 17:27 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0707071812570.4093@racer.site>
On 7/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> No. Sometimes the URL is not yet available, yet, you want to add it for
> later reference (think bundles). Sometimes you are simply offline.
>
true.
--
Francis
^ permalink raw reply
* Re: git describe origin ?
From: Johannes Schindelin @ 2007-07-07 17:14 UTC (permalink / raw)
To: Francis Moreau; +Cc: git
In-Reply-To: <38b2ab8a0707070953s33ca0d1aw879fd3d1a986aaeb@mail.gmail.com>
Hi,
On Sat, 7 Jul 2007, Francis Moreau wrote:
> On 7/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On Sat, 7 Jul 2007, Francis Moreau wrote:
> >
> > > I also played with git remote and did something silly like:
> > > $ git remote add bob /tmp/dummy # dummy does not exist
> > > $ git remote show bob
> > > fatal: '/tmp/dummy': unable to chdir or not a git archive
> > > fatal: The remote end hung up unexpectedly
> > > ls-remote --heads /tmp/dummy: command returned error: 1
> > >
> > > Maybe the output could be improved to be more readable.
> >
> > The first line is very helpful IMHO:
> >
> > fatal: '/tmp/dummy': unable to chdir or not a git archive
> >
>
> yep but the 2 others are just noise, aren't they ?
There are actually four programs involved, it seems. You get an error
message from all except "git remote".
> BTW, shouldn't "git remote add" have complained at first ?
No. Sometimes the URL is not yet available, yet, you want to add it for
later reference (think bundles). Sometimes you are simply offline.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] Make attributes "-diff" and "diff" work as advertized
From: Johannes Schindelin @ 2007-07-07 16:53 UTC (permalink / raw)
To: git, gitster
In Documentation/gitattributes.txt, it says that you can suppress
diffs by setting the attribute "-diff", and you can override the
binary detection with the attribute "diff".
Make it work.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Evidently, this is on top of "next" + the funcname patches, since
I realized it only when working on top of them.
However, it should also apply cleanly to "master", and even
"maint". (The only reason I'm not doing it right now, is that I am
in the middle of preparing a patch pair, and doing this patch was
easy enough with rebase -i.)
diff.c | 15 +++++++--------
t/t4020-diff-external.sh | 12 ++++++++++++
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/diff.c b/diff.c
index 21e61af..e92db5c 100644
--- a/diff.c
+++ b/diff.c
@@ -1170,13 +1170,19 @@ static void diff_filespec_check_attr(struct diff_filespec *one)
one->is_binary = 0;
one->funcname_pattern_ident = NULL;
+ if (!one->data && DIFF_FILE_VALID(one))
+ diff_populate_filespec(one, 0);
+
+ if (one->data)
+ one->is_binary = buffer_is_binary(one->data, one->size);
+
if (!git_checkattr(one->path, 1, &attr_diff_check)) {
const char *value;
/* binaryness */
value = attr_diff_check.value;
if (ATTR_TRUE(value))
- ;
+ one->is_binary = 0;
else if (ATTR_FALSE(value))
one->is_binary = 1;
@@ -1186,13 +1192,6 @@ static void diff_filespec_check_attr(struct diff_filespec *one)
else
one->funcname_pattern_ident = value;
}
-
- if (!one->data && DIFF_FILE_VALID(one))
- diff_populate_filespec(one, 0);
-
- if (one->data)
- one->is_binary = buffer_is_binary(one->data, one->size);
-
}
int diff_filespec_is_binary(struct diff_filespec *one)
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index f0045cd..ed3bd5b 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -94,4 +94,16 @@ test_expect_success 'diff attribute should apply only to diff' '
'
+test_expect_success 'no diff with -diff' '
+ echo >.gitattributes "file -diff" &&
+ git diff | grep Binary
+'
+
+echo NULZbetweenZwords | tr Z '\0' > file
+
+test_expect_success 'force diff with "diff"' '
+ echo >.gitattributes "file diff" &&
+ git diff | grep -a second
+'
+
test_done
--
1.5.3.rc0.2712.g125b7f
^ permalink raw reply related
* Re: git describe origin ?
From: Francis Moreau @ 2007-07-07 16:53 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0707071728330.4093@racer.site>
Hi,
On 7/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Sat, 7 Jul 2007, Francis Moreau wrote:
>
> > I was wondering what does 'git describe origin' command mean on a git
> > repo. Does it mean ?
> >
> > a/ git describe origin/HEAD
> > b/ git describe origin/master
> > c/ something else
>
> This is completely unrelated to "git describe". It is about naming
> commits AKA "specifying revisions". You might find the section "SPECIFYING
> REVISIONS" in Documentation/git-rev-parse.txt especially helpful. FWIW
> this section is hinted at in the section "Symbolic Identifiers" in
> Documentation/git.txt.
>
> If you're too lazy to read, it's a/.
nope I'm not. I'll do read it thanks.
>
> > I also played with git remote and did something silly like:
> > $ git remote add bob /tmp/dummy # dummy does not exist
> > $ git remote show bob
> > fatal: '/tmp/dummy': unable to chdir or not a git archive
> > fatal: The remote end hung up unexpectedly
> > ls-remote --heads /tmp/dummy: command returned error: 1
> >
> > Maybe the output could be improved to be more readable.
>
> The first line is very helpful IMHO:
>
> fatal: '/tmp/dummy': unable to chdir or not a git archive
>
yep but the 2 others are just noise, aren't they ?
BTW, shouldn't "git remote add" have complained at first ?
thanks
--
Francis
^ permalink raw reply
* Re: [PATCH] revision: allow selection of commits that do not match a pattern
From: Sven Verdoolaege @ 2007-07-07 16:52 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <Pine.LNX.4.64.0707071724410.4093@racer.site>
On Sat, Jul 07, 2007 at 05:27:23PM +0100, Johannes Schindelin wrote:
> I suspect that with this patch,
>
> git rev-list --not --grep bugfix HEAD
>
> does not work as expected. Why?
Well... I guess that depends on what you expect...
> Why not make "git rev-list --grep '!bugfix' HEAD" work?
>
> Yes, you would have to have a special exception that the prefix "!!"
> actually matches an exclamation mark, but I'd be willing to live with
> that.
Hmm... what if you want to (not) match anything starting with
one or more '!' ?
How about I add a '--invert-match' option that would
apply to all following match options?
Or we could escape the '!' with backslash.
skimo
^ permalink raw reply
* Re: git describe origin ?
From: Johannes Schindelin @ 2007-07-07 16:33 UTC (permalink / raw)
To: Francis Moreau; +Cc: git
In-Reply-To: <38b2ab8a0707070851m25d615bdn4f7286cbadaf1316@mail.gmail.com>
Hi,
On Sat, 7 Jul 2007, Francis Moreau wrote:
> I was wondering what does 'git describe origin' command mean on a git
> repo. Does it mean ?
>
> a/ git describe origin/HEAD
> b/ git describe origin/master
> c/ something else
This is completely unrelated to "git describe". It is about naming
commits AKA "specifying revisions". You might find the section "SPECIFYING
REVISIONS" in Documentation/git-rev-parse.txt especially helpful. FWIW
this section is hinted at in the section "Symbolic Identifiers" in
Documentation/git.txt.
If you're too lazy to read, it's a/.
> I also played with git remote and did something silly like:
> $ git remote add bob /tmp/dummy # dummy does not exist
> $ git remote show bob
> fatal: '/tmp/toto': unable to chdir or not a git archive
> fatal: The remote end hung up unexpectedly
> ls-remote --heads /tmp/toto: command returned error: 1
>
> Maybe the output could be improved to be more readable.
The first line is very helpful IMHO:
fatal: '/tmp/toto': unable to chdir or not a git archive
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] revision: allow selection of commits that do not match a pattern
From: Johannes Schindelin @ 2007-07-07 16:27 UTC (permalink / raw)
To: skimo; +Cc: Junio C Hamano, git
In-Reply-To: <20070707153001.GA10408MdfPADPa@greensroom.kotnet.org>
Hi,
On Sat, 7 Jul 2007, Sven Verdoolaege wrote:
> We do this by maintaining two lists of patterns, one for
> those that should match and one for those that should not match.
I suspect that with this patch,
git rev-list --not --grep bugfix HEAD
does not work as expected. Why? Because the --not is heeded when
interpreting "HEAD". And that is confusing, because you use --not for two
completely unrelated things.
Why not make "git rev-list --grep '!bugfix' HEAD" work?
Yes, you would have to have a special exception that the prefix "!!"
actually matches an exclamation mark, but I'd be willing to live with
that.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] remote: document the 'rm' subcommand
From: Johannes Schindelin @ 2007-07-07 16:21 UTC (permalink / raw)
To: James Bowes; +Cc: gitster, git
In-Reply-To: <20070707152242.GC19782@crux.rdu.redhat.com>
Hi,
On Sat, 7 Jul 2007, James Bowes wrote:
> Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
> ---
>
> So I still think 'git remote rm' would be nice to have. Here's a bit of
> documentation for it.
Me, too. However, I would feel more comfortable with a test suite that it
actually works as advertised. It is on my TODO list, which keeps growing
on top of it.
Ciao,
Dscho
^ permalink raw reply
* git describe origin ?
From: Francis Moreau @ 2007-07-07 15:51 UTC (permalink / raw)
To: git
Hi,
I was wondering what does 'git describe origin' command mean on a git
repo. Does it mean ?
a/ git describe origin/HEAD
b/ git describe origin/master
c/ something else
I also played with git remote and did something silly like:
$ git remote add bob /tmp/dummy # dummy does not exist
$ git remote show bob
fatal: '/tmp/toto': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
ls-remote --heads /tmp/toto: command returned error: 1
Maybe the output could be improved to be more readable.
Thanks
--
Francis
^ permalink raw reply
* [PATCH] revision: allow selection of commits that do not match a pattern
From: Sven Verdoolaege @ 2007-07-07 15:30 UTC (permalink / raw)
To: Junio C Hamano, git
We do this by maintaining two lists of patterns, one for
those that should match and one for those that should not match.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
Documentation/git-rev-list.txt | 7 ++++-
revision.c | 57 ++++++++++++++++++++++++++++-----------
revision.h | 1 +
3 files changed, 48 insertions(+), 17 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 20dcac6..22bfd60 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -214,11 +214,15 @@ limiting may be applied.
Limit the commits output to ones with author/committer
header lines that match the specified pattern (regular expression).
+ If this option is preceded by an odd number of --not options,
+ then only commits that do not match will be shown.
--grep='pattern'::
Limit the commits output to ones with log message that
matches the specified pattern (regular expression).
+ If this option is preceded by an odd number of --not options,
+ then only commits that do not match will be shown.
--regexp-ignore-case::
@@ -248,7 +252,8 @@ limiting may be applied.
--not::
Reverses the meaning of the '{caret}' prefix (or lack thereof)
- for all following revision specifiers, up to the next '--not'.
+ for all following revision specifiers as well as the result
+ of matching a pattern, up to the next '--not'.
--all::
diff --git a/revision.c b/revision.c
index 5184716..4bf9a0b 100644
--- a/revision.c
+++ b/revision.c
@@ -821,20 +821,30 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
return 0;
}
-static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
+static void add_grep_to_filter(struct grep_opt **filter, const char *ptn,
+ enum grep_pat_token what)
{
- if (!revs->grep_filter) {
+ if (!*filter) {
struct grep_opt *opt = xcalloc(1, sizeof(*opt));
opt->status_only = 1;
opt->pattern_tail = &(opt->pattern_list);
opt->regflags = REG_NEWLINE;
- revs->grep_filter = opt;
+ *filter = opt;
}
- append_grep_pattern(revs->grep_filter, ptn,
- "command line", 0, what);
+ append_grep_pattern(*filter, ptn, "command line", 0, what);
}
-static void add_header_grep(struct rev_info *revs, const char *field, const char *pattern)
+static void add_grep(struct rev_info *revs, const char *ptn,
+ enum grep_pat_token what, int not)
+{
+ if (not)
+ add_grep_to_filter(&revs->grep_neg_filter, ptn, what);
+ else
+ add_grep_to_filter(&revs->grep_filter, ptn, what);
+}
+
+static void add_header_grep(struct rev_info *revs, const char *field,
+ const char *pattern, int not)
{
char *pat;
const char *prefix;
@@ -849,12 +859,14 @@ static void add_header_grep(struct rev_info *revs, const char *field, const char
pattern++;
}
sprintf(pat, "^%s %s%s", field, prefix, pattern);
- add_grep(revs, pat, GREP_PATTERN_HEAD);
+ fprintf(stderr, "not: %d\n", not);
+ add_grep(revs, pat, GREP_PATTERN_HEAD, not);
}
-static void add_message_grep(struct rev_info *revs, const char *pattern)
+static void add_message_grep(struct rev_info *revs, const char *pattern,
+ int not)
{
- add_grep(revs, pattern, GREP_PATTERN_BODY);
+ add_grep(revs, pattern, GREP_PATTERN_BODY, not);
}
static void add_ignore_packed(struct rev_info *revs, const char *name)
@@ -1141,15 +1153,18 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
* Grepping the commit log
*/
if (!prefixcmp(arg, "--author=")) {
- add_header_grep(revs, "author", arg+9);
+ add_header_grep(revs, "author", arg+9,
+ flags & UNINTERESTING);
continue;
}
if (!prefixcmp(arg, "--committer=")) {
- add_header_grep(revs, "committer", arg+12);
+ add_header_grep(revs, "committer", arg+12,
+ flags & UNINTERESTING);
continue;
}
if (!prefixcmp(arg, "--grep=")) {
- add_message_grep(revs, arg+7);
+ add_message_grep(revs, arg+7,
+ flags & UNINTERESTING);
continue;
}
if (!prefixcmp(arg, "--extended-regexp")) {
@@ -1212,6 +1227,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (revs->grep_filter)
revs->grep_filter->regflags |= regflags;
+ if (revs->grep_neg_filter)
+ revs->grep_neg_filter->regflags |= regflags;
+
if (show_merge)
prepare_show_merge(revs);
if (def && !revs->pending.nr) {
@@ -1249,6 +1267,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
compile_grep_patterns(revs->grep_filter);
}
+ if (revs->grep_neg_filter) {
+ compile_grep_patterns(revs->grep_neg_filter);
+ }
+
return left;
}
@@ -1329,11 +1351,14 @@ static int rewrite_parents(struct rev_info *revs, struct commit *commit)
static int commit_match(struct commit *commit, struct rev_info *opt)
{
- if (!opt->grep_filter)
- return 1;
- return grep_buffer(opt->grep_filter,
+ return (!opt->grep_filter ||
+ grep_buffer(opt->grep_filter,
+ NULL, /* we say nothing, not even filename */
+ commit->buffer, strlen(commit->buffer))) &&
+ (!opt->grep_neg_filter ||
+ !grep_buffer(opt->grep_neg_filter,
NULL, /* we say nothing, not even filename */
- commit->buffer, strlen(commit->buffer));
+ commit->buffer, strlen(commit->buffer)));
}
static struct commit *get_revision_1(struct rev_info *revs)
diff --git a/revision.h b/revision.h
index f46b4d5..9728d4c 100644
--- a/revision.h
+++ b/revision.h
@@ -84,6 +84,7 @@ struct rev_info {
/* Filter by commit log message */
struct grep_opt *grep_filter;
+ struct grep_opt *grep_neg_filter;
/* special limits */
int skip_count;
--
1.5.3.rc0.40.g46ad-dirty
^ permalink raw reply related
* [PATCH] remote: document the 'rm' subcommand
From: James Bowes @ 2007-07-07 15:22 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: gitster, git
In-Reply-To: <Pine.LNX.4.64.0707052338150.9789@racer.site>
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
So I still think 'git remote rm' would be nice to have. Here's a bit of
documentation for it.
Documentation/git-remote.txt | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 61a6022..fff40ca 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -11,6 +11,7 @@ SYNOPSIS
[verse]
'git-remote'
'git-remote' add [-t <branch>] [-m <branch>] [-f] <name> <url>
+'git-remote' rm <name>
'git-remote' show <name>
'git-remote' prune <name>
'git-remote' update [group]
@@ -46,6 +47,11 @@ With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set
up to point at remote's `<master>` branch instead of whatever
branch the `HEAD` at the remote repository actually points at.
+'rm'::
+
+Remove the remote named <name>. All remote tracking branches and
+configuration settings for the remote are removed.
+
'show'::
Gives some information about the remote <name>.
--
1.5.3.rc0.838.gdf39a-dirty
^ permalink raw reply related
* [PATCH] stash: allow running from a subdirectory
From: James Bowes @ 2007-07-07 14:29 UTC (permalink / raw)
To: git, gitster
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
git-stash.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index 5c63ca5..eac5551 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -3,6 +3,7 @@
USAGE='[ | list | show | apply | clear]'
+SUBDIRECTORY_OK=Yes
. git-sh-setup
require_work_tree
--
1.5.3.rc0.837.g4574c
^ permalink raw reply related
* Re: Cherry-picking to remote branches
From: Sean Kelley @ 2007-07-07 13:00 UTC (permalink / raw)
To: git
In-Reply-To: <a2e879e50707060709oc9fe8b3k8e594f1cb6e10437@mail.gmail.com>
On 7/6/07, Sean Kelley <svk.sweng@gmail.com> wrote:
> I have been having trouble with the following workflow. I am trying
> to push changes to a remote from a branch that is tracking it.
Is there a better way to do this? Basically I want to push from the
branch to the remote. But it doesn't seem to work at least without
pushing the branch itself as a new head to the remote. Perhaps the
better way to do it is to have two different directories:
1) clone the linux-devel.git and have a read-only remote to
linux-stable to fetch changes and cherry-pick.
2) clone the linux-stable.git and have a read-only remote to
linux-devel to fetch changes and cherry-pick
So you would just cd to the specific one you want to work with.
Sean
>
> git clone git://mysite.com/data/git/linux-devel.git linux-devel
>
> cd linux-devel
>
> git remote add -m master -f linux-stable
> git://mysite.com/data/git/linux-stable.git
>
> git branch -r
>
> linux-stable/HEAD
> linux-stable/master
> origin/HEAD
> origin/master
>
> git checkout -b stable linux-stable/master
>
> git cherry-pick b3b1eea69a (a commit from linux-devel)
>
> git push linux-stable
>
> error: remote 'refs/heads/master' is not a strict subset of local ref
> 'refs/heads/master'. maybe you are not up-to-date and need to pull
> first?
> error: failed to push to 'git://mysite.com/data/git/linux-stable.git'
>
> Thanks for your help,
>
>
> Sean
>
^ permalink raw reply
* Re: [PATCH] Enable "git rerere" by the config variable rerere.enabled
From: Johannes Schindelin @ 2007-07-07 12:41 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Shawn O. Pearce
In-Reply-To: <7vejjkdaqe.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 6 Jul 2007, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > And yeah, the git-gui part should be factored out, I guess. Shawn?
>
> I'll exclude git-gui part and commit with a minor tweaks;
Thank you. I planned to redo the patch when consensus is reached that this
is actually a good patch. But as usual, you're faster.
> > -int cmd_rerere(int argc, const char **argv, const char *prefix)
> > +int is_rerere_enabled(void)
> > {
>
> This will be "static".
But of course!
> > + const char *rr_cache = git_path("rr-cache");
> > + int rr_cache_exists;
> >
> > - if (stat(git_path("rr-cache"), &st) || !S_ISDIR(st.st_mode))
> > + if (!rerere_enabled)
> > return 0;
>
> As git_path() is not zero-cost, assignment to rr_cache will be
> moved here.
Yes, fully agree. It probably does not matter much right now, as
git-rerere is mostly called from scripts, and thus does a fork() && exec()
anyway, but I am smilingly awaiting the first full-fledged builtin
implementation of "git commit", in which case this very function should
move somewhere else, and there it does matter a bit more.
> > + rr_cache_exists = !stat(rr_cache, &st) && S_ISDIR(st.st_mode);
> > + if (rerere_enabled < 0)
> > + return rr_cache_exists;
> > +
> > + if (!rr_cache_exists && (mkdir(rr_cache, 0777) ||
> > + adjust_shared_perm(rr_cache)))
> > + die("Could not create directory %s", rr_cache);
> > + return 1;
> > +}
>
> If rr-cache is a regular file, we will hit "Could not create
> directory" which is exactly what we want anyway. Even if it is
> a dangling symlink, it would fail with "File exists", so that
> should be Ok.
That was the intended error path, yes. It does not safeguard against old
behaviour, where you could ": > .git/rr-cache", and be wondering why it is
not activating rr-cache ;-)
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] Per-path attribute based hunk header selection.
From: Johannes Schindelin @ 2007-07-07 12:17 UTC (permalink / raw)
To: Junio C Hamano
Cc: しらいしななこ,
Linus Torvalds, git
In-Reply-To: <7vabu88qem.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2527 bytes --]
Hi,
On Sat, 7 Jul 2007, Junio C Hamano wrote:
> しらいしななこ <nanako3@bluebottle.com> writes:
>
> > I would love to see "diff=tex" attribute to work on my manuscripts,
> > [...]
> > It does not work well, however. It shows only part of lines.
> >
> > @@ -8,7 +8,8 @@ \section{
> > @@ -224,7 +225,7 @@ sub
> > @@ -240,7 +241,7 @@ subsub
> >
> > I have no idea what am I doing wrong (truthfully, I do not know what I
> > am doing, period).
Those are regular expressions. Read more about them here:
http://en.wikipedia.org/wiki/Regular_expression
> > + if (!strcmp(ident, "tex"))
> > + return "^\\\\\\(sub\\)*section{";
It is always easier, and will never require C skills, to put this into the
config. With Junio's current version:
echo '*.tex funcname=tex' >> .gitattributes
echo '[funcname] tex = ^\(\\\(sub\)*section{.*\)' >> .git/config
The problem is of course that the backslashes have to be escaped _both_ in
C and in regexps.
You could write that much simpler, though:
\\[a-z]*section.*
It would work the same, in practice, because if something like
\supercoolsection is defined, you are likely wanting to match that, too.
> Johannes, it strikes me that it is very odd having to add ".*$" at the
> end and to surround the whole thing in a parentheses. Shouldn't the
> ff_regexp() grabber simply pick the whole line? After all, that is what
> GNU "diff -p -F RE" does.
Yes, but then you can forget about your hierarchical idea.
Or maybe not, since I am still awaiting a sane syntax for that, which
would probably have to solve just one more problem.
Here is a patch for the rest of the line thing:
diff --git a/xdiff-interface.c b/xdiff-interface.c
index be866d1..9503dfb 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -156,7 +156,7 @@ static long ff_regexp(const char *line, long len,
}
i = pmatch[1].rm_so >= 0 ? 1 : 0;
line += pmatch[i].rm_so;
- result = pmatch[i].rm_eo - pmatch[i].rm_so;
+ result = (int)len - pmatch[i].rm_so;
if (result > buffer_size)
result = buffer_size;
else
> Also this makes me realize that not all contents in the world are not
> programming language source files, and "funcname" is a misnomer. For
> this one, however, we _can_ blame GNU diff, as they call this
> --show-function-line option ;-)
Okay.
How about sorting out the other technical issues first
(diff.<type>.funcname instead of funcname.<type>), leaving the names
alone, and then rename the remaining references of funcname to hunkheader?
Ciao,
Dscho
^ permalink raw reply related
* Re: [PATCH] Per-path attribute based hunk header selection.
From: Junio C Hamano @ 2007-07-07 10:22 UTC (permalink / raw)
To: しらいしななこ
Cc: Linus Torvalds, Johannes Schindelin, git
In-Reply-To: <200707071011.l67AB9rg005792@mi0.bluebottle.com>
しらいしななこ <nanako3@bluebottle.com> writes:
> I would love to see "diff=tex" attribute to work on my manuscripts, but I
> do not write C and do not understand the long length of backslashes very
> well. I guessed in the source file a backslash needs to be doubled, and
> what I want to match is "\section{", "\subsection{", and "\subsubsection{"
> at the beginning of lines, and attempted to do it like the patch at the
> end.
Heh, I do not speak TeX very well, so we are even ;-)
> It does not work well, however. It shows only part of lines.
>
> @@ -8,7 +8,8 @@ \section{
> @@ -224,7 +225,7 @@ sub
> @@ -240,7 +241,7 @@ subsub
>
> I have no idea what am I doing wrong (truthfully, I do not know what I am
> doing, period).
>
> diff --git a/diff.c b/diff.c
> index 04e7e91..57f91b0 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1226,6 +1226,8 @@ static const char *diff_hunk_header_regexp(struct diff_filespec *one)
> "^[ ]*\\(\\([ ]*"
> "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
> "[ ]*([^;]*$\\)";
> + if (!strcmp(ident, "tex"))
> + return "^\\\\\\(sub\\)*section{";
>
> return NULL;
> }
It's getting late so I won't be testing this myself tonight, but
I think
return "^\\(\\\\\\(sub\\)*section{.*\\)$";
would do the job.
HOWEVER.
Johannes, it strikes me that it is very odd having to add ".*$"
at the end and to surround the whole thing in a parentheses.
Shouldn't the ff_regexp() grabber simply pick the whole line?
After all, that is what GNU "diff -p -F RE" does.
Also this makes me realize that not all contents in the world
are not programming language source files, and "funcname" is
a misnomer. For this one, however, we _can_ blame GNU diff, as
they call this --show-function-line option ;-)
^ permalink raw reply
* Re: Possible BUG in 'git log --parents'
From: Marco Costalba @ 2007-07-07 10:14 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <7vps348qzi.fsf@assigned-by-dhcp.cox.net>
On 7/7/07, Junio C Hamano <gitster@pobox.com> wrote:
>
> Line wrapping in the middle of a single object name makes it
> hard to read doesn't it?
>
Sorry!
> I recall we added an extra logic in rev-list side to squash the
> parent commits that artificially becomes duplicate due to this
> history simplification logic, which we might want to port to
> git-log. However, I have a slight suspicion that we earlier
> decided not to do so on purpose with git-log and for a good
> reason. I do not have much energy left tonight to dig into this
> right now, but mailing list log and commit log messages for
> rev-list.c, builtin-log.c and builtin-rev-list.c might tell you
> more.
>
I will take a look hoping to *not* find anything important, now that
qgit rely on git log instead of git-rev-list to show the graph, I
would really hope that it is possible to patch git-log in the same way
then git-rev-list.
Thanks
Marco
^ permalink raw reply
* [PATCH] Fix configuration syntax to specify customized hunk header patterns.
From: Junio C Hamano @ 2007-07-07 10:12 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Johannes Schindelin, git
In-Reply-To: <alpine.LFD.0.98.0707061051020.9434@woody.linux-foundation.org>
This updates the hunk header customization syntax. The special
case 'funcname' attribute is gone. It also uses the name
'funcname" throughout, instead of "hunk_header".
You assign the name of the type of contents to path's "diff"
attribute as a string value in .gitattributes like this:
*.java diff=java
*.perl diff=perl
*.doc diff=doc
If you supply "diff.<name>.funcname" variable via the
configuration mechanism (e.g. in $HOME/.gitconfig), the value is
used as the regexp set to find the line to use for the hunk
header (the variable is called "funcname" because such a line
typically is the one that has the name of the function in
programming language source text).
If there is no such configuration, built-in default is used, if
any. Currently there are two default patterns: default and java.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff.c | 147 +++++++++++++++++++++++++---------------------
diffcore.h | 2 +-
t/t4018-diff-funcname.sh | 6 +-
3 files changed, 84 insertions(+), 71 deletions(-)
diff --git a/diff.c b/diff.c
index 04e7e91..21e61af 100644
--- a/diff.c
+++ b/diff.c
@@ -56,6 +56,14 @@ static struct ll_diff_driver {
char *cmd;
} *user_diff, **user_diff_tail;
+static void read_config_if_needed(void)
+{
+ if (!user_diff_tail) {
+ user_diff_tail = &user_diff;
+ git_config(git_diff_ui_config);
+ }
+}
+
/*
* Currently there is only "diff.<drivername>.command" variable;
* because there are "diff.color.<slot>" variables, we are parsing
@@ -94,6 +102,45 @@ static int parse_lldiff_command(const char *var, const char *ep, const char *val
}
/*
+ * 'diff.<what>.funcname' attribute can be specified in the configuration
+ * to define a customized regexp to find the beginning of a function to
+ * be used for hunk header lines of "diff -p" style output.
+ */
+static struct funcname_pattern {
+ char *name;
+ char *pattern;
+ struct funcname_pattern *next;
+} *funcname_pattern_list;
+
+static int parse_funcname_pattern(const char *var, const char *ep, const char *value)
+{
+ const char *name;
+ int namelen;
+ struct funcname_pattern *pp;
+
+ name = var + 5; /* "diff." */
+ namelen = ep - name;
+
+ for (pp = funcname_pattern_list; pp; pp = pp->next)
+ if (!strncmp(pp->name, name, namelen) && !pp->name[namelen])
+ break;
+ if (!pp) {
+ char *namebuf;
+ pp = xcalloc(1, sizeof(*pp));
+ namebuf = xmalloc(namelen + 1);
+ memcpy(namebuf, name, namelen);
+ namebuf[namelen] = 0;
+ pp->name = namebuf;
+ pp->next = funcname_pattern_list;
+ funcname_pattern_list = pp;
+ }
+ if (pp->pattern)
+ free(pp->pattern);
+ pp->pattern = xstrdup(value);
+ return 0;
+}
+
+/*
* These are to give UI layer defaults.
* The core-level commands such as git-diff-files should
* never be affected by the setting of diff.renames
@@ -122,8 +169,12 @@ int git_diff_ui_config(const char *var, const char *value)
if (!prefixcmp(var, "diff.")) {
const char *ep = strrchr(var, '.');
- if (ep != var + 4 && !strcmp(ep, ".command"))
- return parse_lldiff_command(var, ep, value);
+ if (ep != var + 4) {
+ if (!strcmp(ep, ".command"))
+ return parse_lldiff_command(var, ep, value);
+ if (!strcmp(ep, ".funcname"))
+ return parse_funcname_pattern(var, ep, value);
+ }
}
if (!prefixcmp(var, "diff.color.") || !prefixcmp(var, "color.diff.")) {
int slot = parse_diff_color_slot(var, 11);
@@ -1101,43 +1152,39 @@ static void emit_binary_diff(mmfile_t *one, mmfile_t *two)
static void setup_diff_attr_check(struct git_attr_check *check)
{
static struct git_attr *attr_diff;
- static struct git_attr *attr_diff_func_name;
if (!attr_diff) {
attr_diff = git_attr("diff", 4);
- attr_diff_func_name = git_attr("funcname", 8);
}
check[0].attr = attr_diff;
- check[1].attr = attr_diff_func_name;
}
static void diff_filespec_check_attr(struct diff_filespec *one)
{
- struct git_attr_check attr_diff_check[2];
+ struct git_attr_check attr_diff_check;
if (one->checked_attr)
return;
- setup_diff_attr_check(attr_diff_check);
+ setup_diff_attr_check(&attr_diff_check);
one->is_binary = 0;
- one->hunk_header_ident = NULL;
+ one->funcname_pattern_ident = NULL;
- if (!git_checkattr(one->path, ARRAY_SIZE(attr_diff_check), attr_diff_check)) {
+ if (!git_checkattr(one->path, 1, &attr_diff_check)) {
const char *value;
/* binaryness */
- value = attr_diff_check[0].value;
+ value = attr_diff_check.value;
if (ATTR_TRUE(value))
;
else if (ATTR_FALSE(value))
one->is_binary = 1;
- /* hunk header ident */
- value = attr_diff_check[1].value;
+ /* funcname pattern ident */
if (ATTR_TRUE(value) || ATTR_FALSE(value) || ATTR_UNSET(value))
;
else
- one->hunk_header_ident = value;
+ one->funcname_pattern_ident = value;
}
if (!one->data && DIFF_FILE_VALID(one))
@@ -1154,54 +1201,23 @@ int diff_filespec_is_binary(struct diff_filespec *one)
return one->is_binary;
}
-static struct hunk_header_regexp {
- char *name;
- char *regexp;
- struct hunk_header_regexp *next;
-} *hunk_header_regexp_list, **hunk_header_regexp_tail;
-
-static int hunk_header_config(const char *var, const char *value)
+static const char *funcname_pattern(const char *ident)
{
- static const char funcname[] = "funcname.";
- struct hunk_header_regexp *hh;
+ struct funcname_pattern *pp;
- if (prefixcmp(var, funcname))
- return 0;
- var += strlen(funcname);
- for (hh = hunk_header_regexp_list; hh; hh = hh->next)
- if (!strcmp(var, hh->name)) {
- free(hh->regexp);
- hh->regexp = xstrdup(value);
- return 0;
- }
- hh = xcalloc(1, sizeof(*hh));
- hh->name = xstrdup(var);
- hh->regexp = xstrdup(value);
- hh->next = NULL;
- *hunk_header_regexp_tail = hh;
- return 0;
-}
-
-static const char *hunk_header_regexp(const char *ident)
-{
- struct hunk_header_regexp *hh;
-
- if (!hunk_header_regexp_tail) {
- hunk_header_regexp_tail = &hunk_header_regexp_list;
- git_config(hunk_header_config);
- }
- for (hh = hunk_header_regexp_list; hh; hh = hh->next)
- if (!strcmp(ident, hh->name))
- return hh->regexp;
+ read_config_if_needed();
+ for (pp = funcname_pattern_list; pp; pp = pp->next)
+ if (!strcmp(ident, pp->name))
+ return pp->pattern;
return NULL;
}
-static const char *diff_hunk_header_regexp(struct diff_filespec *one)
+static const char *diff_funcname_pattern(struct diff_filespec *one)
{
- const char *ident, *regexp;
+ const char *ident, *pattern;
diff_filespec_check_attr(one);
- ident = one->hunk_header_ident;
+ ident = one->funcname_pattern_ident;
if (!ident)
/*
@@ -1209,12 +1225,12 @@ static const char *diff_hunk_header_regexp(struct diff_filespec *one)
* regexp is used; otherwise NULL is returned and xemit uses
* the built-in default.
*/
- return hunk_header_regexp("default");
+ return funcname_pattern("default");
/* Look up custom "funcname.$ident" regexp from config. */
- regexp = hunk_header_regexp(ident);
- if (regexp)
- return regexp;
+ pattern = funcname_pattern(ident);
+ if (pattern)
+ return pattern;
/*
* And define built-in fallback patterns here. Note that
@@ -1304,11 +1320,11 @@ static void builtin_diff(const char *name_a,
xdemitconf_t xecfg;
xdemitcb_t ecb;
struct emit_callback ecbdata;
- const char *hunk_header_regexp;
+ const char *funcname_pattern;
- hunk_header_regexp = diff_hunk_header_regexp(one);
- if (!hunk_header_regexp)
- hunk_header_regexp = diff_hunk_header_regexp(two);
+ funcname_pattern = diff_funcname_pattern(one);
+ if (!funcname_pattern)
+ funcname_pattern = diff_funcname_pattern(two);
memset(&xecfg, 0, sizeof(xecfg));
memset(&ecbdata, 0, sizeof(ecbdata));
@@ -1318,8 +1334,8 @@ static void builtin_diff(const char *name_a,
xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
xecfg.ctxlen = o->context;
xecfg.flags = XDL_EMIT_FUNCNAMES;
- if (hunk_header_regexp)
- xdiff_set_find_func(&xecfg, hunk_header_regexp);
+ if (funcname_pattern)
+ xdiff_set_find_func(&xecfg, funcname_pattern);
if (!diffopts)
;
else if (!prefixcmp(diffopts, "--unified="))
@@ -1862,10 +1878,7 @@ static const char *external_diff_attr(const char *name)
!ATTR_UNSET(value)) {
struct ll_diff_driver *drv;
- if (!user_diff_tail) {
- user_diff_tail = &user_diff;
- git_config(git_diff_ui_config);
- }
+ read_config_if_needed();
for (drv = user_diff; drv; drv = drv->next)
if (!strcmp(drv->name, value))
return drv->cmd;
diff --git a/diffcore.h b/diffcore.h
index 0598514..eef17c4 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -27,7 +27,7 @@ struct diff_filespec {
char *path;
void *data;
void *cnt_data;
- const void *hunk_header_ident;
+ const char *funcname_pattern_ident;
unsigned long size;
int xfrm_flags; /* for use by the xfrm */
unsigned short mode; /* file mode */
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index dc7a47b..f9db81d 100644
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -38,12 +38,12 @@ test_expect_success 'default behaviour' '
'
test_expect_success 'preset java pattern' '
- echo "*.java funcname=java" >.gitattributes &&
+ echo "*.java diff=java" >.gitattributes &&
git diff Beer.java Beer-correct.java |
grep "^@@.*@@ public static void main("
'
-git config funcname.java '!static
+git config diff.java.funcname '!static
!String
[^ ].*s.*'
@@ -53,7 +53,7 @@ test_expect_success 'custom pattern' '
'
test_expect_success 'last regexp must not be negated' '
- git config diff.functionnameregexp "!static" &&
+ git config diff.java.funcname "!static" &&
! git diff Beer.java Beer-correct.java
'
--
1.5.3.rc0.837.g4574c
^ permalink raw reply related
* Re: [PATCH] Per-path attribute based hunk header selection.
From: しらいしななこ @ 2007-07-07 10:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Linus Torvalds, Johannes Schindelin, git
In-Reply-To: <7v8x9tdlbv.fsf@assigned-by-dhcp.cox.net>
Quoting Junio C Hamano <gitster@pobox.com>:
> Yeah, I'd be lying if I said that this did not cross my mind
> when I saw existing diff.*.command handling.
>
> About the comment from Johannes regarding hunk_header vs
> funcname, I would actually prefer hunk_header, since that is
> what this is about ("funcname" and "find_func" were misnomer
> from the beginning), but I'd rename hunk_header to funcname for
> the sake of consistency and minimizing the diff.
I would love to see "diff=tex" attribute to work on my manuscripts, but I
do not write C and do not understand the long length of backslashes very
well. I guessed in the source file a backslash needs to be doubled, and
what I want to match is "\section{", "\subsection{", and "\subsubsection{"
at the beginning of lines, and attempted to do it like the patch at the
end.
It does not work well, however. It shows only part of lines.
@@ -8,7 +8,8 @@ \section{
@@ -224,7 +225,7 @@ sub
@@ -240,7 +241,7 @@ subsub
I have no idea what am I doing wrong (truthfully, I do not know what I am
doing, period).
diff --git a/diff.c b/diff.c
index 04e7e91..57f91b0 100644
--- a/diff.c
+++ b/diff.c
@@ -1226,6 +1226,8 @@ static const char *diff_hunk_header_regexp(struct diff_filespec *one)
"^[ ]*\\(\\([ ]*"
"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
"[ ]*([^;]*$\\)";
+ if (!strcmp(ident, "tex"))
+ return "^\\\\\\(sub\\)*section{";
return NULL;
}
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
----------------------------------------------------------------------
Finally - A spam blocker that actually works.
http://www.bluebottle.com/tag/4
^ permalink raw reply related
* Re: Possible BUG in 'git log --parents'
From: Junio C Hamano @ 2007-07-07 10:09 UTC (permalink / raw)
To: Marco Costalba; +Cc: Git Mailing List
In-Reply-To: <e5bfff550707070249i6f3f7288uce1f922686f6e14d@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
> git-rev-list shows parents correctly, git-log no, in particulary there
> is parent 913419f that is shown 3 times instead of 1. Testing on git
> repository.
>
> $ git-log --parents --pretty=raw addafaf92e -n1 -- diff.h
> commit addafaf92eeb86033da91323d0d3ad7a496dae83
> 913419fcc648dd43d7f7afdd94fa25aee4f9798a 913419fcc648dd43d7f7a
> fdd94fa25aee4f9798a ea726d02e9677a66586d7ffebe97f112ab6dab33
> 913419fcc648dd43d7f7afdd94fa25aee4f9798a 46a6c262
> 0ba421397eec627b8eb18eb530e694fc
> tree e3be15f54f01e3aa1f8ec830ac87da5f85a23480
> parent 6b94f1e404afc552e5139c4357331843f5be61ad
> parent 93b74bca86f59b8df410b6fd4803b88ee0f304bf
> parent ea726d02e9677a66586d7ffebe97f112ab6dab33
> parent b33aba518456bee97bde1fef4fe17ab6bf401bbe
> parent 6b1ddbdd6e02719ae2be55dc141a176187e5027e
> author Junio C Hamano <junkio@cox.net> 1138436169 -0800
> committer Junio C Hamano <junkio@cox.net> 1138436169 -0800
Line wrapping in the middle of a single object name makes it
hard to read doesn't it?
The commit does have 5 parents, among which, three of them merge
branches that do not touch the named paths (in this case it
happens to be a single "diff.h") and parent simplification leads
to the same ancestor.
I recall we added an extra logic in rev-list side to squash the
parent commits that artificially becomes duplicate due to this
history simplification logic, which we might want to port to
git-log. However, I have a slight suspicion that we earlier
decided not to do so on purpose with git-log and for a good
reason. I do not have much energy left tonight to dig into this
right now, but mailing list log and commit log messages for
rev-list.c, builtin-log.c and builtin-rev-list.c might tell you
more.
^ permalink raw reply
* Possible BUG in 'git log --parents'
From: Marco Costalba @ 2007-07-07 9:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
git-rev-list shows parents correctly, git-log no, in particulary there
is parent 913419f that is shown 3 times instead of 1. Testing on git
repository.
$ git --version
git version 1.5.3.rc0.11.ge2b1a
$ git-rev-list --parents --header addafaf92e -n1 -- diff.h
addafaf92eeb86033da91323d0d3ad7a496dae83
913419fcc648dd43d7f7afdd94fa25aee4f9798a
ea726d02e9677a66586d7ffebe97f112ab6dab33
46a6c2620ba421397eec627b8eb18eb530e694fc
tree e3be15f54f01e3aa1f8ec830ac87da5f85a23480
parent 6b94f1e404afc552e5139c4357331843f5be61ad
parent 93b74bca86f59b8df410b6fd4803b88ee0f304bf
parent ea726d02e9677a66586d7ffebe97f112ab6dab33
parent b33aba518456bee97bde1fef4fe17ab6bf401bbe
parent 6b1ddbdd6e02719ae2be55dc141a176187e5027e
author Junio C Hamano <junkio@cox.net> 1138436169 -0800
committer Junio C Hamano <junkio@cox.net> 1138436169 -0800
Merge lt/revlist,jc/diff,jc/revparse,jc/abbrev
$ git-log --parents --pretty=raw addafaf92e -n1 -- diff.h
commit addafaf92eeb86033da91323d0d3ad7a496dae83
913419fcc648dd43d7f7afdd94fa25aee4f9798a 913419fcc648dd43d7f7a
fdd94fa25aee4f9798a ea726d02e9677a66586d7ffebe97f112ab6dab33
913419fcc648dd43d7f7afdd94fa25aee4f9798a 46a6c262
0ba421397eec627b8eb18eb530e694fc
tree e3be15f54f01e3aa1f8ec830ac87da5f85a23480
parent 6b94f1e404afc552e5139c4357331843f5be61ad
parent 93b74bca86f59b8df410b6fd4803b88ee0f304bf
parent ea726d02e9677a66586d7ffebe97f112ab6dab33
parent b33aba518456bee97bde1fef4fe17ab6bf401bbe
parent 6b1ddbdd6e02719ae2be55dc141a176187e5027e
author Junio C Hamano <junkio@cox.net> 1138436169 -0800
committer Junio C Hamano <junkio@cox.net> 1138436169 -0800
Merge lt/revlist,jc/diff,jc/revparse,jc/abbrev
^ permalink raw reply
* Recent issues
From: Junio C Hamano @ 2007-07-07 7:31 UTC (permalink / raw)
To: git; +Cc: jnareb, pasky, ltuikov, paulus
Here is a list of recent issues on the list that I am aware of,
but not much have been done on.
To use the Message-ID, you can use:
http://mid.gmane.org/$message_id
where $message_id is the Message-ID without surrounding <>.
* gitweb patches (bunch of them)
From: Matt McCutchen <hashproduct@gmail.com>
Subject: [PATCH] gitweb: snapshot cleanups & support for offering multiple formats
Message-ID: <1183053733.6108.0.camel@mattlaptop2>
From: Matt McCutchen <hashproduct@gmail.com>
Subject: [PATCH] gitweb: make search form generate pathinfo-style URLs
Message-ID: <1183057027.6108.4.camel@mattlaptop2>
From: Matt McCutchen <hashproduct@gmail.com>
Subject: [PATCH] gitweb: make "No commits" in project list gray, not bold green
Message-ID: <1183068922.6108.8.camel@mattlaptop2>
From: Miklos Vajna <vmiklos@frugalware.org>
Subject: [PATCH] gitweb: prefer git_get_project_owner() over get_file_owner()
Message-ID: <20070703221122.GI32766@genesis.frugalware.org>
From: Michael Hendricks <michael@ndrix.org>
Subject: [PATCH] gitweb: configurable width for the projects list Description column
Message-ID: <11835958082458-git-send-email-michael@ndrix.org>
Haven't heard any from gitweb folks about these; I'd take a look
at them if I find time this weekend.
* gitk --left-right
From: Linus Torvalds <torvalds@linux-foundation.org>
Message-ID: <alpine.LFD.0.98.0705051524300.17381@woody.linux-foundation.org>
From: Junio C Hamano <junkio@cox.net>
Message-ID: <7vabwifl23.fsf@assigned-by-dhcp.cox.net>
Paulus?
* gitk tree view fix
From: Brian Downing <bdowning@lavos.net>
Subject: [PATCH] gitk: Fix for tree view ending in nested directories
Message-ID: <20070704212643.GR4087@lavos.net>
Paulus?
* switching branches when b changes between symlink and directory in a/b/c
From: Pierre Habouzit <madcoder@debian.org>
Subject: [BUG (or misfeature?)] git checkout and symlinks
Message-ID: <20070704203541.GA13286@artemis.corp>
Will take a look.
* cherry-pick unexpected conflicts
From: Gerrit Pape <pape@smarden.org>
Subject: Re: unexpected git-cherry-pick conflict
Message-ID: <20070613134336.13661.qmail@c61f4fed932273.315fe32.mid.smarden.org>
* git-apply -R --whitespace=warn
From: Daniel Barkalow <barkalow@iabervon.org>
Message-ID: <Pine.LNX.4.64.0707062155170.6977@iabervon.org>
Subject: Minor bug in git-apply's patch-cleaning
* Use gitattributes for more things.
- Customized "diff -p" markers per path.
From: Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] Per-path attribute based hunk header selection.
Message-ID: <alpine.LFD.0.98.0707061051020.9434@woody.linux-foundation.org>
Will take a look and try to finish this before 1.5.3-rc1.
^ 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