Git development
 help / color / mirror / Atom feed
* Re: [PATCH 0/2] tagsize < 8kb restriction
From: Björn Engelmann @ 2006-05-25 11:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1wuj6wln.fsf@assigned-by-dhcp.cox.net>


> Sorry, I forgot all about hash-objects X-<.  It was a convenient
> way to try out new things such as 'gitlink'.  Thanks for the
> clarification.
>
> As to unification, I am not sure if there are a lot to unify.
> Everybody starts with type, length and a LF, but after that each
> type has its own format constraints.  A grand unified command
> that knows about format constraints of every type under the sun
> does not sound like a good approach.  While we have only handful
> types (and I expect things will stay that way) it is not a big
> deal either way, though.
>   
Oops, sorry, I forgot that "modular" in C means something else than in
the OO-World...
You are right. Probably it is best to have one tool handle each type.

Actually what I am aiming for is not the internal structure. I am more
concerned about cleaning up the user-interface. When I started learning
git I found it very annoying and inconsistent that there are commands
for creating a tag and a tree in a validated fashion, but the command
for creating blobs was named "git-hash-object -w" and also could create
all other objects without validating them at all. Also, AFAIK there is
currently no way of creating a commit object with validating.

I am well aware that all functionality neccessary already exists. I just
want to prevent people learning git in future to have the same
frustrating experience as I did.

Obviously renaming / moving code around like that would break nearly all
tools build ontop of git. Therefore I would prefer to use aliasing. If
you feel like this would introduce too many unneccessary commands, I
would instead focus on improving the documentation.

Bj

^ permalink raw reply

* [PATCH] Documentation/Makefile: remove extra /
From: Martin Waitz @ 2006-05-25 12:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

As both DESTDIR and the prefix are supposed to be absolute pathnames
they can simply be concatenated without an extra / (like in the main Makefile).
The extra slash may even break installation on Windows.

Signed-off-by: Martin Waitz <tali@admingilde.org>
---
 Documentation/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 2a08f59..2b0efe7 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -52,9 +52,9 @@ man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
 install: man
-	$(INSTALL) -d -m755 $(DESTDIR)/$(man1) $(DESTDIR)/$(man7)
-	$(INSTALL) $(DOC_MAN1) $(DESTDIR)/$(man1)
-	$(INSTALL) $(DOC_MAN7) $(DESTDIR)/$(man7)
+	$(INSTALL) -d -m755 $(DESTDIR)$(man1) $(DESTDIR)$(man7)
+	$(INSTALL) $(DOC_MAN1) $(DESTDIR)$(man1)
+	$(INSTALL) $(DOC_MAN7) $(DESTDIR)$(man7)
 
 
 #
-- 
1.3.3.g29c7

-- 
Martin Waitz

^ permalink raw reply related

* Re: Slow fetches of tags
From: Ralf Baechle @ 2006-05-25 13:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0605241641250.5623@g5.osdl.org>

On Wed, May 24, 2006 at 04:43:02PM -0700, Linus Torvalds wrote:

> Actually, maybe the problem is that Ralf's tree has two roots, because of 
> the old CVS history. It might be following the other root down for the 
> "have" part, since that one doesn't exist at all in the target and the 
> other side will never acknowledge any of it. 
> 
> I'll play with it.

Interesting idea, so I went to play with it, too.  I took a copy of the
tree and deleted all branches except the v2.6.16-stable tracking branch
which I pruned back to v2.6.16.17, then added a new branch starting at
the oldest commit, your initial import of the kernel tree:

$ git branch junk 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
$ git checkout junk
$ seq -f "%05.0f" 1 100 | while read i; do echo $i; echo $i > Makefile;\
  git commit -s -m "Blah $i" Makefile; done

So with this I get:

$ git branch
* junk
  v2.6.16-stable
$

If I now run

$ strace git-fetch-pack --thin git://www.kernel.org/pub/scm/linux/kernel/\
	git/stable/linux-2.6.16.y.git \
	refs/heads/master refs/tags/v2.6.16.18 2>&1 | grep have /tmp/xxx

I get:

write(3, "0032have ef686028603c291ba510c66"..., 50) = 50
write(3, "0032have 150384dac99eb263c4385c7"..., 50) = 50
write(3, "0032have 4df3afbfc2d8f6c22d41c63"..., 50) = 50
...
write(3, "0032have db119fba3d9495aa9cd5a63"..., 50) = 50

Where ef686028603c291ba510c66 = junk, 150384dac99eb263c4385c7 = junk~1 ...
db119fba3d9495aa9cd5a63 = junk~99 (first commit on the junk branch).
100 "have" lines upto this point, then:

write(3, "0032have d87319c3e4d908e157a462d"..., 50) = 50
write(3, "0032have 22ddf44d54d0b2326f7b233"..., 50) = 50
write(3, "0032have 90a03936acb1c3400a5833c"..., 50) = 50
write(3, "0032have bf7d8bacaaf241a0f015798"..., 50) = 50
write(3, "0032have a120571fbdfc8f543eea642"..., 50) = 50
write(3, "0032have 42a46c74c4520174b82a60a"..., 50) = 50
write(3, "0032have f66ab685594d49e570b2176"..., 50) = 50
write(3, "0032have 834f514019e01f87657a257"..., 50) = 50
write(3, "0032have 9d395d1961a0eeb9e8b1ef2"..., 50) = 50
write(3, "0032have aa48603d1ba772d0a2b28ab"..., 50) = 50
write(3, "0032have 54e5705fd460c7621a4d73c"..., 50) = 50
write(3, "0032have 37863c8a9b7b0261ec76daa"..., 50) = 50
write(3, "0032have a7603f9099869f9aeebd6c7"..., 50) = 50
write(3, "0032have 623c30d2ae22cd4b8703c77"..., 50) = 50
write(3, "0032have e2c78fb27dd13ab8c778a96"..., 50) = 50
write(3, "0032have dbb676d1214c181e6cde4ce"..., 50) = 50
write(3, "0032have 1ffe5e06461f72b9b6a2569"..., 50) = 50

