Git development
 help / color / mirror / Atom feed
* Re: Cloning from kernel.org, then switching to another repo
From: Jeff King @ 2007-11-13  4:48 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <9e4733910711122030q7bbf6057ubb6b5b27e1885500@mail.gmail.com>

On Mon, Nov 12, 2007 at 11:30:17PM -0500, Jon Smirl wrote:

> Execute bit was not set. I just set it for all the scripts. +x is not

I assume by "all the scripts" you mean "all of the post-update scripts
in my repositories" and not "all of the hook scripts in this
repository". Because I think some of the included hooks are not suitable
to run without some configuration, which is why they are disabled by
default.

> getting turned on with a default git init-db. I just made a new repo
> to check, no +x on the scripts.

Right. git-init just copies the files from the templates directory
(probably /usr/share/git-core/templates or similar), so if the hook is
not enabled there, it will not be in the new repo. And git ships with
all hooks disabled by default.

cogito used to enable the post-update hook by default for bare repos (if
you called cg-admin-setuprepo), but git never has.

It is mentioned in the "exporting a git repository via http" section of
the user manual.

-Peff

^ permalink raw reply

* Re: Cloning from kernel.org, then switching to another repo
From: Jon Smirl @ 2007-11-13  4:33 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin, Linus Torvalds, Git Mailing List
In-Reply-To: <20071113042342.GC9745@sigill.intra.peff.net>

On 11/12/07, Jeff King <peff@peff.net> wrote:
> On Mon, Nov 12, 2007 at 03:54:59PM -0500, Jon Smirl wrote:
>
> > It is eaiser to put
> >   git config remote.origin.url
> > http://git.digispeaker.com/projects/digispeaker-kernel.git
> > in a cookbook web page sequence than say edit the config file by hand.
>
> I think that falls under "scripting" (it's just that your interpreter is
> a human).
>
> > I added the cookbook sequence to my git project page.
> > http://git.digispeaker.com/
> > Without cloning from kernel.org first it takes an hour to clone from
> > dreamhost, but what do you want for $5/mth. I'll more to a better host
> > when traffic picks up.
>
> It sounds like you are posting commits on top of Linus' kernel tree. Why
> not use repo.or.cz's hosting? It's free, and it _already_ has the
> linus-2.6 tree, so you can start a 'fork' and not even waste any space.

It's the kernel for a larger embedded project. After I get the kernel
going I will add the user space environment at the same web site.

The project is described at www.digispeaker.com. It is an open source
multi-room audio system. Wifi based to allow easy installation. Uses
the MPC5200B PowerPC chip.

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: Cloning from kernel.org, then switching to another repo
From: Jon Smirl @ 2007-11-13  4:30 UTC (permalink / raw)
  To: Jeff King; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <20071113042017.GB9745@sigill.intra.peff.net>

On 11/12/07, Jeff King <peff@peff.net> wrote:
> On Mon, Nov 12, 2007 at 12:21:20PM -0500, Jon Smirl wrote:
>
> > Running git update-server-info at the remote end fixed it.
> >
> > I am using 'git push' to send changes, I though that was supposed to
> > update the server info automatically.
>
> It is typically triggered by the post-update hook. Make sure that your
> remote repo's .git/hooks/post-update has the execute bit set.

Execute bit was not set. I just set it for all the scripts. +x is not
getting turned on with a default git init-db. I just made a new repo
to check, no +x on the scripts.

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: Cloning from kernel.org, then switching to another repo
From: Jeff King @ 2007-11-13  4:23 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Johannes Schindelin, Linus Torvalds, Git Mailing List
In-Reply-To: <9e4733910711121254j5af5dba6k5acdce939936af66@mail.gmail.com>

On Mon, Nov 12, 2007 at 03:54:59PM -0500, Jon Smirl wrote:

> It is eaiser to put
>   git config remote.origin.url
> http://git.digispeaker.com/projects/digispeaker-kernel.git
> in a cookbook web page sequence than say edit the config file by hand.

I think that falls under "scripting" (it's just that your interpreter is
a human).

> I added the cookbook sequence to my git project page.
> http://git.digispeaker.com/
> Without cloning from kernel.org first it takes an hour to clone from
> dreamhost, but what do you want for $5/mth. I'll more to a better host
> when traffic picks up.

It sounds like you are posting commits on top of Linus' kernel tree. Why
not use repo.or.cz's hosting? It's free, and it _already_ has the
linus-2.6 tree, so you can start a 'fork' and not even waste any space.

-Peff

^ permalink raw reply

* Re: Cloning from kernel.org, then switching to another repo
From: Jeff King @ 2007-11-13  4:20 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <9e4733910711120921q651208cby1276426ccd4b5fa4@mail.gmail.com>

On Mon, Nov 12, 2007 at 12:21:20PM -0500, Jon Smirl wrote:

> Running git update-server-info at the remote end fixed it.
> 
> I am using 'git push' to send changes, I though that was supposed to
> update the server info automatically.

