* [BUG] git grep broken on master - won't work when merging
From: Martin Langhoff @ 2007-11-05 23:53 UTC (permalink / raw)
To: git list
Strange behaviour of git grep on one of the projects I hack on...
$ git --version
git version 1.5.3.5.561.g140d
$ git grep LOB lib
fatal: insanely many options to grep
After a bit of head-scratching I realised I was in the middle of a
merge, with some unresolved paths in the lib directory. A bit of
testing shows that the unresolved index is probably the problem:
$ git grep LOB lib
fatal: insanely many options to grep
# an unresolved file
$ git grep LOB lib/accesslib.php
fatal: insanely many options to grep
$ git grep --cached LOB lib
(... expected grep output...)
$ git reset --hard
$ git grep LOB lib
(... expected grep output...)
... not sure what the correct behaviour should be -- I guess the most
reasonable action would be to grep the files on disk for those
unresolved paths. In any case, the error message is insanely many
confusing to user! ;-)
Probably whitespace damaged...
diff --git a/builtin-grep.c b/builtin-grep.c
index c7b45c4..1831ef0 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -213,7 +213,7 @@ static int flush_grep(struct grep_opt *opt,
* arguments even for the call in the main loop.
*/
if (kept)
- die("insanely many options to grep");
+ die("Unresolved index or too many options to grep");
/*
* If we have two or more paths, we do not have to do
cheers,
martin
^ permalink raw reply related
* Re: [ANNOUNCE] cgit v0.7
From: Lars Hjemli @ 2007-11-05 23:53 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git list
In-Reply-To: <1194222569-13948-1-git-send-email-jnareb@gmail.com>
On Nov 5, 2007 1:29 AM, Jakub Narebski <jnareb@gmail.com> wrote:
> * I'm not sure if it wouln't be beter to provide -n/+m lines changed
> instead of nn likes changed column.
Agreed, and fixed.
--
larsh
^ permalink raw reply
* Re: [PATCH 3/3] pretty=format: Avoid some expensive calculations when not needed
From: Johannes Schindelin @ 2007-11-05 23:53 UTC (permalink / raw)
To: René Scharfe; +Cc: Junio C Hamano, git
In-Reply-To: <472F7B2F.4050608@lsrfire.ath.cx>
Hi,
On Mon, 5 Nov 2007, Ren? Scharfe wrote:
> Junio C Hamano schrieb:
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> >> Unfortunately, we cannot reuse the result of that function, which
> >> would be cleaner: there are more users than just git log. Most
> >> notably, git-archive with "$Format:...$" substitution.
> >
> > That makes sense.
> >
> >
> >> diff --git a/pretty.c b/pretty.c
> >> index 490cede..241e91c 100644
> >> --- a/pretty.c
> >> +++ b/pretty.c
> >> @@ -393,6 +393,7 @@ void format_commit_message(const struct commit *commit,
> >> int i;
> >> enum { HEADER, SUBJECT, BODY } state;
> >> const char *msg = commit->buffer;
> >> + char *active = interp_find_active(format, table, ARRAY_SIZE(table));
> >> ...
> >> + if (active[IHASH])
> >> + interp_set_entry(table, IHASH,
> >> + sha1_to_hex(commit->object.sha1));
> >> + if (active[IHASH_ABBREV])
> >> + interp_set_entry(table, IHASH_ABBREV,
> >> find_unique_abbrev(commit->object.sha1,
> >> DEFAULT_ABBREV));
> >
> > Instead of allocating a separate array and freeing at the end,
> > wouldn't it make more sense to have a bitfield that records what
> > is used by the format string inside the array elements?
>
> How about (ab)using the value field? Let interp_find_active() mark
> unneeded entries with NULL, and the rest with some cookie. All table
> entries with non-NULL values need to be initialized. interp_set_entry()
> needs to be aware of this cookie, as it mustn't free() it. The cookie
> could be the address of a static char* in interpolate.c.
Yeah, something like this on top of my earlier patch (and obviously the
corresponding change from "if (active[IHASH])" to
"if (table[IHASH].value)"):
---
interpolate.c | 10 ++++------
interpolate.h | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/interpolate.c b/interpolate.c
index 80eeb36..05a22e1 100644
--- a/interpolate.c
+++ b/interpolate.c
@@ -5,13 +5,14 @@
#include "git-compat-util.h"
#include "interpolate.h"
+static const char *empty_value = "";
void interp_set_entry(struct interp *table, int slot, const char *value)
{
char *oldval = table[slot].value;
char *newval = NULL;
- if (oldval)
+ if (oldval && oldval != empty_value)
free(oldval);
if (value)
@@ -103,10 +104,9 @@ unsigned long interpolate(char *result, unsigned long reslen,
return newlen;
}
-char *interp_find_active(const char *orig,
+void interp_find_active(const char *orig,
const struct interp *interps, int ninterps)
{
- char *result = xcalloc(1, ninterps);
char c;
int i;
@@ -115,10 +115,8 @@ char *interp_find_active(const char *orig,
/* Try to match an interpolation string. */
for (i = 0; i < ninterps; i++)
if (!prefixcmp(orig, interps[i].name + 1)) {
- result[i] = 1;
+ interps[i].value = empty_value;
orig += strlen(interps[i].name + 1);
break;
}
-
- return result;
}
diff --git a/interpolate.h b/interpolate.h
index 2d197c5..19b7ebe 100644
--- a/interpolate.h
+++ b/interpolate.h
@@ -22,7 +22,7 @@ extern void interp_clear_table(struct interp *table, int ninterps);
extern unsigned long interpolate(char *result, unsigned long reslen,
const char *orig,
const struct interp *interps, int ninterps);
-extern char *interp_find_active(const char *orig,
+extern void interp_find_active(const char *orig,
const struct interp *interps, int ninterps);
#endif /* INTERPOLATE_H */
Hmm?
Ciao,
Dscho
^ permalink raw reply related
* Re: [PATCH] Make git-clean a builtin
From: Junio C Hamano @ 2007-11-05 23:54 UTC (permalink / raw)
To: Carlos Rica; +Cc: Junio C Hamano, Shawn Bohrer, git
In-Reply-To: <1b46aba20711051410h370072e7he9cbebb54a789dac@mail.gmail.com>
"Carlos Rica" <jasampler@gmail.com> writes:
> 2007/11/5, Junio C Hamano <gitster@pobox.com>:
>> Shawn Bohrer <shawn.bohrer@gmail.com> writes:
>>
>> > +static int show_only = 0;
>> > +static int remove_directories = 0;
>> > +static int quiet = 0;
>> > +static int ignored = 0;
>> > +static int ignored_only = 0;
>>
>> Please do not explicitly initialize static variables to zero.
>
> Is it really needed to declare those variables outside of a function
> in this case?
I do not think so --- I suspect that this is a simple cut &
paste from the standalone ls-files implementation.
^ permalink raw reply
* Re: [bug in next ?] git-fetch/git-push issue
From: Daniel Barkalow @ 2007-11-05 23:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Pierre Habouzit, Nicolas Pitre, Git ML
In-Reply-To: <7vhck0mg5y.fsf@gitster.siamese.dyndns.org>
On Mon, 5 Nov 2007, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > Which I guess is what you were trying to accomplish by removing the
> > peer_ref, though I think that doesn't distinguish between "didn't match
> > a remote ref" and "had an error." Perhaps we just need an error flag in
> > the ref struct?
>
> I agree that makes the most sense.
>
> As Steffen has been advocating on another thread, depending on
> your workflow, you do not care about some classes of push errors
> per pushed refs. The update of the remote and local tracking
> refs should be done in sync (i.e. if the remote wasn't updated,
> never update the corresponding local), but it can depend on the
> nature of the failure if a failure to update a remote ref should
> result in the non-zero exit status from git-push as a whole.
>
> And to implement that, per-ref error flag would be a good way to
> go, methinks.
I think dropping peer_ref may be the clearest semantics. If push decides
not to actually perform a push, we can just remove it from the list of
operations we're performing. Independant of this, we can decide whether to
signal an error, and whether an error means that the remote end will have
done nothing at all (in which case, we must not update tracking refs).
That is, on top of my changes in other email, Steffan would have the
strictly behind case just not have the "ret = -2" and everything else
would be fine.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: [PATCH] git-revert is one of the most misunderstood command in git, help users out.
From: Pierre Habouzit @ 2007-11-06 0:08 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, Steven Grimm, git
In-Reply-To: <Pine.LNX.4.64.0711052325090.4362@racer.site>
[-- Attachment #1: Type: text/plain, Size: 2950 bytes --]
On Mon, Nov 05, 2007 at 11:40:46PM +0000, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 5 Nov 2007, Junio C Hamano wrote:
>
> > Steven Grimm <koreth@midwinter.com> writes:
> >
> > > But that suggested command is not going to convince anyone they were
> > > wrong about git being hard to learn. I wonder if instead of saying, "I
> > > know what you meant, but I'm going to make you type a different
> > > command," we should make git revert just do what the user meant.
> > >
> > > There is already precedent for that kind of mixed-mode UI:
> > >
> > > git checkout my-branch
> > > vs.
> > > git checkout my/source/file.c
> >
> > That's an example of mixed-mode UI, but what you are suggesting is quite
> > different, isn't it?
> >
> > There is no other officially supported single-command-way to
> > checkout paths out of the index.
>
> Okay, let's step back a bit.
>
> We taught "git show" to show other objects than commits, by doing the
> obvious things. So there _is_ a precendent to changing a commands
> behaviour to accept more than just commits. And there was already another
> command for the same purpose, cat-file, which was never meant as
> porcelain however.
>
> Now, what does "revert" _mean_? At the moment, it wants a commit, and
> will undo the changes that commit introduced, _and commits it_ (asking
> for a message).
>
> What would I expect "git revert -- file" to do? It would undo the changes
> to that file -- and since no commit was specified, I would expect it to
> look at the changes against the index. (IOW exactly what Steven
> proposed.)
>
> To continue the analogy, it would have to commit the undoing of the
> change. But since that change never was committed, I think it is more
> natural to _not_ commit it.
>
> In the same way, I would expect "git revert <commit> -- file" to undo the
> changes in that commit to _that_ file (something like "git merge-file
> file <commit>:file <commit>^:file"), but this time commit it, since it
> was committed at one stage.
I agree that this is something that really makes sense to me, and does
not looks like a perversion of the UI, and quite a nice extension in
fact. And it would _finally_ solve the issue that for _ANYTHING_ on the
planet that I've used for more than 10 seconds, $SCM revert path/to/file
reverts local changes :)
When you look at how git-revert is implemented, you'll see that it
uses the very same code as git cherry-pick does, and in fact, I've
wanted a git cherry-pick <commit> -- path1 path2 path3 for a _very_ long
time, and your proposal would just gracefully give it as a bonus I
believe (of course uncommited changes have no sense for a cherry-pick).
I like it a lot.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: git pull opinion
From: Johannes Schindelin @ 2007-11-06 0:08 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <fgo5dt$avh$1@ger.gmane.org>
Hi,
On Mon, 5 Nov 2007, Jakub Narebski wrote:
> Aghiles wrote:
>
> > I am not sure this is the best place to write about this. Anyway,
> > we just switched a couple of repositories to git (from svn) here
> > at work and one thing people find annoying is a pull into
> > a dirty directory. Before the "stash" feature it was even worse
> > but now we can type:
> >
> > ? ? git stash
> > ? ? git pull
> > ? ? git stash apply
> >
> > But isn't that something we should be able to specify to the "pull"
> > command ?
>
> If I remember correctly there is/was some preliminary work (at most 'pu'
> stages) about adding --dirty option to git-merge, git-pull and git-rebase.
There was, but AFAICT these are dead now.
The consense was that you are much better off committing first, then
pulling. And if the work you are doing really is not committable, but you
_have_ to pull _now_, you use stash. Although you are quite likely to
revert the pull when it succeeds, and _then_ unstash.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] t5530-upload-pack-error: Check more carefully for failures.
From: Junio C Hamano @ 2007-11-06 0:22 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In-Reply-To: <200711052240.12822.johannes.sixt@telecom.at>
Johannes Sixt <johannes.sixt@telecom.at> writes:
> On Monday 05 November 2007 21:05, Junio C Hamano wrote:
> > > The test case checks for failures in rev-list (a missing
> > > object). Any hints how to trigger a failure in pack-objects
> > > that does not also trigger in rev-list would be welcome.
> >
> > How about removing a blob from the test repository to corrupt
> > it? rev-list --objects I think would happily list the blob
> > because it sees its name in its containing tree without checking
> > its existence.
>
> That does it. This goes on top of my previous patch.
Thanks. Will squash with further changes attached for readability.
---
t/t5530-upload-pack-error.sh | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh
index 70d4f86..cc8949e 100755
--- a/t/t5530-upload-pack-error.sh
+++ b/t/t5530-upload-pack-error.sh
@@ -6,6 +6,13 @@ test_description='errors in upload-pack'
D=`pwd`
+corrupt_repo () {
+ object_sha1=$(git rev-parse "$1") &&
+ ob=$(expr "$object_sha1" : "\(..\)") &&
+ ject=$(expr "$object_sha1" : "..\(..*\)") &&
+ rm -f ".git/objects/$ob/$ject"
+}
+
test_expect_success 'setup and corrupt repository' '
echo file >file &&
@@ -15,7 +22,7 @@ test_expect_success 'setup and corrupt repository' '
test_tick &&
echo changed >file &&
git commit -a -m changed &&
- rm -f .git/objects/5e/a2ed416fbd4a4cbe227b75fe255dd7fa6bd4d6
+ corrupt_repo HEAD:file
'
@@ -35,7 +42,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects' '
test_expect_success 'corrupt repo differently' '
git hash-object -w file &&
- rm -f .git/objects/be/c63e37d08c454ad3a60cde90b70f3f7d077852
+ corrupt_repo HEAD^^{tree}
'
^ permalink raw reply related
* Re: git pull opinion
From: Bill Lear @ 2007-11-06 0:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Aghiles, git
In-Reply-To: <7vd4uomfn8.fsf@gitster.siamese.dyndns.org>
On Monday, November 5, 2007 at 15:33:31 (-0800) Junio C Hamano writes:
>Aghiles <aghilesk@gmail.com> writes:
>
>> Is there an "easier" way to pull into a dirty directory ? I am
>> asking this to make sure I understand the problem and not
>> because I find it annoying to type those 4 commands to perform
>> a pull (although some of my colleagues do find that annoying :).
>
>You need to switch your mindset from centralized SVN workflow.
>
>The beauty of distributedness is that it redefines the meaning
>of "to commit". In distributed systems, the act of committing
>is purely checkpointing and it is not associated with publishing
>the result to others as centralized systems force you to.
>
>Stop thinking like "I need to integrate the changes from
>upstream into my WIP to keep up to date." You first finish what
>you are currently doing, at least to the point that it is
>stable, make a commit to mark that state, and then start
>thinking about what other people did. You may most likely do a
>"git fetch" followed by "git rebase" to update your WIP on top
>of the updated work by others.
>
>Once you get used to that, you would not have "a dirty
>directory" problem.
I respectfully beg to differ. I think it is entirely reasonable, and
not a sign of "centralized" mindset, to want to pull changes others
have made into your dirty repository with a single command.
Bill
^ permalink raw reply
* Re: [PATCH] gc: use parse_options
From: Junio C Hamano @ 2007-11-06 0:37 UTC (permalink / raw)
To: Brandon Casey; +Cc: James Bowes, git
In-Reply-To: <472FA26E.4060706@nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
> Junio C Hamano wrote:
>> James Bowes <jbowes@dangerouslyinc.com> writes:
>>
>>> + struct option builtin_gc_options[] = {
>>> + OPT_BOOLEAN(0, "prune", &prune, "prune unused objects"),
>>
>> I would write "unreferenced loose" instead of "unused" here...
>
> It is not just "loose" objects here, but also unreferenced objects in packs,
> since the "-a" option to repack is now only used when --prune is specified.
> Without --prune, "-A" is supplied to repack instead.
>
> So maybe the message should just be "prune unreferenced objects"
Fair enough, will do.
^ permalink raw reply
* Re: git pull opinion
From: Steven Grimm @ 2007-11-06 0:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Aghiles, git
In-Reply-To: <7vd4uomfn8.fsf@gitster.siamese.dyndns.org>
On Nov 5, 2007, at 3:33 PM, Junio C Hamano wrote:
> Aghiles <aghilesk@gmail.com> writes:
>
>> Is there an "easier" way to pull into a dirty directory ? I am
>> asking this to make sure I understand the problem and not
>> because I find it annoying to type those 4 commands to perform
>> a pull (although some of my colleagues do find that annoying :).
>
> You need to switch your mindset from centralized SVN workflow.
I don't think wanting to pull in the middle of one's work has anything
to do with centralized vs. decentralized, actually, though I do agree
that it's a question of workflow.
For maybe 80% of my work, I do things "the git way" (lots of little
local commits) and only sync up with other people when I've reached a
good stopping point. Those are cases where I'm working in isolation on
a new feature or a fix and will publish it as a whole unit when I'm
done.
But the other 20% of the time, I'm working closely with another
person. For example, I might be working with a front-end developer who
is writing some nice snazzy JavaScript or Flash UI code to talk to my
server-side code. And in that case, I really do want to be able to
pull down his latest changes while I'm still in the middle of working
on my own stuff, not least because it's only by testing with the real
client -- where the button to invoke a particular piece of code on my
side has just been added in the last 2 minutes -- that I can decide
whether my work in progress is actually functional or not. (Unit tests
only get you partway there.)
In other words, for traditional open-source-style distributed
development where each repository is an isolated island that goes off
and does its own thing, ignoring the outside world, the recommended
git workflow is totally appropriate. It's also appropriate for a lot
of in-house non-distributed development.
But for some classes of collaboration, where two or more people are
essentially editing the same code base to work on the same feature and
their changes are highly interdependent, that workflow is next to
useless. There *is* no "I've gotten my code working and am ready to
look at other people's changes now" stage until pretty late in the
game. This kind of workflow happens a lot in commercial development in
my experience.
Before git-stash, I did a lot of "commit; fetch; rebase; reset"
sequences to support this kind of tight collaboration. Now it's
"stash; fetch; rebase; unstash" which is the same number of commands
but is semantically clearer. "fetch; rebase --dirty" or "pull --dirty -
s rebase" will be nicer.
-Steve
^ permalink raw reply
* Re: git pull opinion
From: Pierre Habouzit @ 2007-11-06 0:46 UTC (permalink / raw)
To: Bill Lear; +Cc: Junio C Hamano, Aghiles, git
In-Reply-To: <18223.46848.109961.552827@lisa.zopyra.com>
[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]
On Tue, Nov 06, 2007 at 12:36:16AM +0000, Bill Lear wrote:
> On Monday, November 5, 2007 at 15:33:31 (-0800) Junio C Hamano writes:
> > Stop thinking like "I need to integrate the changes from upstream
> > into my WIP to keep up to date."
> >
> > [...]
> >
> > Once you get used to that, you would not have "a dirty directory"
> > problem.
>
> I respectfully beg to differ. I think it is entirely reasonable, and
> not a sign of "centralized" mindset, to want to pull changes others
> have made into your dirty repository with a single command.
I agree, I have such needs at work. Here is how we (very informally)
work: people push things that they believe could help other (a new
helper function, a new module, a bug fix) in our master ASAP, but
develop big complex feature in their repository and merge into master
when it's ready.
Very often we discuss some bugfix that is impeding people, or a
most-wanted-API. Someone does the work, commits, I often want to merge
master _directly_ into my current work-branch, because I want the
fix/new-API/... whatever.
I don't believe it's because we have a centralized repository that I
have those needs, I would have the very same if I pulled changes
directly from my colleagues repository. The reason why I need it at work
is because there are some very vivid kind of changes, that only takes a
couple of diff lines, and that you _need_ for your work to be completed.
It's not really a matter of being fully up-to-date.
Though to my delight, with the current tip-of-next git, I noticed that
many rebase and pull work in a dirty tree now :)
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: git pull opinion
From: Andreas Ericsson @ 2007-11-06 0:54 UTC (permalink / raw)
To: Bill Lear; +Cc: Junio C Hamano, Aghiles, git
In-Reply-To: <18223.46848.109961.552827@lisa.zopyra.com>
Bill Lear wrote:
> On Monday, November 5, 2007 at 15:33:31 (-0800) Junio C Hamano writes:
>> Aghiles <aghilesk@gmail.com> writes:
>>
>>> Is there an "easier" way to pull into a dirty directory ? I am
>>> asking this to make sure I understand the problem and not
>>> because I find it annoying to type those 4 commands to perform
>>> a pull (although some of my colleagues do find that annoying :).
>> You need to switch your mindset from centralized SVN workflow.
>>
>> The beauty of distributedness is that it redefines the meaning
>> of "to commit". In distributed systems, the act of committing
>> is purely checkpointing and it is not associated with publishing
>> the result to others as centralized systems force you to.
>>
>> Stop thinking like "I need to integrate the changes from
>> upstream into my WIP to keep up to date." You first finish what
>> you are currently doing, at least to the point that it is
>> stable, make a commit to mark that state, and then start
>> thinking about what other people did. You may most likely do a
>> "git fetch" followed by "git rebase" to update your WIP on top
>> of the updated work by others.
>>
>> Once you get used to that, you would not have "a dirty
>> directory" problem.
>
> I respectfully beg to differ. I think it is entirely reasonable, and
> not a sign of "centralized" mindset, to want to pull changes others
> have made into your dirty repository with a single command.
>
I find it much more convenient to just fetch them. I'd rather see
git-pull being given a --rebase option (which would ultimately mean
teaching git-merge about it) to rebase already committed changes on
top of the newly fetched tracking branch. It's being worked on, but
rather slowly.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: [BUG] git grep broken on master - won't work when merging
From: Junio C Hamano @ 2007-11-06 1:02 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git list
In-Reply-To: <46a038f90711051553p6202cc62wfda6b45ff7769984@mail.gmail.com>
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
> Strange behaviour of git grep on one of the projects I hack on...
>
> $ git --version
> git version 1.5.3.5.561.g140d
>
> $ git grep LOB lib
> fatal: insanely many options to grep
>
> After a bit of head-scratching I realised I was in the middle of a
> merge, with some unresolved paths in the lib directory. A bit of
> testing shows that the unresolved index is probably the problem:
>
> $ git grep LOB lib
> fatal: insanely many options to grep
>
> # an unresolved file
> $ git grep LOB lib/accesslib.php
> fatal: insanely many options to grep
I think 36f2587ffb6802cb38071510810f48cddfc4f34a (grep: do not
skip unmerged entries when grepping in the working tree.) is the
dud one. Would this help?
diff --git a/builtin-grep.c b/builtin-grep.c
index c7b45c4..185876b 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -343,7 +343,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
memcpy(name + 2, ce->name, len + 1);
}
argv[argc++] = name;
- if (argc < MAXARGS && !ce_stage(ce))
+ if (argc < MAXARGS)
continue;
status = flush_grep(opt, argc, nr, argv, &kept);
if (0 < status)
^ permalink raw reply related
* Re: [PATCH 3/3] pretty=format: Avoid some expensive calculations when not needed
From: Junio C Hamano @ 2007-11-06 1:06 UTC (permalink / raw)
To: René Scharfe; +Cc: Johannes Schindelin, git
In-Reply-To: <472F7B2F.4050608@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> Junio C Hamano schrieb:
> ...
>> Instead of allocating a separate array and freeing at the end,
>> wouldn't it make more sense to have a bitfield that records what
>> is used by the format string inside the array elements?
>
> How about (ab)using the value field? Let interp_find_active() mark
> unneeded entries with NULL, and the rest with some cookie. All table
> entries with non-NULL values need to be initialized. interp_set_entry()
> needs to be aware of this cookie, as it mustn't free() it. The cookie
> could be the address of a static char* in interpolate.c.
Sorry, where is this aversion to making the struct a bit larger
coming from?
^ permalink raw reply
* Re: git pull opinion
From: Johannes Schindelin @ 2007-11-06 1:16 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Bill Lear, Junio C Hamano, Aghiles, git
In-Reply-To: <472FBB3F.8080307@op5.se>
Hi,
On Tue, 6 Nov 2007, Andreas Ericsson wrote:
> Bill Lear wrote:
> > On Monday, November 5, 2007 at 15:33:31 (-0800) Junio C Hamano writes:
> > > Aghiles <aghilesk@gmail.com> writes:
> > >
> > > > Is there an "easier" way to pull into a dirty directory ? I am
> > > > asking this to make sure I understand the problem and not
> > > > because I find it annoying to type those 4 commands to perform
> > > > a pull (although some of my colleagues do find that annoying :).
> > > You need to switch your mindset from centralized SVN workflow.
> > >
> > > The beauty of distributedness is that it redefines the meaning
> > > of "to commit". In distributed systems, the act of committing
> > > is purely checkpointing and it is not associated with publishing
> > > the result to others as centralized systems force you to.
> > >
> > > Stop thinking like "I need to integrate the changes from
> > > upstream into my WIP to keep up to date." You first finish what
> > > you are currently doing, at least to the point that it is
> > > stable, make a commit to mark that state, and then start
> > > thinking about what other people did. You may most likely do a
> > > "git fetch" followed by "git rebase" to update your WIP on top
> > > of the updated work by others.
> > >
> > > Once you get used to that, you would not have "a dirty
> > > directory" problem.
> >
> > I respectfully beg to differ. I think it is entirely reasonable, and
> > not a sign of "centralized" mindset, to want to pull changes others
> > have made into your dirty repository with a single command.
> >
>
> I find it much more convenient to just fetch them. I'd rather see
> git-pull being given a --rebase option (which would ultimately mean
> teaching git-merge about it) to rebase already committed changes on
> top of the newly fetched tracking branch. It's being worked on, but
> rather slowly.
git-pull learning about --rebase does not mean teaching git-merge about
it. See my patch, which you (and others) failed to enthusiastically
embrace, which is the sole reason it is stalled.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] t3502: Disambiguate between file and rev by adding --
From: Brian Gernhardt @ 2007-11-06 1:17 UTC (permalink / raw)
To: Alex Riesen; +Cc: git, Junio C Hamano
In-Reply-To: <20071105222530.GA4208@steel.home>
On Nov 5, 2007, at 5:25 PM, Alex Riesen wrote:
> Brian Gernhardt, Sun, Nov 04, 2007 16:31:26 +0100:
>> This test failed because git-diff didn't know if it was asking for
>> the
>> file "a" or the branch "a". Adding "--" at the end of the ambiguous
>> commands allows the test to finish properly.
>
> To be precise: this is ambiguous only on case-challenged filesystems
Oh. I just saw the ambiguous error. Should I re-post with a more
correct commit message?
~~B
^ permalink raw reply
* Re: [PATCH] t3502: Disambiguate between file and rev by adding --
From: Junio C Hamano @ 2007-11-06 1:20 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: Alex Riesen, git
In-Reply-To: <2DC3CFEE-ACA0-448F-9957-EB98F299D812@silverinsanity.com>
Brian Gernhardt <benji@silverinsanity.com> writes:
> On Nov 5, 2007, at 5:25 PM, Alex Riesen wrote:
>
>> Brian Gernhardt, Sun, Nov 04, 2007 16:31:26 +0100:
>>> This test failed because git-diff didn't know if it was asking for
>>> the
>>> file "a" or the branch "a". Adding "--" at the end of the ambiguous
>>> commands allows the test to finish properly.
>>
>> To be precise: this is ambiguous only on case-challenged filesystems
>
> Oh. I just saw the ambiguous error. Should I re-post with a more
> correct commit message?
This is what I wrote but haven't pushed out (I will have to tend
other topics first):
commit 9f12bec4386fc96e5b617268822cbb75e4c76101
Author: Brian Gernhardt <benji@silverinsanity.com>
Date: Sun Nov 4 10:31:26 2007 -0500
t3502: Disambiguate between file and rev by adding --
On a case insensitive file system, this test fails because git-diff
doesn't know if it is asking for the file "A" or the tag "a".
Adding "--" at the end of the ambiguous commands allows the test to
finish properly.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
^ permalink raw reply
* Minor glitch in git-gui: changes to global options aren't taken into account immediately
From: Benoit SIGOURE @ 2007-11-06 1:30 UTC (permalink / raw)
To: git list
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]
Hi list,
[git-gui version 0.8.4
git version 1.5.3.4.398.g859b
Tcl/Tk version 8.4.7
OSX 10.4.10]
I've just realized that git-gui wasn't only using 3 lines of context
in the diffs so I changed the setting under the menu Wish>Options...
under the section `Global'. I had to restart git-gui so that the new
setting is taken into account. Admittedly, it's a minor
inconvenience, but I thought I'd let you know, in case one of the Tcl/
Tk hackers out there want to fix it :-)
Also, when I click the green `+' to maximize the size of the window
of git-gui, it doesn't do anything.
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply
* Re: [PATCH] git-mailsplit: with maildirs try to process new/ if cur/ is empty
From: Michael Cohen @ 2007-11-06 1:41 UTC (permalink / raw)
To: Alex Riesen; +Cc: Gerrit Pape, Fernando J. Pereda, git, Junio C Hamano
In-Reply-To: <20071105225258.GC4208@steel.home>
On Nov 5, 2007, at 5:52 PM, Alex Riesen wrote:
> Gerrit Pape, Mon, Nov 05, 2007 13:49:20 +0100:
>> + for (i = 0; i < 2; ++i) {
>> + snprintf(name, sizeof(name), "%s/%s", path, sub[i]);
>> + if ((dir = opendir(name)) == NULL) {
>> + error("cannot opendir %s (%s)", name, strerror(errno));
>> + return -1;
>> + }
>
> Why is missing "cur" (or "new", for that matter) a fatal error?
> Why is it error at all? How about just ignoring the fact?
In Maildir format, cur and new hold the mails. :P
-mjc
^ permalink raw reply
* Re: [RFC PATCH] Reduce the number of connects when fetching
From: Junio C Hamano @ 2007-11-06 1:51 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0711041614390.7357@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> The idea is to keep the open connection in the data for the transport in
> between getting the list of refs and doing anything further. This
> therefore moves the connection-handling aspects outside of fetch-pack()
> and handles them primarily in transport.c.
The idea is very sound. The scripted version of git-fetch used
a separate ls-remote only because peek-remote and fetch-pack
were separate programs.
> ... In particular, I don't know if there's a way to have the
> connection end up in a state where objects for more refs can be requested
> after some refs have been requested and the resulting objects read.
The upload-pack protocol goes "S: here are what I have, C: I
want these, C: I have these, S: ok, continue, C: I have these,
S: ok, continue, C: I have these, S: ok, I've heard enough, C:
done, S: packfile is here", so after packfile generation starts
there is nothing further the downloader can say.
Otherwise you would be able to do the tag following using the
same connection, but that is unfortunately not a case.
^ permalink raw reply
* Re: [BUG] git grep broken on master - won't work when merging
From: Martin Langhoff @ 2007-11-06 2:00 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git list
In-Reply-To: <7vlk9ckwyn.fsf@gitster.siamese.dyndns.org>
On 11/6/07, Junio C Hamano <gitster@pobox.com> wrote:
> I think 36f2587ffb6802cb38071510810f48cddfc4f34a (grep: do not
> skip unmerged entries when grepping in the working tree.) is the
> dud one. Would this help?
Works great here! Thanks!
cheers,
martin
^ permalink raw reply
* Re: [PATCH] status&commit: Teach them to show commits of modified submodules.
From: Junio C Hamano @ 2007-11-06 2:22 UTC (permalink / raw)
To: Yin Ping; +Cc: Junio C Hamano, git
In-Reply-To: <46dff0320711040517r6da5d7aaid849ff06df1b5bb6@mail.gmail.com>
"Yin Ping" <pkufranky@gmail.com> writes:
> However, in some cases these messages are helpful. And a third kind of
> cases is that people care about only part of all submodules.
>
> So, maybe some an switch can be used to turn this on or off (default
> off)?
I personally think that is overengineering. Isn't having/not
having the submodule directory cloned a good enough indicator
of which submodules are interested in by the user?
^ permalink raw reply
* Re: [PATCH] git-revert is one of the most misunderstood command in git, help users out.
From: Junio C Hamano @ 2007-11-06 2:51 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Steven Grimm, Pierre Habouzit, git
In-Reply-To: <Pine.LNX.4.64.0711052325090.4362@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> In the same way, I would expect "git revert <commit> -- file" to undo the
> changes in that commit to _that_ file (something like "git merge-file
> file <commit>:file <commit>^:file"), but this time commit it, since it
> was committed at one stage.
Allowing people to revert or cherry pick partially by using
paths limiter is a very good idea; the whole "it comes from a
commit so we also commit" feels an utter nonsense, though.
^ permalink raw reply
* Re: [RFC PATCH] Reduce the number of connects when fetching
From: Daniel Barkalow @ 2007-11-06 3:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1wb4kuoc.fsf@gitster.siamese.dyndns.org>
On Mon, 5 Nov 2007, Junio C Hamano wrote:
> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > The idea is to keep the open connection in the data for the transport in
> > between getting the list of refs and doing anything further. This
> > therefore moves the connection-handling aspects outside of fetch-pack()
> > and handles them primarily in transport.c.
>
> The idea is very sound. The scripted version of git-fetch used
> a separate ls-remote only because peek-remote and fetch-pack
> were separate programs.
I figured that had to be the case, due to the way the protocol acts at the
beginning.
> > ... In particular, I don't know if there's a way to have the
> > connection end up in a state where objects for more refs can be requested
> > after some refs have been requested and the resulting objects read.
>
> The upload-pack protocol goes "S: here are what I have, C: I
> want these, C: I have these, S: ok, continue, C: I have these,
> S: ok, continue, C: I have these, S: ok, I've heard enough, C:
> done, S: packfile is here", so after packfile generation starts
> there is nothing further the downloader can say.
>
> Otherwise you would be able to do the tag following using the
> same connection, but that is unfortunately not a case.
It would be nice if this could continue: "C: I also want these, S: ok,
heard enough, C: done, S: another packfile is here"; we should be able to
identify the end of the packfile on both ends to resume doing other
things.
Or, maybe, "C: I also want these single objects, S: here's a thin pack of
them", since it's exclusively tags pointing to objects we have just
gotten.
-Daniel
*This .sig left intentionally blank*
^ 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