These are the commits for which this test tree has the tags left:

$ ls .git/refs/tags/
v2.6.16.1   v2.6.16.12  v2.6.16.15  v2.6.16.2  v2.6.16.5  v2.6.16.8
v2.6.16.10  v2.6.16.13  v2.6.16.16  v2.6.16.3  v2.6.16.6  v2.6.16.9
v2.6.16.11  v2.6.16.14  v2.6.16.17  v2.6.16.4  v2.6.16.7
$

And finally:

write(3, "0032have 1da177e4c3f41524e886b7f"..., 50) = 50

which is your Linux-2.6.12-rc2 import.

  Ralf

^ permalink raw reply

* Re: Slow fetches of tags
From: Ralf Baechle @ 2006-05-25 13:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vslmz6zah.fsf@assigned-by-dhcp.cox.net>

On Wed, May 24, 2006 at 11:41:26AM -0700, Junio C Hamano wrote:

> > $ git-name-rev 0bcf7932d0ea742e765a40b
> > 0bcf7932d0ea742e765a40b master
> > $ git-name-rev 54e938a80873e85f9c02ab4
> > 54e938a80873e85f9c02ab4 34k-2.6.16.18
> > $ git-name-rev 2d0a9369c540519bab8018e
> > 2d0a9369c540519bab8018e 34k-2.6.16.18~1
> > $ git-name-rev bf3060065ef9f0a8274fc32
> > bf3060065ef9f0a8274fc32 34k-2.6.16.18~2
> > $ git-name-rev 27602bd8de8456ac619b77c
> > 27602bd8de8456ac619b77c 34k-2.6.16.18~3
> >
> > It's sending every object back to the start of history ...
> 
> Is this "master" commit 0bcf79 part of v2.6.16.18 history?  If
> not, how diverged are you?  That is, what does this command tell
> you?

No, the master branch is where the MIPS development happens and it's
tracking Linus' master branch.  The fact that I'm talking about this
in context of -stable / v2.6.16.18 is that I started looking into why
things were taking minutes when doing a small fetch from 2.6.16-stable.
It happens just as well with Linus' tree or yet others like Matthias
Urlich's -mm git tree.

> 	git rev-list b7d0617..master | wc -l
> 
> Here, b7d0617 is the name of the commit object that is pointed
> by v2.6.16.18 tag.

$ git rev-list b7d0617..master | wc -l
12845
$ git rev-list master..b7d0617 | wc -l		(that is swapped arguments)
173
$

  Ralf

^ permalink raw reply

* [PATCH] Don't write directly to a make target ($@).
From: Jim Meyering @ 2006-05-25 13:32 UTC (permalink / raw)
  To: git

Otherwise, if make is suspended, or killed with prejudice, or if the
system crashes, you could be left with an up-to-date, yet corrupt,
generated file.

---

 Makefile |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

59fd5cb51824364100cacd92f1ca4674853a13a8
diff --git a/Makefile b/Makefile
index dbf19c6..3af3187 100644
--- a/Makefile
+++ b/Makefile
@@ -496,37 +496,43 @@ builtin-help.o: common-cmds.h
 	rm -f $@ && ln git$X $@
 
 common-cmds.h: Documentation/git-*.txt
-	./generate-cmdlist.sh > $@
+	./generate-cmdlist.sh > t$@
+	mv t$@ $@
 
 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
-	rm -f $@
+	rm -f $@ t$@
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \
-	    $@.sh >$@
-	chmod +x $@
+	    $@.sh >t$@
+	chmod +x t$@
+	mv t$@ $@
 
 $(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl
-	rm -f $@
+	rm -f $@ t$@
 	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-	    $@.perl >$@
-	chmod +x $@
+	    $@.perl >t$@
+	chmod +x t$@
+	mv t$@ $@
 
 $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
-	rm -f $@
+	rm -f $@ t$@
 	sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
 	    -e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR_SQ)|g' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-	    $@.py >$@
-	chmod +x $@
+	    $@.py >t$@
+	chmod +x t$@
+	mv t$@ $@
 
 git-cherry-pick: git-revert
-	cp $< $@
+	cp $< t$@
+	mv t$@ $@
 
 git-status: git-commit
-	cp $< $@
+	cp $< t$@
+	mv t$@ $@
 
 # These can record GIT_VERSION
 git$X git.spec \
@@ -653,7 +659,8 @@ install-doc:
 ### Maintainer's dist rules
 
 git.spec: git.spec.in
-	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
+	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > t$@
+	mv t$@ $@
 
 GIT_TARNAME=git-$(GIT_VERSION)
 dist: git.spec git-tar-tree
@@ -724,4 +731,3 @@ check-docs::
 		*) echo "no link: $$v";; \
 		esac ; \
 	done | sort
-
-- 
1.3.2

^ permalink raw reply related

* Re: parsecvs fails
From: Lars Johannsen @ 2006-05-25 14:04 UTC (permalink / raw)
  To: git; +Cc: Aneesh Kumar
In-Reply-To: <cc723f590605250432r7dd0b75xe5ff17b11da06e3c@mail.gmail.com>