It is typically triggered by the post-update hook. Make sure that your
remote repo's .git/hooks/post-update has the execute bit set.

-Peff

^ permalink raw reply

* Re: Cloning from kernel.org, then switching to another repo
From: Jeff King @ 2007-11-13  4:14 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <9e4733910711120928r6d9d08f0l22f3c6f0b2d80313@mail.gmail.com>

On Mon, Nov 12, 2007 at 12:28:28PM -0500, Jon Smirl wrote:

> Actually, fetching from kernel.org first and then switching the origin
> isn't helping. The host is http only since I can't get access to the
> git network port. When I pushed up my local repo it ends up in one big
> pack.
> 
> I do this:
> git clone kernel.org
> move the origin
> git pull
> -- it still pulls down the entire pack and takes an hour

Yep, the http fetch code doesn't understand about fetching parts of
packs (there was some discussion about using partial HTTP transfers, but
nobody seems to have cared enough to implement it).

> Will this fix it?
> at my remote host, first clone from kernel.org
> then push my local changes?

Yes, it should. The goal is to not put your changes and the upstream
commits in the same pack. You could also push _just_ the upstream
commits first, then in a different push, send your local changes. But
when they get pushed together, they all end up in the same pack.

-Peff

^ permalink raw reply

* The 5th issue of the msysGit Herald
From: Johannes Schindelin @ 2007-11-13  3:13 UTC (permalink / raw)
  To: msysgit, git

Good morning git land!