On (25/05/06 17:02), Aneesh Kumar wrote:
> The tagging used by the repository given below is quiet complex.
> But it can be used as a test case for all the cvs to git converter.
> Even ViewVC and ViewCVS doesn't work with this repository.
> 
> Any help in converting it to git ?
> 
> rsync -av rsync://ci-linux.cvs.sourceforge.net/cvsroot/ci-linux/ci/ 
> ci-linux/ci/
> 
> -aneesh

 Well it seems like most of your ,v files contains tags refering to version 1 
 and yet the first version in the files is 1.1
 So to fix for parsecvs ( and maybe for viewcvs) i think you need to fix
 all symbols at 'top of file' for all ,v files. Change from v1 to v1.1
 with something like sed ',/@#/s/:1*$/:1.1/;,/@#/s/:1;*$/:1.1;/'
 

-- 
Lars 

^ permalink raw reply

* bogus "fatal: Not a git repository"
From: Linus Torvalds @ 2006-05-25 15:22 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano, Johannes Schindelin


I was just testing that "git ls-remote" change by Junio, and when you're 
not in a git repository, it gives this totally bogus warning. The _target_ 
obviously has to be a git repository, but there's no reason why you'd have 
to be in a local git repo when doing an ls-remote.

The reason is commit 73136b2e8a8ee024320c5ac6a0f14f912432bf03 by Dscho: it 
adds calls to git-repo-config in git-parse-remote.sh to get the remote 
shorthands etc.

Now, either we should just hide and ignore the error from git-repo-config 
(probably bad, because some errors _are_ valid - like git-repo-config 
failing due to bad syntax in the config file), or we should just make 
git-repo-config quietly handle the case of not being in a git repository.

This does the latter: just quietly accepting (and doing nothing - trying 
to set a value will result in the lock-file failing) our lot in life 
sounds better than dying with a bogus error message.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/repo-config.c b/repo-config.c
index 127afd7..08fc4cc 100644
--- a/repo-config.c
+++ b/repo-config.c
@@ -108,7 +108,8 @@ static int get_value(const char* key_, c
 
 int main(int argc, const char **argv)
 {
-	setup_git_directory();
+	int nongit = 0;
+	setup_git_directory_gently(&nongit);
 
 	while (1 < argc) {
 		if (!strcmp(argv[1], "--int"))

^ permalink raw reply related

* Re: file name case-sensitivity issues
From: Alex Riesen @ 2006-05-25 15:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7j4c4af3.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano, Wed, May 24, 2006 00:57:04 +0200:
> I'd call that a PEBCAK.

It is not solvable there though.

> If you _know_ you are working on a case challenged filesystem, I
> think the best thing you can do is not to work on a project that
> has files in different cases on such a filesystem.

That is seldom an acceptable suggestion. Besides, how about when you
don't _know_, like when cloning onto an usb-stick mounted with
auto-detection? Will the files with case-different names just
overwrite each other?

^ permalink raw reply

* Re: [PATCH] Don't write directly to a make target ($@).
From: Junio C Hamano @ 2006-05-25 16:28 UTC (permalink / raw)
  To: Jim Meyering; +Cc: git
In-Reply-To: <87hd3e5ixw.fsf@rho.meyering.net>

Jim Meyering <jim@meyering.net> writes:

> Otherwise, if make is suspended, or killed with prejudice, or if the
> system crashes, you could be left with an up-to-date, yet corrupt,
> generated file.

Thanks.  Maybe you would want a "make clean" target for them too
if you do this.  I often use $@+ instead of t$@ so that I can
say "rm -f *+" there.

> @@ -496,37 +496,43 @@ builtin-help.o: common-cmds.h
>  	rm -f $@ && ln git$X $@
>  
>  common-cmds.h: Documentation/git-*.txt
> -	./generate-cmdlist.sh > $@
> +	./generate-cmdlist.sh > t$@
> +	mv t$@ $@
>  

IOW, like this:

common-cmds.h: Documentation/git-*.txt
	rm -f $@+ $@
        ./generate-cmdlist.sh > $@+
        mv $@+ $@

clean::
	rm -f *+

^ permalink raw reply

* Re: [PATCH] Don't write directly to a make target ($@).
From: Timo Hirvonen @ 2006-05-25 16:41 UTC (permalink / raw)
  To: git; +Cc: jim, git
In-Reply-To: <7vejyixe5g.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:

> Jim Meyering <jim@meyering.net> writes:
> 
> > Otherwise, if make is suspended, or killed with prejudice, or if the
> > system crashes, you could be left with an up-to-date, yet corrupt,
> > generated file.
> 
> Thanks.  Maybe you would want a "make clean" target for them too
> if you do this.  I often use $@+ instead of t$@ so that I can
> say "rm -f *+" there.
> 
> > @@ -496,37 +496,43 @@ builtin-help.o: common-cmds.h
> >  	rm -f $@ && ln git$X $@
> >  
> >  common-cmds.h: Documentation/git-*.txt
> > -	./generate-cmdlist.sh > $@
> > +	./generate-cmdlist.sh > t$@
> > +	mv t$@ $@
> >  
> 
> IOW, like this:
> 
> common-cmds.h: Documentation/git-*.txt
> 	rm -f $@+ $@
>         ./generate-cmdlist.sh > $@+
>         mv $@+ $@
> 
> clean::
> 	rm -f *+

Or just use one tmp file, i.e. ".tmp" instead of t$@.

-- 
http://onion.dynserv.net/~timo/

^ permalink raw reply

* Re: [PATCH] Don't write directly to a make target ($@).
From: Jim Meyering @ 2006-05-25 16:42 UTC (permalink / raw)
  To: Timo Hirvonen; +Cc: git
In-Reply-To: <20060525194125.9380842a.tihirvon@gmail.com>

Timo Hirvonen <tihirvon@gmail.com> wrote:
> Or just use one tmp file, i.e. ".tmp" instead of t$@.

Argh, no.
That'd fail big time with parallel builds.

^ permalink raw reply

* Re: [PATCH] Don't write directly to a make target ($@).
From: Jim Meyering @ 2006-05-25 16:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejyixe5g.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> Jim Meyering <jim@meyering.net> writes:
>
>> Otherwise, if make is suspended, or killed with prejudice, or if the
>> system crashes, you could be left with an up-to-date, yet corrupt,
>> generated file.
>
> Thanks.  Maybe you would want a "make clean" target for them too
> if you do this.  I often use $@+ instead of t$@ so that I can
> say "rm -f *+" there.

I chose a prefix rather than a suffix, so that if git is built on a file
system with unreasonable file name length limitations, the prefix will
distinguish the temporary from the target; in that situation, a suffixed
temporary name could map to the target name.

However, assuming reasonable file name length limits, using a suffix is
generally better, since it works even when the target is an absolute
name.  Adding a prefix obviously won't work with an absolute name.

I'm happy to ignore 14-byte(and 8.3)-limited file systems and
go with a suffix, if you still prefer that.  New patch coming up.

^ permalink raw reply

* git-cvsserver wart?
From: Cameron McBride @ 2006-05-25 16:42 UTC (permalink / raw)
  To: git

I'm a new git user, so if I'm doing something boneheaed - sharp kicks
are welcome.

For reasons I won't go into, the ability to use cvs clients is darn
near crucial.  Although most development is local (where I install /
use git), pulling down the latest updates and pushing up minor changes
via CVS is helpful at remote locations where I don't want to maintain
clients.  Git with git-cvsserver makes this very nice.   Thanks to
all!

Now, the problem I ran into:

code/ntropy> cvs up
Can't use an undefined value as an ARRAY reference at
/usr/local/bin/git-cvsserver line 761.
closing dbh with active statement handles
cvs [update aborted]: end of file from server (consult above messages if any)
code/ntropy> cvs -v
Concurrent Versions System (CVS) 1.11.1p1 (client/server)

Doing a 'cvs up -dP' (or either of the two individually) seems to work fine.

so, it's an old client, a newer client doesn't have this problem.  a
bare 'cvs up' works fine on:
Concurrent Versions System (CVS) 1.11.17 (client/server)

Just to be clear, it appears everything gets updated with the
workaround - but there might be something else amiss, so I thought it
was worth mentioning.

Cameron

p.s.  I'm assuming the following statement is harmless (it's always present):
closing dbh with active statement handles

^ permalink raw reply

* Re: [PATCH] Don't write directly to a make target ($@).
From: Jim Meyering @ 2006-05-25 16:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejyixe5g.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> Jim Meyering <jim@meyering.net> writes:
>
>> Otherwise, if make is suspended, or killed with prejudice, or if the
>> system crashes, you could be left with an up-to-date, yet corrupt,
>> generated file.
>
> Thanks.  Maybe you would want a "make clean" target for them too
> if you do this.  I often use $@+ instead of t$@ so that I can
> say "rm -f *+" there.
>
>> @@ -496,37 +496,43 @@ builtin-help.o: common-cmds.h
>>  	rm -f $@ && ln git$X $@
>>
>>  common-cmds.h: Documentation/git-*.txt
>> -	./generate-cmdlist.sh > $@
>> +	./generate-cmdlist.sh > t$@
>> +	mv t$@ $@
>>
>
> IOW, like this:
>
> common-cmds.h: Documentation/git-*.txt
> 	rm -f $@+ $@
>         ./generate-cmdlist.sh > $@+
>         mv $@+ $@
>
> clean::
> 	rm -f *+

I've included a revised patch below.

I left off the `clean' addition, because I believe "make clean" should
not remove wildcard patterns like "*+", on the off-chance that someone
uses names like that for files they care about.  Besides, in practice,
those temporary files are left behind so rarely that they're not a bother,
and they're removed again as part of the next build.


---------

Subject: [PATCH] Don't write directly to a make target ($@).  Update atomically.

Otherwise, if make is killed with prejudice, or if the system crashes,
you could be left with an up-to-date, yet corrupt generated file.

---

 Makefile |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

620173525c5075f2056af107a85881d0d50d3a89
diff --git a/Makefile b/Makefile
index dbf19c6..04536f6 100644
--- a/Makefile
+++ b/Makefile
@@ -496,37 +496,43 @@ builtin-help.o: common-cmds.h
 	rm -f $@ && ln git$X $@
 
 common-cmds.h: Documentation/git-*.txt
-	./generate-cmdlist.sh > $@
+	./generate-cmdlist.sh > $@+
+	mv $@+ $@
 
 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
-	rm -f $@
+	rm -f $@ $@+
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \
-	    $@.sh >$@
-	chmod +x $@
+	    $@.sh >$@+
+	chmod +x $@+
+	mv $@+ $@
 
 $(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl
-	rm -f $@
+	rm -f $@ $@+
 	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-	    $@.perl >$@
-	chmod +x $@
+	    $@.perl >$@+
+	chmod +x $@+
+	mv $@+ $@
 
 $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
-	rm -f $@
+	rm -f $@ $@+
 	sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
 	    -e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR_SQ)|g' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-	    $@.py >$@
-	chmod +x $@
+	    $@.py >$@+
+	chmod +x $@+
+	mv $@+ $@
 
 git-cherry-pick: git-revert
-	cp $< $@
+	cp $< $@+
+	mv $@+ $@
 
 git-status: git-commit
-	cp $< $@
+	cp $< $@+
+	mv $@+ $@
 
 # These can record GIT_VERSION
 git$X git.spec \
@@ -653,7 +659,8 @@ install-doc:
 ### Maintainer's dist rules
 
 git.spec: git.spec.in
-	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
+	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
+	mv $@+ $@
 
 GIT_TARNAME=git-$(GIT_VERSION)
 dist: git.spec git-tar-tree
@@ -724,4 +731,3 @@ check-docs::
 		*) echo "no link: $$v";; \
 		esac ; \
 	done | sort
-
-- 
1.3.2

^ permalink raw reply related

* Re: [RFC][PATCH] Allow transfer of any valid sha1
From: Eric W. Biederman @ 2006-05-25 17:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwtcay5k8.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> ebiederm@xmission.com (Eric W. Biederman) writes:
>
>> I clearly would not advertise it.  My problem is that I have
>> evidence that someone pulled a given sha1 at some point from 
>> some branch on a given repository.  But I don't have that branch.
>
> If that was over rsync (as you mention later), then I would
> consider that is an unfortunate unfixable issue.  rsync mirrors
> are fundamentally unsafe for git -- Linus and I do not keep
> saying rsync should be deprecated without good reasons.
>
> There still might be bugs that breaks this guarantee outside
> rsync, but if that is the case we should fix it.

Sounds reasonable.  So far I don't believe anything I have
proposed would result in a reference getting written
if we don't transfer all of the dependencies.

I do need to examine the algorithm by which we compute what
to transmit and make certain I have not broke that.
I believe I am still only using the existing references
for finding a common point in the history.

> I do not want to rehash the thread around Sep 29th 2005 here.
> The entry point of that thread is this message:
>
> 	http://marc.theaimsgroup.com/?l=git&m=112795140820665
>
> and the punch line are these two messages:
>
> 	http://marc.theaimsgroup.com/?l=git&m=112801874021223
> 	http://marc.theaimsgroup.com/?l=git&m=112802808030710
>
> I did not realize what I was breaking initially.  I am not
> ashamed of having been wrong, but it was embarrassing ;-).
>
>> If I want
>> a copy of your pu branch at some point in the past, but you have
>> rebased it since that sha1 was published then there will clearly not
>> be a path from any current head to that branch.  But if I still have a
>> copy of the sha1 I should actually be able to recover the old copy of
>> the pu branch from your tree.
>
> Not necessarily.  I occasionally prune after rewinding.  When my
> "pu" branch head does not point at the lost commit, the
> repository may or may not have that object you happen to know I
> used to have anymore.

Agreed.  Of course the simple object existence test works in that
instance.  Not that it does in general.  The could be a git-prune
versus upload-pack race for instance.

>>> Now, proving that a given SHA1 is the name of an object that
>>> exists in the repository is cheap (has_sha1_file()), but proving
>>> that the object is reachable from some of our refs can become
>>> quite expensive.  That gives this issue a security implication
>>> as well -- you can easily DoS the git-daemon that way, for
>>> example.
>>
>> Exactly, which is why I aimed for the cheap test.
>
> But the thing is the cheap test is broken, eh, rather,
> propagates brokenness downstream (which is perhaps worse).

As I understand it brokenness is writing a ref when you don't
have the complete tree it points to.  I have no desire
to do that.

My basic argument is that starting a pull with a commit that is not a
reference is no worse than staring a pull from a broken repository.  The
same checks that protects us should work in either case.

So as long as what I have done does not compromise the computation
of a common ancestor I think we should be fine.

I can see the argument that in a non-broken repository that finding
a path from an existing ref is proof that everything will work.
However if the code can be made to work without requiring that
proof it should be an even stronger guarantee of correctness,
and the expensive step of walking down from an existing ref would
be unnecessary.

Eric

^ permalink raw reply

* Re: [RFC][PATCH] Allow transfer of any valid sha1
From: Linus Torvalds @ 2006-05-25 17:28 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Junio C Hamano, git
In-Reply-To: <m1lksqdook.fsf@ebiederm.dsl.xmission.com>



On Thu, 25 May 2006, Eric W. Biederman wrote:
> 
> My basic argument is that starting a pull with a commit that is not a
> reference is no worse than staring a pull from a broken repository.  The
> same checks that protects us should work in either case.

I think Junio reacted to the subject line, which was somewhat badly 
phrased. You're not looking to transfer random objects, you're looking to 
_start_ a branch at any arbitrary known point.

However, Junio's point is probably that the "any valid SHA1" might 
actually point to a broken tree, even if it exists on the server.

Of course, in that case hopefully git-rev-list exits with an error, and 
the server doesn't generate any pack at all rather than generating a 
broken one.

However, there's a (questionable) security issue: what if the server 
doesn't _want_ to expose certain branches? Arguably, if you know the top 
SHA1, you likely know all that it contains, but it may be a valid argument 
to say that if the SHA1 isn't an exported branch, you shouldn't 
necessarily be able to follow it.

		Linus

^ permalink raw reply

* Re: [RFC][PATCH] Allow transfer of any valid sha1
From: Eric W. Biederman @ 2006-05-25 17:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, git
In-Reply-To: <Pine.LNX.4.64.0605251024320.5623@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> On Thu, 25 May 2006, Eric W. Biederman wrote:
>> 
>> My basic argument is that starting a pull with a commit that is not a
>> reference is no worse than staring a pull from a broken repository.  The
>> same checks that protects us should work in either case.
>
> I think Junio reacted to the subject line, which was somewhat badly 
> phrased. You're not looking to transfer random objects, you're looking to 
> _start_ a branch at any arbitrary known point.

Probably, but if I understood enough to get the subject line right the
first time I probably would have understood enough to just send
a patch :)

> However, Junio's point is probably that the "any valid SHA1" might 
> actually point to a broken tree, even if it exists on the server.
>
> Of course, in that case hopefully git-rev-list exits with an error, and 
> the server doesn't generate any pack at all rather than generating a 
> broken one.
>
> However, there's a (questionable) security issue: what if the server 
> doesn't _want_ to expose certain branches? Arguably, if you know the top 
> SHA1, you likely know all that it contains, but it may be a valid argument 
> to say that if the SHA1 isn't an exported branch, you shouldn't 
> necessarily be able to follow it.

Agreed and I mentioned this one earlier.

However the only way the above scenario can even happen in a useful
manner is with a shared object store for several repositories.  Otherwise
you couldn't access the data you don't want to share.

I can't think of a valid argument against not sharing an entire
repository except David Woodhouse's bandwidth concern.
Of course what was wanted there was a test a limit to how far
back in the history you could look for a common commit, which
is something different.

In general it is much easier to guarantee that either a repository is
shared or it is not.  Making a guarantee that objects that
"git-fsck-objects --unreachable --full" identifies will never be
downloaded is difficult, and probably not worth encouraging
people to do.

That said it is easy to keep the current behavior as an option,
so the security policy issue shouldn't limit the technical discussion.

Eric

^ permalink raw reply

* Re: file name case-sensitivity issues
From: Junio C Hamano @ 2006-05-25 18:17 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <20060525154735.GA6119@steel.home>

fork0@t-online.de (Alex Riesen) writes:

> ... Besides, how about when you
> don't _know_, like when cloning onto an usb-stick mounted with
> auto-detection? Will the files with case-different names just
> overwrite each other?

You _do_ realize that example is bogus, don't you?  At least I
hope you did after you sent it.

You are cloning a project that has mixed cases (say foo and FOO)
onto a case challenged filesystem but unfortunately you did not
know the filesystem was case challenged in advance.  So after
the cloning, your checkout results in only one file either foo
or FOO but not both, because you cannot have two files whose
names are different only in case on such a filesystem.

Tough.

There are some other problems on case challenged filesystems
that we _could_ solve but we probably don't right now.  You
could concentrate on fixing those, instead of talking about
unfixable.


There are probably 2 kinds of case-challenged-ness.  On non
case-challenged filesystems, if I say "rm -f foo Foo; echo >foo;
echo >Foo", "ls" says "foo Foo".  On case-challenged systems,
one of the following would happen:

 * "ls" says "foo".  If I swap the order of the "echo", it says
   "Foo".  The filesystem does record the case but does not
   allow two names with only case difference.

 * "ls" says ef oh oh in a case different from either "foo" nor
   "Foo".  Or it says "foo" but if I swap the order of the
   "echo", it still says "foo".  The filesystem does not record
   the case, and does not allow two names with only case
   difference.  readdir() may do some heuristics such as
   lowercasing the name, but the point is the returned string is
   unrealiable.

I have git installed on a Cygwin on NTFS at work, and I think it
is in the former category.  git seems to work as expected,
modulo that you obviously cannot have two files "foo" and "Foo"
in your git-managed project.  Probably a patch to delete "Foo"
and create "foo" (to make your project friendlier to Windows)
and a merge to do the same would work well, though I haven't
tried.

What breaks on filesystems in the latter category?  I suspect
not many.

update-index records the names given by the user (I am assuming
that at least the shell is case sensitive), uses that name to
stat() and open() to update and/or refresh the cache entry, so
that codepath should be OK.  Anything that goes from index to
find names and then goes to the filesystem with those names
(diff family, checkout-index and read-tree -u) should be fine.

ls-files -o/-i would have a hard time, since they need to work
with strings read from readdir(), as you found out.  That means
"git add" and "git clean" may not work.

I do not think of anything else that is affected by readdir()
breakage offhand; the core is doing pretty fine as it is (I do
not consider ls-files -o/-i a core -- that is more Porcelainish
part of the whole package).

I honestly think that on Windows people would not even want to
use the core Porcelainish nor even Cogito.  The would want a
native Window-ish UI that drives the core.  I do not think such
a program would internally call "git add" nor read from
"ls-files -o/-i".  It would instead do its own Folder hierarchy
traversal, and use "update-index --add --remove" to implement
its own "git add/rm" UI, and read from "ls-files" (not -o nor
-i) so that it can show tracked and untracked files differently
in its Explorer view.

So in that sense, I think ls-files -o/-i issue is quite low
priority.  It does not matter on sane filesystems, and in the
place where it matters the most, the desired solution does not
involve ls-files -o/-i working well there.

Having said that, I think you _could_ have a repository
configuration that says "this repository sits on a case
challenged filesystem", and update ls-files to munge what it
gets from readdir() by comparing them against what you have in
the index.  If your readdir() gives "foo" when you have "FOO" in
the index on such a filesystem, you do not say that "foo" is an
untracked file -- you just say you found "FOO" as you expected.

^ permalink raw reply

* Re: [RFC][PATCH] Allow transfer of any valid sha1
From: Junio C Hamano @ 2006-05-25 18:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Eric W. Biederman, git
In-Reply-To: <Pine.LNX.4.64.0605251024320.5623@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> On Thu, 25 May 2006, Eric W. Biederman wrote:
>> 
>> My basic argument is that starting a pull with a commit that is not a
>> reference is no worse than staring a pull from a broken repository.  The
>> same checks that protects us should work in either case.
>
> I think Junio reacted to the subject line, which was somewhat badly 
> phrased. You're not looking to transfer random objects, you're looking to 
> _start_ a branch at any arbitrary known point.

I realize that now.  From Eric's original message:

  To be accurate of his source Andrew records the sha1 of the commit
  and the git tree he pulled from.  Which looks like:

  GIT b307e8548921c686d2eb948ca418ab2941876daa \
   git+ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

  So I figured I would transform the above line into the obvious
  git-pull command:

   git-pull \
    git+ssh://master.kernel.org/pub/scm/.../torvalds/linux-2.6.git \
    b307e8548921c686d2eb948ca418ab2941876daa

With the limitation of the current tool, we could do:

  git-fetch master.kernel.org:/pub/scm/.../torvalds/linux-2.6.git \
	refs/heads/master:refs/remotes/linus/master
  git merge 'whatever merge message' HEAD b307e854

assuming that b307e854 is reachable from your tip.  So it might
be just a matter of giving a convenient shorthand to do the
above two commands, instead of mucking with upload-pack.

^ permalink raw reply

* Re: [RFC][PATCH] Allow transfer of any valid sha1
From: Linus Torvalds @ 2006-05-25 18:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric W. Biederman, git
In-Reply-To: <7v3beyuffg.fsf@assigned-by-dhcp.cox.net>



On Thu, 25 May 2006, Junio C Hamano wrote:
> 
> With the limitation of the current tool, we could do:
> 
>   git-fetch master.kernel.org:/pub/scm/.../torvalds/linux-2.6.git \
> 	refs/heads/master:refs/remotes/linus/master
>   git merge 'whatever merge message' HEAD b307e854
> 
> assuming that b307e854 is reachable from your tip.  So it might
> be just a matter of giving a convenient shorthand to do the
> above two commands, instead of mucking with upload-pack.

It's not upload-pack that needs mucking with. It's simply "fetch-pack" 
that currently will refuse to say "want b307e854..", because the only 
thing it can do is say "want <headref>".

So the patch would literally be to have a way to tell fetch-pack directly 
what you want, and not have the "only select from remote branches" logic.

		Linus

^ permalink raw reply

* git-format-patch possible regressions
From: Marco Costalba @ 2006-05-25 19:23 UTC (permalink / raw)
  To: git

A couple of possible regressions:

1) Unreconized --signoff option

$ git --version
git version 1.3.3.ged90
$ git-format-patch -s HEAD^..HEAD
0001-cat-file-document-p-option.txt
$ git-format-patch --signoff HEAD^..HEAD
fatal: unrecognized argument: --signoff


2) Unhandled ranges list

$ git --version
git version 1.3.3.ged90
$ git-format-patch -s HEAD^..HEAD HEAD^^..HEAD^
0001-cat-file-document-p-option.txt

$ git --version
git version 1.3.3.gf205
git checkout -b test 51ce34b9923d9b119ac53414584f80e05520abea
$ git-format-patch HEAD^..HEAD HEAD^^..HEAD^
0001-Builtin-git-show-branch.txt
0002-Builtin-git-apply.txt

Both regressions brake qgit. The first one is easy to fix (--signoff  --> -s)
The second one is not so easy.
It is use to format a patch series starting from a mouse selected
multiple revisions. Note that the revisions could be not consecutive.
Note also that looping git-format-patch for each revision does not
updates patch number that always stay at 0001.

Feeding all the selected revisions in one go in the form
git-format-patch sel1^..sel1  sel2^..sel2    ........  seln^..seln is
the only way I have found to:

1) create a patch series of (randomly) selected revisions

2) increment patch numbers for each patch


   Marco

^ permalink raw reply

* Re: git-format-patch possible regressions
From: Linus Torvalds @ 2006-05-25 19:43 UTC (permalink / raw)
  To: Marco Costalba; +Cc: git
In-Reply-To: <e5bfff550605251223g2cf8cfb9vfa18d016b369188d@mail.gmail.com>



On Thu, 25 May 2006, Marco Costalba wrote:
> 
> 2) Unhandled ranges list
> 
> $ git-format-patch -s HEAD^..HEAD HEAD^^..HEAD^

You _really_ shouldn't use this "mix two ranges" format.

It may have "worked" before, but it
 - worked differently from all other git ranges
 - it was really an implementation detail (handling each argument 
   separately)

The "x..y" format is defined to mean the same thing "y ^x", and that means 
that "HEAD^..HEAD HEAD^^..HEAD^" really does mean the same thing as 
"^HEAD^ ^HEAD^^ HEAD HEAD^", which in turn means the same thing as "^HEAD^ 
HEAD" from a reachability standpoint (since HEAD^ is by definition 
reachable from HEAD, adding it won't change the revision list, and the 
same goes for ^HEAD^^ vs ^HEAD^).

So thus "HEAD^..HEAD HEAD^^..HEAD^" really _is_ the same thing as 
"HEAD^..HEAD", and any tool that thought otherwise was just being 
very confused.

Now, we could choose to try to make "a..b" mean something else (ie make 
the "^a" part only meaningful for that particular "sub-query"), and yes, 
in many ways that would be a more intuitive thing, but it's not how git 
revision descriptions work currently, and if we make that change we should 
do it across the board.

(It's not an easy change to make, but it should be possible by having 
multiple separate NECESSARY/UNNECESSARY bits, and make the revision 
walking logic a whole lot more complicated than it already is).

So I'd argue that you should really do something like

	( git-rev-list a..b ; git-rev-list c..d ) |
		git-format-patch --stdin

in qgit if you want the ranges to be truly independent.

(And no, I don't think git-format-patch takes a "--stdin" argument, but it 
might not be unreasonable to add it as a generic revision walking 
argument for scripting like this).

			Linus

^ permalink raw reply

* Re: git-format-patch possible regressions
From: Junio C Hamano @ 2006-05-25 19:56 UTC (permalink / raw)
  To: Marco Costalba; +Cc: git, Linus Torvalds
In-Reply-To: <e5bfff550605251223g2cf8cfb9vfa18d016b369188d@mail.gmail.com>

"Marco Costalba" <mcostalba@gmail.com> writes:

> A couple of possible regressions:
>
> 1) Unreconized --signoff option
>
> $ git --version
> git version 1.3.3.ged90
> $ git-format-patch -s HEAD^..HEAD
> 0001-cat-file-document-p-option.txt
> $ git-format-patch --signoff HEAD^..HEAD
> fatal: unrecognized argument: --signoff
>...
> Both regressions brake qgit. The first one is easy to fix (--signoff  --> -s)

I do not think -s does what you want.  It means "do not generate
diff" to the diff family, but format-patch overrides it and
forces generating patch+stat output, so you do not see what it
is doing.

Also I do not think we would want to have --sign to format-patch
anyway; it encourages a wrong workflow.  Please see this and
other messages in the thread:

	http://article.gmane.org/gmane.comp.version-control.git/20389

On a slightly related topic, I sent a message to Pasky about
this -s stuff.  It means something slightly different in
diff-files (instead of asking for no output, it behaves as a
no-op there), and we can remove that compatibility wart once
Cogito stops using "diff-files -s" when it wants to do
"diff-files" in cg-merge (and I suspect that diff-files is
unnecessary).

> 2) Unhandled ranges list
>
> The second one is not so easy.

This is a real regression; I was hoping Porcelain writers were
paying attention of what are coming, but obviously the
description in "What's in git.git" messages and discussion on
the list were not detailed enough.  My apologies.

Having said that, I think what Linus says about equilvalence
between "a..b" and "^a b" makes whole lot of sense.  However, I
could argue both ways.  Linus's interpretation of "a..b c..d" is
"^a ^c b d", but format-patch's interpretation has always been
"do '^a b' and then '^c d'".

The former is more generic; you could say "not in A nor B but in
C pretty easily -- list of ranges cannot express something like
that.  On the other hand, at least in the context of usual
format-patch, the convenience of being able to work on more than
one ranges in sequence may far outweigh the restriction of not
being able to say something like that.

As an easy alternative, we could give --start-number=<n> to
format-patch so that you can do the iteration yourself instead
of having format-patch to iterate over the list.

^ permalink raw reply

* Re: [PATCH 0/2] tagsize < 8kb restriction
From: Junio C Hamano @ 2006-05-25 20:03 UTC (permalink / raw)
  To: Björn Engelmann; +Cc: git
In-Reply-To: <44759ABF.1010209@gmx.de>

Björn Engelmann <BjEngelmann@gmx.de> writes:

> I am well aware that all functionality neccessary already exists. I just
> want to prevent people learning git in future to have the same
> frustrating experience as I did.

I think I understood your points, but for normal "people
learning git", hash-object, write-tree, commit-tree and mktag
are _not_ the commands they need to know about.  These low level
commands are for Porcelain writers.  The users do not create
blobs or trees or commits -- they "git add", "git rm", "git
commit", and "git pull" and as part of these actions, blobs,
trees and commits are created.  The users do not even create
tags with mktag -- they use "git tag" for that.

^ permalink raw reply

* Re: git-format-patch possible regressions
From: Marco Costalba @ 2006-05-25 20:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0605251233300.5623@g5.osdl.org>

On 5/25/06, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> The "x..y" format is defined to mean the same thing "y ^x", and that means
> that "HEAD^..HEAD HEAD^^..HEAD^" really does mean the same thing as
> "^HEAD^ ^HEAD^^ HEAD HEAD^", which in turn means the same thing as "^HEAD^
> HEAD" from a reachability standpoint (since HEAD^ is by definition
> reachable from HEAD, adding it won't change the revision list, and the
> same goes for ^HEAD^^ vs ^HEAD^).
>
> So thus "HEAD^..HEAD HEAD^^..HEAD^" really _is_ the same thing as
> "HEAD^..HEAD", and any tool that thought otherwise was just being
> very confused.
>

Perhaps I have chose the wrong example but it was  _only_
instrumental in better explaing the regression.

The general problem is how to format patches files named with
consecutive numbers starting from a set of possible unrelated
revisions.

> Now, we could choose to try to make "a..b" mean something else (ie make
> the "^a" part only meaningful for that particular "sub-query"), and yes,
> in many ways that would be a more intuitive thing, but it's not how git
> revision descriptions work currently, and if we make that change we should
> do it across the board.
>
> (It's not an easy change to make, but it should be possible by having
> multiple separate NECESSARY/UNNECESSARY bits, and make the revision
> walking logic a whole lot more complicated than it already is).
>
> So I'd argue that you should really do something like
>
>         ( git-rev-list a..b ; git-rev-list c..d ) |
>                 git-format-patch --stdin
>
> in qgit if you want the ranges to be truly independent.
>
> (And no, I don't think git-format-patch takes a "--stdin" argument, but it
> might not be unreasonable to add it as a generic revision walking
> argument for scripting like this).
>

To fix qgit problem could be enough to add/modify the option -nx to
make git-format-patch do not default with 0001 number but with x and
then simply call git-format-patch in a loop:

    for(int i = 0;  i  <selectedRevisions.count(); i++)
         git-format patch -n<i+1> selectedRevisions[i]  ^selectedRevisions[i];


But of course it is clear your suggestion could be a solution for
much broader cases.

    Marco

^ 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