This lovely dark 4am (see http://youtube.com/watch?v=yXi6hg90LUU) is 
as good an occasion as any to offer to you the 5th issue of the 
msysGit Herald, the not-quite-biweekly news letter to keep you 
informed about msysGit, the effort to bring one of the most powerful 
Source Code Management systems to the poor souls stuck with Windows. 

These are the covered topics:

	git-gui and git-fetch

	git-svn

	cvsps

	git.git, mingw.git and 4msysgit.git closing ranks



Seems like this edition is mostly about transport... which is a good 
sign. It means that the installer has no more issues and we can 
concentrate on getting git on Windows to work. 


git-gui and git-fetch
=====================

Some time ago, git-gui could call git-fetch to update the remotes, but 
it popped up a new cmd window. This was ugly, and at some stage Shawn 
Pearce, the maintainer of git-gui, changed some parts to avoid that. 
Unfortunately, this broke fetching from within git-gui. 

Warning: technical explanation ahead! 

The problem is this: apparently there are two different kinds of 
processes on Windows (actually three, but let's not make things 
complicated, and for the same reason, let's not play the obvious pun 
on Microsoft): graphical and console processes. 

Whenever you start a console process from a graphical process, you 
have to provide it with a console instance, which would be inherited 
from the calling process if that were a console process, too. But in 
our case, a graphical process calls a console process (this works), 
which in turn calls another console process (this doesn't). 

So the symptom is that git-fetch, called from git-gui, does not pop up 
a cmd window, but ssh, which is called from git-fetch for ssh:// urls, 
does. 

I suspected a bug in Tcl/Tk, which might have been fixed in version 
8.5b2, so I compiled it and tested it, but the behaviour is still the 
same. At least we now have a script in our repository to conveniently 
compile and install Tcl/Tk, should the need ever arise again! 

Steffen Prohaska (see interview in the fourth Herald) and Johannes 
Sixt (see interview in the second Herald) are currently hard at work 
to flesh out this issue, and maybe the solution lies in using Putty's 
plink instead of MSys' ssh. 

Or maybe we will find some clever way to replace the spawnvpe() call 
with a CreateProcess() call which forces the console instance to be 
inherited by the called process. Hannes suggested that a possible 
reason is our heavy usage of dup2(), which might be helped by using 
CreateProcess(), but only time, and a fix, will tell what happens 
here. 


git-svn
=======

It seems that quite a few people want to have a working git-svn in 
msysGit. In our bug tracker, this problem comes in disguise such as 
"Digest.pm is missing". 

Alas, it is not as easy as that... Perl is an MSys program (remember, 
MSys gives you Unix-like paths relative to the install location), and 
compiling that came with its own set of surprises: you need to use a 
different compiler than for MinGW programs! 

As I wrote in the third Herald, Simon Sasburg was hard at work to get 
it to compile, and finally succeeded. But dynamically linked modules 
(otherwise known as DLLs) would not work, instead resulting in 
Windows' version of a segmentation fault. 

A few more days of trial and error led to the discovery of a source 
package of Perl for MSys, which was successfully munged into a 
quilt-like setup: we now have a script to download Perl's sources, 
patch them with our set of patches, build, install and prepare 
everything for commit. 

The next steps are easy: git-svn's dependencies MIME-Base64, Digest 
and Digest-MD5 are nice to build and install. 

The bigger chunk will be to get subversion and its Perl module to 
compile, especially given the dependency of the Apache Runtime (APR): 
subversion's configure complains that it was not found, and the 
documentation suggest to -- you guessed it -- checking it out with 
subversion. 

Stay tuned. 


cvsps
=====

While working at git-svn, I also though about git-cvsimport. This tool 
heavily depends on cvsps, a program which was inspired by the 
PatchSets of the source code management system git set out to replace. 
It is not all that trivial to compile cvsps on MSys, though, since it 
really loves our good old friend, fork(). 

Alas, Peer Sommerlund already worked on compiling this on Windows, and 
was friendly enough to export his Mercurial commits as plain patches, 
which soon found their way into a git repository. Now cvsps compiles 
fine, but cvsimport still fails to work, probably because Peer's 
patches make a few assumptions about the cvs program he used: cvsnt. 

It's likely not hard to work out the kinks until it works, but the 
time to do so successfully avoided finding me. 


git.git, mingw.git and 4msysgit.git closing ranks
=================================================

The official repository for git is git.git, maintained by Junio C 
Hamano. It does not contain any support for MinGW, because the port is 
not polished enough yet. Johannes "Hannes" Sixt maintains the official 
port to MinGW in the mingw.git fork of Junio's repository, and since 
the msysGit project started during Hannes' vacation, mingw.git was 
forked yet again, as 4msysgit.git. 

It is not totally superfluous to have separate repositories for these 
projects, because they differ in workflow and focus. For example, one 
of the big goals of the msysGit project was to provide an integrated 
installer which comes with everything you will need to run git on 
Windows (including MSys with its bash and perl), while the MinGW port 
tries to avoid the dependency on MSys as much as possible. 

But recently Hannes has succeeded in polishing a few topics from 
mingw.git to the point where Junio included them in git.git. There is 
no MinGW specific code yet, but the foundations are laid. 

In related news, Steffen Prohaska has undertaken some tremendous 
effort to merge mingw.git's 'master' branch into 4msysgit.git's 
'devel' branch. Maybe we succeed at some stage to close in totally on 
mingw.git, and then we'll probably move our history to some 
"historical" branch, and just keep with mingw.git's master. 

^ permalink raw reply

* Re: Subject: [PATCH 2/3] Let git-add--interactive read colors from .gitconfig
From: Dan Zwell @ 2007-11-13  2:55 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Dan Zwell, Jeff King, Shawn O. Pearce, Wincent Colaiuta,
	Git Mailing List, Jonathan del Strother, Johannes Schindelin,
	Frank Lichtenheld
In-Reply-To: <7v4pfq27tx.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> I suggested the hash approach only because (1) it is easier to
> read than two regexp matches that are split only to keep the
> line less than 80-chars long, and (2) a misconfiguration like
> "color.foo = fred" can be caught more easily.
> 
> I do not quite understand the "after all, we're pattern
> matching" part, though.  Are you talking about "split(/\s+/, $str)" 
> your for-loop iterates over?
> 

I think we're talking about the same thing. I was referring to the split 
regular expression, and the question is, "for the current element of 
split(/\s+/, $str), does it match a color?"

Anyway, I preferred the regex version for readability, though I should 
have used the /x modifier--it would still take two lines, but it would 
not need to attempt two matches. As for misconfigured color 
configurations, should we catch that? I wrote this with the intent that 
it should ignore invalid color names, but it would probably be more 
useful to print a warning.

Dan

^ permalink raw reply

* Re: git diff woes
From: Miles Bader @ 2007-11-13  2:53 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Junio C Hamano, Johannes Schindelin, Git Mailing List
In-Reply-To: <4738E9E6.2040001@op5.se>

Andreas Ericsson <ae@op5.se> writes:
> I notice it, and I don't like it. I guess I'm just used to git being
> smarter than their GNU tool equivalents, especially since it only ever
> applies patches in full.

It's not at all obvious that this behavior is actually wrong -- it seems
perfectly reasonable to use either old or new text for the hunk headers.

It hardly matters really, since that particular output is just "useful
noise" to provide a bit of helpful context for human readers, and humans
(unlike programs) are notoriously good at not being bothered by such
things.  Er, well most humans anyway.

-Miles

-- 
Americans are broad-minded people.  They'll accept the fact that a person can
be an alcoholic, a dope fiend, a wife beater, and even a newspaperman, but if a
man doesn't drive, there is something wrong with him.  -- Art Buchwald

^ permalink raw reply

* Re: Subject: [PATCH 2/3] Let git-add--interactive read colors from .gitconfig
From: Junio C Hamano @ 2007-11-13  2:32 UTC (permalink / raw)
  To: Dan Zwell
  Cc: Jeff King, Shawn O. Pearce, Wincent Colaiuta, Git Mailing List,
	Jonathan del Strother, Johannes Schindelin, Frank Lichtenheld
In-Reply-To: <47390050.1020907@zwell.net>

Dan Zwell <dzwell@gmail.com> writes:

> Junio C Hamano wrote:
>>> +			$fg_done = "true";
>>> +		}
>>> +		elsif ($word =~ /black|red|green|yellow/ ||
>>> +			   $word =~ /blue|magenta|cyan|white/) {
>>
>> 	exists $color_name{$word}
>>
>> with
>>
>> 	my %color_name = map { $_ => 1 } qw(black red ... white);
>>
>> at the beginning?
>>
> I don't see the advantage of doing it that way. After all, we're
> pattern matching. Does using a hash, an array, and a call to map()
> gain us something? I think a regular expression is clearer. Of course,
> as Jeff pointed out, I should have used a whitespace-agnostic regular
> expression.

I suggested the hash approach only because (1) it is easier to
read than two regexp matches that are split only to keep the
line less than 80-chars long, and (2) a misconfiguration like
"color.foo = fred" can be caught more easily.

I do not quite understand the "after all, we're pattern
matching" part, though.  Are you talking about "split(/\s+/, $str)" 
your for-loop iterates over?

^ permalink raw reply

* Re: Subject: [PATCH 2/3] Let git-add--interactive read colors from .gitconfig
From: Dan Zwell @ 2007-11-13  1:39 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Jeff King, Shawn O. Pearce, Wincent Colaiuta, Git Mailing List,
	Jonathan del Strother, Johannes Schindelin, Frank Lichtenheld
In-Reply-To: <7vve89f6qy.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
>> +			$fg_done = "true";
>> +		}
>> +		elsif ($word =~ /black|red|green|yellow/ ||
>> +			   $word =~ /blue|magenta|cyan|white/) {
> 
> 	exists $color_name{$word}
> 
> with
> 
> 	my %color_name = map { $_ => 1 } qw(black red ... white);
> 
> at the beginning?
> 
I don't see the advantage of doing it that way. After all, we're pattern 
matching. Does using a hash, an array, and a call to map() gain us 
something? I think a regular expression is clearer. Of course, as Jeff 
pointed out, I should have used a whitespace-agnostic regular expression.
+		elsif ($word =~ /black|red|green|yellow|
+			blue|magenta|cyan|white/x ) {

I agreed with the rest of your suggestions, and will implement them in 
the next round of changes, later this week.

Dan

^ permalink raw reply

* Re: git diff woes
From: Johannes Schindelin @ 2007-11-13  0:59 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <4738E9E6.2040001@op5.se>

Hi,

On Tue, 13 Nov 2007, Andreas Ericsson wrote:

> Junio C Hamano wrote:
> > Andreas Ericsson <ae@op5.se> writes:
> > 
> > > In the check_ntpd.c program, there is no bug. I found the git diff 
> > > output surprising, so I reported it.
> > 
> > This is what I get from "GNU diff -pu" which makes me surpried
> > that anybody finds "git diff" hunk header surprising.  Notice
> > that hunk at line 84.
> > 
> > --- read-cache.c	2007-11-12 12:08:00.000000000 -0800
> > +++ read-cache.c+	2007-11-12 12:07:54.000000000 -0800
> > @@ -60,7 +60,7 @@ static int ce_compare_data(struct cache_
> >  	return match;
> >  }
> >  -static int ce_compare_link(struct cache_entry *ce, size_t expected_size)
> > +static int ce_compare_lonk(struct cache_entry *ce, size_t expected_size)
> >  {
> >  	int match = -1;
> >  	char *target;
> > @@ -84,7 +84,7 @@ static int ce_compare_link(struct cache_
> >  		match = memcmp(buffer, target, size);
> >  	free(buffer);
> >  	free(target);
> > -	return match;
> > +	return match + 0;
> >  }
> >   static int ce_compare_gitlink(struct cache_entry *ce)
> 
> 
> I notice it, and I don't like it. I guess I'm just used to git being
> smarter than their GNU tool equivalents, especially since it only ever
> applies patches in full.

I still think the existing behaviour is reasonable.  When I read a diff 
(and remember, the hunk headers are _only_ there for the reviewer's 
pleasure), the function names are a hint for _me_ where to look, and which 
is the context, in my existing, _original_ file.

That is, unless I have already applied the patch, and am looking for the 
reverse patch.  And, lo and behold, the reverse patch generated by 
git-diff really shows the now-current function name!

So IMO "fixing" this behaviour would be a regression.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 1/6] builtin-commit: fix author date with --amend --author=<author>
From: Junio C Hamano @ 2007-11-13  0:37 UTC (permalink / raw)
  To: Kristian Høgsberg; +Cc: Johannes Schindelin, git, gitster
In-Reply-To: <1194896334.2869.7.camel@hinata.boston.redhat.com>

Kristian Høgsberg <krh@redhat.com> writes:

> I suggest we back this patch out.

Ok.  My mistake.  Your "Add testcase for amending and fixing
author in git commit" does contain test for this.

I need to amend the commit log message of that one, though ;-)

^ permalink raw reply

* Re: Cloning empty repositories, was Re: What is the idea for bare repositories?
From: Andreas Ericsson @ 2007-11-13  0:13 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Matthieu Moy, Johannes Schindelin, Bill Lear, Jan Wielemaker, git
In-Reply-To: <7v4pfr2kmh.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> 
> His second point is also a real issue.  If you allowed cloning
> an empty repo (either bare or non-bare), then you and Bill can
> both clone from it, come up with an initial commit each.  Bill
> pushes his initial commit first.  Your later attempt to push
> will hopefully fail with "non fast forward", if you know better
> than forcing such a push, but then what?  You need to fetch, and
> merge (or rebase) your change on top of Bill's initial commit,
> and at that point the history you are trying to merge does not
> have any common ancestor with his history.


If we assume zero communication between these two, the alternative
is this:
Bill starts hacking in his own repo and then uploads his .git dir
to the server.
David starts hacking in his own repo and then uploads his .git
dir to the server.

The only difference between the two scenarios is (assuming they
have write access to those shared directories) that the last-in
wins in the second case, while first-in wins in the first one.

Oh, and the fact that the first to upload his .git dir to the
server will lose all his refs if he isn't careful to save his
original copy until they both have established which "first"
commit to use, which could take a while in this imaginary world
where they don't seem to be speaking to each other but are still
working together.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Re: [PATCH] for-each-ref: fix off by one read.
From: Junio C Hamano @ 2007-11-13  0:05 UTC (permalink / raw)
  To: Christian Couder; +Cc: git
In-Reply-To: <20071112053725.4f0d1940.chriscool@tuxfamily.org>

Christian Couder <chriscool@tuxfamily.org> writes:

> diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
> index 598d4e1..89ea37c 100644
> --- a/builtin-for-each-ref.c
> +++ b/builtin-for-each-ref.c
> @@ -306,7 +306,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
>  		if (!eol)
>  			return "";
>  		eol++;
> -		if (eol[1] == '\n')
> +		if (*eol == '\n')
>  			return ""; /* end of header */
>  		buf = eol;
>  	}

Good eyes.  This would have broken if

 (1) we had a header field that consists of a single character
     and then LF.  We would have mistaken such a line as the end
     of header; or

 (2) we had a commit or a tag that consists solely of header and
     no body.  We would have read past the terminating NUL.

Thanks.

^ permalink raw reply

* Re: git diff woes
From: Andreas Ericsson @ 2007-11-13  0:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Git Mailing List
In-Reply-To: <7vhcjr2lte.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> Andreas Ericsson <ae@op5.se> writes:
> 
>> In the check_ntpd.c program, there is no bug. I found the git diff output
>> surprising, so I reported it.
> 
> This is what I get from "GNU diff -pu" which makes me surpried
> that anybody finds "git diff" hunk header surprising.  Notice
> that hunk at line 84.
> 
> --- read-cache.c	2007-11-12 12:08:00.000000000 -0800
> +++ read-cache.c+	2007-11-12 12:07:54.000000000 -0800
> @@ -60,7 +60,7 @@ static int ce_compare_data(struct cache_
>  	return match;
>  }
>  
> -static int ce_compare_link(struct cache_entry *ce, size_t expected_size)
> +static int ce_compare_lonk(struct cache_entry *ce, size_t expected_size)
>  {
>  	int match = -1;
>  	char *target;
> @@ -84,7 +84,7 @@ static int ce_compare_link(struct cache_
>  		match = memcmp(buffer, target, size);
>  	free(buffer);
>  	free(target);
> -	return match;
> +	return match + 0;
>  }
>  
>  static int ce_compare_gitlink(struct cache_entry *ce)


I notice it, and I don't like it. I guess I'm just used to git being
smarter than their GNU tool equivalents, especially since it only ever
applies patches in full.

I have a patch ready to make it configurable but it lacks doc updates
and tests, so I'll send it tomorrow morning when I've had time to
fiddle a bit with that.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Re: wishlist: git info
From: Jakub Narebski @ 2007-11-12 23:46 UTC (permalink / raw)
  To: git
In-Reply-To: <4738D8AA.1030604@users.sourceforge.net>

Thomas Neumann wrote:

> My commands show (ignoring formatting): 1. the remote repositories with
> URL 2. the current head commit hash 3. the date of the head commit.
> Which gives a pretty decent idea about the state of the repository.

Perhaps also project description (if it exists?)

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: wishlist: git info
From: Alex Riesen @ 2007-11-12 23:41 UTC (permalink / raw)
  To: Thomas Neumann; +Cc: git
In-Reply-To: <4738D8AA.1030604@users.sourceforge.net>

Thomas Neumann, Mon, Nov 12, 2007 23:50:18 +0100:
> >> Probably not the most intelligent way to compute it, but you get the
> >> idea. git info should give a brief overview over the current working
> >> directory.
> >
> > Like what? None of the commands you suggested even touch it.
> probably "current working directory" was not the best way to phrase it.
> I mean state of the repository, which in my case is a clone of a central
> repository.
> My commands show (ignoring formatting): 1. the remote repositories with
> URL 2. the current head commit hash 3. the date of the head commit.

Don't you want to know where the remote repo is at?

> Which gives a pretty decent idea about the state of the repository.

...which in Git-lingo would be misunderstood as the output of
git-status :)

> > Would
> >
> >     git remote -r -v && git log --max-count=1 --pretty=format:'%h %s'
> >
> > do what you think is what you need?
> perhaps, the first command gives me an error (git 1.5.2.5). This here is
> nearly ok

Ach, make it "git remote -v". It does exactly showing of the url.

Dunno what I wanted the "-r" for. Probably left from thinking of
"git branch -r" (which shows remote branches).

> git remote && git log --max-count=1 --pretty=format:'%H %cD'
> 
> except the missing URL from git remote (but perhaps your options include
> it with a newer git version, will test).

It is there since 1.5.3-rc1

^ permalink raw reply

* Re: git 1.5.3.5 error over NFS
From: Alex Riesen @ 2007-11-12 23:33 UTC (permalink / raw)
  To: Bill Lear; +Cc: git
In-Reply-To: <18232.29603.856766.275854@lisa.zopyra.com>

This is the almost same message I cced to lk and nfs, but with
Git-interasting parts added.

Bill Lear, Mon, Nov 12, 2007 16:39:15 +0100:
> On Saturday, November 10, 2007 at 00:21:06 (+0100) Alex Riesen writes:
> >Bill Lear, Fri, Nov 09, 2007 16:31:39 +0100:
> >> I've brought this up before, but I don't recall a resolution to it.
> >> 
> >> We have an NFS-mounted filesystem, and git pull is choking on it.
> >> 
> >> % uname -a
> >> Linux uhlr.zopyra.com 2.6.9-42.0.2.ELsmp #1 SMP Wed Aug 23 13:38:27 BST 2006 x86_64 x86_64 x86_64 GNU/Linux

It is a really old kernel... Maybe you could try with some of the
recent ones?

> >> % git --version
> >> git version 1.5.3.5
> >> 
> >> % git pull
> >> remote: Generating pack...
> >> remote: Done counting 998 objects.
> >> remote: Result has 836 objects.
> >> remote: Deltifying 836 objects.
> >> remote:  100% (836/836) done
> >> Indexing 836 objects...
> >> remote: Total 836 (delta 526), reused 688 (delta 380)
> >>   100% (836/836) done
> >> Resolving 526 deltas...
> >> fatal: cannot pread pack file: No such file or directory
> >
> >Could you please strace it? With strace -ff?
> >
> >> fatal: index-pack died with error code 128
> >> fatal: Fetch failure: git://source/repo
> >> 
> >> I looked through the archives of this list and did not see a final
> >> resolution, other than a suspected bug in the OS NFS code.
> >
> >Strace, just to be on the safe side
> 
> Ok, I've done the strace -ff.  It has generated 176 strace.out.<pid>
> files.  I have placed a tarball of these files on my home server:
> 
>   http://www.zopyra.com/~rael/git/git-trace.tar.bz2
> 
> The file strace.out.25526 has, at the very end:
> 

Yes, this is the file.

I extend the part you quoted. The file is opened here:

open(".git/objects/pack_awOTNW", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
write(3, "PACK\0\0\0\2\0\0\3r", 12)     = 12
... lots of data. Counted writes: 488538...
write(3, "v\351\247V\325\362\327/\240\265\211\211\322,\261\210\301"..., 4096) = 4096
write(3, "\202\202g\232Bf\211Bf\261Bb\36X\22\4\364\365\25\22\223"..., 1114) = 1114
write(3, "M", 1)                        = 1

> write(2, "Resolving 551 deltas.\n", 22)                               = 22
> pread64(3, "", 242, 541) = 0

That's the problem.

"Git-interesting parts"

> write(2, "fatal: ", 7)                  = 7
> write(2, "cannot pread pack file: Success", 31) = 31

This is strange. The current git should not produce anything like
this (and does not, here). The code in question is:

	do {
		ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
		if (n <= 0)
			die("cannot pread pack file: %s", strerror(errno));
		rdy += n;
	} while (rdy < len);

Either your strace or that kernel seem to have clobbered errno, too.

> fstat64(0, 0xffff907c)                  = 0
> open("/etc/mtab", O_RDONLY)             = 4
> fstat64(0x4, 0xffff6810)                = 0

Interesing. What in git index-pack can read mtab and what for?
Is it vanilla Git or have you instrumented it somehow?

> [ Process PID=25347 runs in 32 bit mode. ]
> umovestr: Input/output error
> umovestr: Input/output error

Is it your strace?
Do you have anything unusual in syslog?

BTW, you could try defining NO_PREAD in config.mak, and see if it
works the problem around for you.

^ permalink raw reply

* Re: git 1.5.3.5 error over NFS
From: Alex Riesen @ 2007-11-12 23:31 UTC (permalink / raw)
  To: Bill Lear; +Cc: git, nfs, linux-kernel
In-Reply-To: <18232.29603.856766.275854@lisa.zopyra.com>

Bill Lear, Mon, Nov 12, 2007 16:39:15 +0100:
> On Saturday, November 10, 2007 at 00:21:06 (+0100) Alex Riesen writes:
> >Bill Lear, Fri, Nov 09, 2007 16:31:39 +0100:
> >> I've brought this up before, but I don't recall a resolution to it.
> >> 
> >> We have an NFS-mounted filesystem, and git pull is choking on it.
> >> 
> >> % uname -a
> >> Linux uhlr.zopyra.com 2.6.9-42.0.2.ELsmp #1 SMP Wed Aug 23 13:38:27 BST 2006 x86_64 x86_64 x86_64 GNU/Linux

It is a really old kernel... Maybe you could try with some of the
recent ones?

> >> % git --version
> >> git version 1.5.3.5
> >> 
> >> % git pull
> >> remote: Generating pack...
> >> remote: Done counting 998 objects.
> >> remote: Result has 836 objects.
> >> remote: Deltifying 836 objects.
> >> remote:  100% (836/836) done
> >> Indexing 836 objects...
> >> remote: Total 836 (delta 526), reused 688 (delta 380)
> >>   100% (836/836) done
> >> Resolving 526 deltas...
> >> fatal: cannot pread pack file: No such file or directory
> >
> >Could you please strace it? With strace -ff?
> >
> >> fatal: index-pack died with error code 128
> >> fatal: Fetch failure: git://source/repo
> >> 
> >> I looked through the archives of this list and did not see a final
> >> resolution, other than a suspected bug in the OS NFS code.
> >
> >Strace, just to be on the safe side
> 
> Ok, I've done the strace -ff.  It has generated 176 strace.out.<pid>
> files.  I have placed a tarball of these files on my home server:
> 
>   http://www.zopyra.com/~rael/git/git-trace.tar.bz2
> 
> The file strace.out.25526 has, at the very end:
> 

Yes, this is the file.

I extend the part you quoted. The file is opened here:

open(".git/objects/pack_awOTNW", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
write(3, "PACK\0\0\0\2\0\0\3r", 12)     = 12
... lots of data. Counted writes: 488538...
write(3, "v\351\247V\325\362\327/\240\265\211\211\322,\261\210\301"..., 4096) = 4096
write(3, "\202\202g\232Bf\211Bf\261Bb\36X\22\4\364\365\25\22\223"..., 1114) = 1114
write(3, "M", 1)                        = 1

> write(2, "Resolving 551 deltas.\n", 22)                               = 22
> pread64(3, "", 242, 541) = 0

That's the problem.  Hmm... May I kindly suggest moving the topic to
linux-nfs (cc-ed along with lk)?

^ permalink raw reply

* Re: wishlist: git info
From: Thomas Neumann @ 2007-11-12 22:50 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <20071112222106.GE2918@steel.home>

> you're better of just running "gitk --all" at this point. It'll show
> remote branches (with the names of remote repos prepended) and their
> relations to the local repo.
hm, this is not what I am after. I do not want to inspect the history, I
want to see where this repository "belongs" to. Gitk shows me the name
(which is reasonable, of course), but not the URL. And it is a GUI
application, which is not so perfect.

>> Probably not the most intelligent way to compute it, but you get the
>> idea. git info should give a brief overview over the current working
>> directory.
>
> Like what? None of the commands you suggested even touch it.
probably "current working directory" was not the best way to phrase it.
I mean state of the repository, which in my case is a clone of a central
repository.
My commands show (ignoring formatting): 1. the remote repositories with
URL 2. the current head commit hash 3. the date of the head commit.
Which gives a pretty decent idea about the state of the repository.

> Would
>
>     git remote -r -v && git log --max-count=1 --pretty=format:'%h %s'
>
> do what you think is what you need?
perhaps, the first command gives me an error (git 1.5.2.5). This here is
nearly ok

git remote && git log --max-count=1 --pretty=format:'%H %cD'

except the missing URL from git remote (but perhaps your options include
it with a newer git version, will test).

> May I suggest you to consider just running "git fetch -v"?
this is has side effects, and is quite slow. Your command sequence above
  is more handy (and faster).

So I can emulate git info with an alias, and this is good enough for mew
now, thanks for the hints. Perhaps a somewhat more elaborate version of
git info might be useful for others, too, but this is not urgent.

Thomas

^ permalink raw reply

* Re: git config error message
From: Jakub Narebski @ 2007-11-12 23:09 UTC (permalink / raw)
  To: git
In-Reply-To: <20071112222629.GG2918@steel.home>

Alex Riesen wrote:

> Johannes Schindelin, Mon, Nov 12, 2007 23:24:54 +0100:
>> Hi,
>> On Mon, 12 Nov 2007, Alex Riesen wrote:
>>> Jon Smirl, Mon, Nov 12, 2007 16:35:07 +0100:
>>>
>>>> I'm not in a git repo, this error message is misleading.
>>>> 
>>>> jonsmirl@terra:~/foo$ git config remote.origin.url
>>>> http://git.digispeaker.com/projects/digispeaker-kernel.git
>>>> could not lock config file
>>>> 
>>> 
>>> Cygwin or any crashes in this repo lately?
>>> If cygwin, than we probably have a file handle leak in config code.
>> 
>> He said that he's not in a git repo.  Thus, .git/config does not exist, 
>> and is not lockable, since not even .git/ exists.
>> 
> 
> Oh.

And neither does per-user config file (I triet to reproduce this error, and
forgot about ~/.gitconfig file).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] Call refresh_cache() when updating the user index for --only commits.
From: Junio C Hamano @ 2007-11-12 23:01 UTC (permalink / raw)
  To: Kristian Høgsberg; +Cc: gitster, git
In-Reply-To: <1194900502-8987-1-git-send-email-krh@redhat.com>

Kristian Høgsberg <krh@redhat.com> writes:

> We're guaranteeing the user that the index will be stat-clean after
> git commit. Thus, we need to call refresh_cache() for the user index too,
> in the 'git commit <paths>' case.
>
> Signed-off-by: Kristian Høgsberg <krh@redhat.com>
> ---
>  builtin-commit.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-commit.c b/builtin-commit.c
> index 5011b8b..35205ef 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -109,6 +109,7 @@ static char *prepare_index(const char **files, const char *prefix)
>  
>  	/* update the user index file */
>  	add_files_to_cache(verbose, prefix, files);
> +	refresh_cache(REFRESH_QUIET);
>  	if (write_cache(fd, active_cache, active_nr) || close(fd))
>  		die("unable to write new_index file");
>  

Ah.  This is the real index file that is left for the user after
a partial commit "git-commit <path>" returns.

The other refresh_cache() after this one does not matter if we
did not have hook scripts, but it is not very easy to cheaply
detect if we are not going to run any hooks so let's leave it
there. 

Thanks.

^ permalink raw reply

* Re: Cloning empty repositories, was Re: What is the idea for bare repositories?
From: Jakub Narebski @ 2007-11-12 22:49 UTC (permalink / raw)
  To: git
In-Reply-To: <7vzlxj15xe.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> Andreas Ericsson <ae@op5.se> writes:
>> Johannes Schindelin wrote:
>>
>>> But since you're one of the people knowing git _internals_ pretty
>>> well, here's another reason just for you why this cannot be done:
>>> There is no way to find out where the HEAD points to.
>>
>> $ mkdir foo; cd foo; git init; git symbolic-ref -q HEAD
>> refs/heads/master
> 
> Johannes is talking about the lack of native protocol support to
> transfer symref information.  That's the reason git-clone dances
> around finding where HEAD really points at.  It simply does not
> know -- all it gets about a symref is what SHA-1 the ref points
> at.

Do I remember correctly that there was some talk about extending git
protocol to avoid this compicated dance, and transfer symbolic refs
directly?

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] status&commit: Teach them to show commits of modified submodules.
From: Junio C Hamano @ 2007-11-12 22:39 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Sixt, Yin Ping, git
In-Reply-To: <Pine.LNX.4.64.0711120950370.4362@racer.site>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Mon, 12 Nov 2007, Johannes Sixt wrote:
>
>> Junio C Hamano schrieb:
>>
>> > I am not saying that it is wrong to use submodule to track such groups 
>> > of source trees whose versions are very closely tied together.  At 
>> > least not yet.
>> 
>> In KDE, the supermodule will actually just be a container that binds the 
>> submodules together. The essential development will happen in the 
>> submodules, and the supermodule will receive a commit quite frequently. 
>> In this case, there will often be only a few or a few dozen commits 
>> listed, and I anticipate that the integrator who is going to make the 
>> commit (to the supermodule) will probably like the summary. So I'm all 
>> for it.
>
> I like it, too.  And we can make the number of shown commits configurable, 
> just like for the merge summary.

Very good point.  In the case J6t uses for his illustration
above, changing the submodule bound to the superproject is more
or less like merging.

> But I'd rather see the code in wt-status.c than in
> git-submodule.sh.

I do not have a strong preference either way, but submodule-loving
people may want to say "git submodule shortlog <path>" or whatever
from the command line.  

Making a standalone function that takes two commits from the
subproject and produces the output, and calling that function
from both git-submodule (to implement the above "shortlog"
subcommand) and from wt-status.c (to show what Yin wants to add,
only when "status.submodule" is set), would be a reasonable
implementation. 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox