Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Josh Triplett @ 2007-06-02  0:52 UTC (permalink / raw)
  To: Frank Lichtenheld; +Cc: git, 427078
In-Reply-To: <20070601234710.GW3242@planck.djpig.de>

[-- Attachment #1: Type: text/plain, Size: 2947 bytes --]

Frank Lichtenheld wrote:
> On Fri, Jun 01, 2007 at 03:20:52PM -0700, Josh Triplett wrote:
>> Signed-off-by: Josh Triplett <josh@freedesktop.org>
>> Signed-off-by: Josh Triplett <josh@freedesktop.org>
> 
> :) (Wanted to make some funny remark, but its too late here to be funny
> in a foreign language...)

Argh.  git-commit -s --amend signed a second time.  Sorry I missed this.

>>  Documentation
>>  --------------
>> -Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
>> +Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <git@vger.kernel.org>.
> 
> No offence, but adding your name here for removing content? ;)

I intentionally avoided adding my name to the pages in which I only removed
content, or only added a reference to gitignore(5).  In the case of
git-ls-files, I rewrote some of the material.  However, I don't care that
strongly about the credit.

>> +Some git plumbing tools, such as git-ls-files(1) and
>> +git-read-tree(1), read `gitignore` patterns specified by
>> +command-line options, or from files specified by command-line
>> +options.
> 
> Missing gitlink:

Ah, good point.

> Also I don't like the paragraph. It should probably mention that
> these programs actually implement the behaviour described, that
> they aren't hardcoded to the mentioned filenames and that
> all git porcelain just happens to call them with them.

That seems like an implementation detail, only relevant to users of
git-ls-files and git-read-tree.

>> +Patterns have the following format:
>> +
>> + - A blank line matches no files, so it can serve as a separator
>> +   for readability.
>> +
>> + - A line starting with # 
> 
> Is here missing something?

Oops.  Yes, this should have said:

- A line starting with # serves as a comment.

>> + - Otherwise, git treats the pattern as a shell glob suitable
>> +   for consumption by fnmatch(3) with the FNM_PATHNAME flag: any
>> +   slash in the pattern must match a slash in the pathname.  For
>> +   example, "Documentation/\*.html" matches
>> +   "Documentation/git.html" but not "ppc/ppc.html".  A leading
>> +   slash matches the beginning of the pathname; for example,
>> +   "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
> 
> I realise this is copy&paste but shouldn't that read:
> "Documentation/\*.html" matches "Documentation/git.html"
> but not "Documentation/ppc/ppc.html"
> ?

I don't know.  Neither file seems to exist in current Git.

>> +Documentation
>> +-------------
>> +Documentation by Josh Triplett.
> 
> No offence again, but given the amount of copy&paste, maybe the names from
> git-ls-files should also be added here.

Entirely correct; I don't know why I missed that, as I had intended to copy those
names. My apologies.

Expect an updated patch shortly, to fix the issues you pointed out.

- Josh Triplett


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply

* Re: [mingw port] git plumbing piping with CR/NL
From: Nguyen Thai Ngoc Duy @ 2007-06-01 23:56 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Git Mailing List, Johannes Sixt
In-Reply-To: <20070601231816.GC6360@steel.home>

On 6/1/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> Nguyen Thai Ngoc Duy, Fri, Jun 01, 2007 20:23:24 +0200:
> > Hi,
> >
> > I haven't had time looking at the code yet. I report here so that I
> > can free my memory for other things. I made a command like this:
> >
> > $ git ls-tree -r HEAD|grep blah.cc|git update-index --index-info
> >
> > and the output of git-status was:
> >
> > $ git status
> > # On branch master
> > # Changes to be committed:
> > #   (use "git reset HEAD <file>..." to unstage)
> > #
> > #     new file:   path/to/blah.cc\r
> > #
> > # Changed but not updated:
> > #   (use "git add/rm <file>..." to update what will be committed)
> > #
> > #     deleted:    path/to/blah.cc\r
> > ...
> > $ git version
> > git version 1.5.2.651.g80e39-dirty (if the commit isn't in the master
> > branch, it is based on master branch)
> >
> > Apparently git should ignore \r at the end of the path. ...
>
> Why should it? \r is a valid character in filenames almost everywhere
> (except for the some proprietary OSes, as usual).

Right. Although I doubt usage of \r and other special characters in filenames.

> Why does your grep _alters_ the input, instead of filtering it, btw?

I have no idea. It's grep from MKS Toolkit FYI.
-- 
Duy

^ permalink raw reply

* Re: [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Frank Lichtenheld @ 2007-06-01 23:47 UTC (permalink / raw)
  To: Josh Triplett; +Cc: git, 427078
In-Reply-To: <46609BC4.9000508@freedesktop.org>

Cool :)

Some remarks below.

On Fri, Jun 01, 2007 at 03:20:52PM -0700, Josh Triplett wrote:
> Signed-off-by: Josh Triplett <josh@freedesktop.org>
> Signed-off-by: Josh Triplett <josh@freedesktop.org>

:) (Wanted to make some funny remark, but its too late here to be funny
in a foreign language...)

>  Documentation
>  --------------
> -Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
> +Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <git@vger.kernel.org>.

No offence, but adding your name here for removing content? ;)

> +Some git plumbing tools, such as git-ls-files(1) and
> +git-read-tree(1), read `gitignore` patterns specified by
> +command-line options, or from files specified by command-line
> +options.

Missing gitlink:

Also I don't like the paragraph. It should probably mention that
these programs actually implement the behaviour described, that
they aren't hardcoded to the mentioned filenames and that
all git porcelain just happens to call them with them.

But, as said, too late here for proper English ;)

> +Patterns have the following format:
> +
> + - A blank line matches no files, so it can serve as a separator
> +   for readability.
> +
> + - A line starting with # 

Is here missing something?

> + - Otherwise, git treats the pattern as a shell glob suitable
> +   for consumption by fnmatch(3) with the FNM_PATHNAME flag: any
> +   slash in the pattern must match a slash in the pathname.  For
> +   example, "Documentation/\*.html" matches
> +   "Documentation/git.html" but not "ppc/ppc.html".  A leading
> +   slash matches the beginning of the pathname; for example,
> +   "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".

I realise this is copy&paste but shouldn't that read:
"Documentation/\*.html" matches "Documentation/git.html"
but not "Documentation/ppc/ppc.html"
?

> +Documentation
> +-------------
> +Documentation by Josh Triplett.

No offence again, but given the amount of copy&paste, maybe the names from
git-ls-files should also be added here.

Gruesse,
-- 
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/

^ permalink raw reply

* Re: [mingw port] git plumbing piping with CR/NL
From: Alex Riesen @ 2007-06-01 23:18 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List, Johannes Sixt
In-Reply-To: <fcaeb9bf0706011123ue4ceaf2i12569c63d1d92584@mail.gmail.com>

Nguyen Thai Ngoc Duy, Fri, Jun 01, 2007 20:23:24 +0200:
> Hi,
> 
> I haven't had time looking at the code yet. I report here so that I
> can free my memory for other things. I made a command like this:
> 
> $ git ls-tree -r HEAD|grep blah.cc|git update-index --index-info
> 
> and the output of git-status was:
> 
> $ git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #	new file:   path/to/blah.cc\r
> #
> # Changed but not updated:
> #   (use "git add/rm <file>..." to update what will be committed)
> #
> #	deleted:    path/to/blah.cc\r
> ...
> $ git version
> git version 1.5.2.651.g80e39-dirty (if the commit isn't in the master
> branch, it is based on master branch)
> 
> Apparently git should ignore \r at the end of the path. ...

Why should it? \r is a valid character in filenames almost everywhere
(except for the some proprietary OSes, as usual).

Why does your grep _alters_ the input, instead of filtering it, btw?

^ permalink raw reply

* [PATCH] Make the installation target of git-gui a little less chatty
From: Alex Riesen @ 2007-06-01 23:09 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git, Junio C Hamano
In-Reply-To: <20070601030257.GX7044@spearce.org>

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 git-gui/Makefile |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/git-gui/Makefile b/git-gui/Makefile
index 3de0de1..404bff0 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -2,6 +2,12 @@ all::
 
 # Define V=1 to have a more verbose compile.
 #
+QUIET =
+QUIET_MSG = :
+ifndef V
+    QUIET = @
+    QUIET_MSG = echo '   '
+endif
 
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -109,12 +115,14 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
 all:: $(ALL_PROGRAMS) lib/tclIndex
 
 install: all
-	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
-	$(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
-	$(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
-	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(libdir_SQ)'
-	$(INSTALL) -m644 lib/tclIndex '$(DESTDIR_SQ)$(libdir_SQ)'
-	$(foreach p,$(ALL_LIBFILES), $(INSTALL) -m644 $p '$(DESTDIR_SQ)$(libdir_SQ)' ;)
+	$(QUIET)$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
+	$(QUIET)$(QUIET_MSG)INSTALL git-gui; $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
+	$(QUIET)$(foreach p,$(GITGUI_BUILT_INS),$(QUIET_MSG)INSTALL $p;\
+	    rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && \
+	    ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+	$(QUIET)$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(libdir_SQ)'
+	$(QUIET)$(foreach p,lib/tclIndex $(ALL_LIBFILES), $(QUIET_MSG)INSTALL $p;\
+	    $(INSTALL) -m644 $p '$(DESTDIR_SQ)$(libdir_SQ)' ;)
 
 dist-version:
 	@mkdir -p $(TARDIR)
-- 
1.5.2.162.g8fc0

^ permalink raw reply related

* [PATCH] Make the installation targets a little less chatty
From: Alex Riesen @ 2007-06-01 23:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <81b0412b0706010035s5fc38dc6y6f985675cc3c069@mail.gmail.com>

by default. V=1 works as usual.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 Makefile           |   35 ++++++++++++++++++++++-------------
 templates/Makefile |    5 +++--
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index cac0a4a..f2c9b39 100644
--- a/Makefile
+++ b/Makefile
@@ -660,8 +660,10 @@ ifeq ($(TCLTK_PATH),)
 NO_TCLTK=NoThanks
 endif
 
+QUIET=
 QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
+QUIET_MSG      = :
 
 ifneq ($(findstring $(MAKEFLAGS),w),w)
 PRINT_DIR = --no-print-directory
@@ -671,6 +673,9 @@ endif
 
 ifneq ($(findstring $(MAKEFLAGS),s),s)
 ifndef V
+	QUIET = @
+
+	QUIET_MSG      = echo  '   '
 	QUIET_CC       = @echo '   ' CC $@;
 	QUIET_AR       = @echo '   ' AR $@;
 	QUIET_LINK     = @echo '   ' LINK $@;
@@ -973,33 +978,37 @@ check: common-cmds.h
 ### Installation rules
 
 install: all
-	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)'
-	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
-	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
-	$(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)'
-	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
-	$(MAKE) -C perl prefix='$(prefix_SQ)' install
+	$(QUIET)$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(QUIET)$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
+	$(QUIET)$(foreach p,$(ALL_PROGRAMS),$(QUIET_MSG)INSTALL $p;\
+	    $(INSTALL) '$p' '$(DESTDIR_SQ)$(gitexecdir_SQ)';)
+	$(QUIET)$(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(QUIET)$(foreach p,$(BUILT_INS)   ,$(QUIET_MSG)SETUP BUILTIN $p;\
+	    rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && \
+	    ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
+	$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) DESTDIR='$(DESTDIR_SQ)' install
+	$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) prefix='$(prefix_SQ)' install
 ifndef NO_TCLTK
-	$(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
-	$(MAKE) -C git-gui install
+	$(QUIET)$(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
+	$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) install
 endif
-	if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
+	@if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
 	then \
 		ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \
 		cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
 	fi
-	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
 ifneq (,$X)
-	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
+	@echo cleaning '$(DESTDIR_SQ)$(gitexecdir_SQ)' of old scripts
+	$(QUIET)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
 endif
 
 install-doc:
-	$(MAKE) -C Documentation install
+	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) install
 
 quick-install-doc:
-	$(MAKE) -C Documentation quick-install
+	$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) quick-install
 
 
 
diff --git a/templates/Makefile b/templates/Makefile
index b8352e7..b9a39e2 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -45,6 +45,7 @@ clean:
 	rm -rf blt boilerplates.made
 
 install: all
-	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
-	(cd blt && $(TAR) cf - .) | \
+	@echo installing templates
+	$(QUIET)$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
+	$(QUIET)(cd blt && $(TAR) cf - .) | \
 	(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
-- 
1.5.2.162.g8fc0

^ permalink raw reply related

* Re: [PATCH] gitweb: handle non UTF-8 text
From: Jakub Narebski @ 2007-06-01 21:05 UTC (permalink / raw)
  To: Martin Koegler
  Cc: Petr Baudis, git, Martin Langhoff, Martyn Smith, Robin Rosenberg
In-Reply-To: <20070529215536.GA13250@auto.tuwien.ac.at>

On Tue, 29 May 2007, Martin Koegler wrote:
> On Tue, May 29, 2007 at 11:21:11AM +0200, Jakub Narebski wrote:
>> On Tue, 29 May 2007, Petr Baudis wrote:
>>> On Mon, May 28, 2007 at 10:47:34PM CEST, Martin Koegler wrote:
>> 
>>>> gitweb assumes, that everything is in UTF-8. If a text contains invalid
>>>> UTF-8 character sequences, the text must be in a different encoding.
>> 
>> But it doesn't tell us _what_ is the encoding. For commit messages,
>> with reasonable new git, we have 'encoding' header if git known that
>> commit message was not in utf-8.
>> 
>> By the way, I winder why we don't have such header for tag objects
>> (i18n.tagEncoding ;-)...
> 
> Why do I need to set i18n.commitEncoding on a normal Linux systems?  We
> have a locale, which contains this information. With this, its more
> likely, that the commits can be read correctly later, if somebody
> forget to set "i18n.commitEncoding" in a repository.

Because repository is (or at least can be) _shared_. People working on
the same repository can have set different locale. Web server running
gitweb can have different locale.

>>>> This patch interprets such a text as latin1.
>> 
>> Meaning that it tries to recode text from latin1 (iso-8859-1) to utf-8
>> (not changing gitweb output encoding, which is utf-8).

And this (i.e. what does "interprets" mean) is what should be in the
commit message too.

>> It would be much better, and much easier at least for commit message
>> to add --encoding=utf-8 to git-rev-list / git-log invocation.
> 
> It does not help for old commits, where the encoding was not specified
> correctly. If my research is correct, the encoding handling was
> introduced at the end of 2006 and released this february.

True. But it _can_ help.

>>>> If commit/blob/... is not in UTF-8, it displays the text
>>>> with a very high probability correct. 
>>
>> And I doubt very much about this "very high probability to be
>> correct".
> 
> For normal text, this should be true:
> 
> We can divide ISO-8859-1 into some groups:
> a) 0x00-0x7f: shared with UTF-8
> b) 0x80-0xBF: continuation characters in UTF-8 (0x80-0x9F are control characters/unused)
> c) 0xC0-0xDF: start of a two byte UTF-8 character
> d) 0xE0-0xEF: start of a tree byte UTF-8 character
> e) 0xF0-0xFF: start of other longer UTF-8 sequences
> 
> To misinterpret a ISO-8859-1 text as UTF-8, each character of class
> c/d/e must be followed by the correct number of character of class b.
[cut]
> As gitweb is processing a line of text at once, one UTF-8 compatible
> combinations has no effect, if any other non UTF-8 combatible
> character sequence occurs.

Thanks for the explanation. In short: if characters not shared with UTF-8
(outside US-ASCII), "special characters" occur usually solo, there is
low probability that line in non-UTF-8 encoding will be valid UTF-8.
Which perhaps is valid for German and latin1 aka. iso-8859-1; not
necessarily so for example for Polish and iso-8859-2, see
  zażółć gęsią jaźń
which is perfectly good fragment containing all Polish special
characters, and as you can see those characters occur one after another.
Well, it still could be invalid UTF-8 sequence; what about koi8r and
eucjp (or other non-UTF-8 encoding for Asian languages)?

> But I agree, that there should be the possibilty to choose a the
> fallback encoding.

I think for the beginning it would be enough to have

  # assume this charset if line contains non-UTF-8 characters
  our $fallback_encoding = "latin1";

or something like that (perhaps different wording in the comment,
perhaps different name of the variable) in the gitweb.perl for your
idea to be accepted.

That, and using to_utf8 (as before e3ad95a8) and not my_decode_utf8
as subroutine name. If only it would be possible to avoid I think
quote costly "eval {....}" invocation...


[cut]

There are six sources of possibly non-UTF-8 input: commits, tags,
trees (file names), blobs, gitweb files and results of system calls.

Only first one, commits, comes with encoding specified... if commit
was made with new enough git, and if committer correctly specified
encoding. Commits are read using git-rev-list, which accept --encoding
parameter, so we can convert it easily to utf-8... if git was compiled
with iconv support. It is possible that due to repository, gitweb user
or global configuration (i18n.logOutputEncoding, i18n.commitEncoding)
this is done automatically. On the other hand I think it is easiest
to have accidental wrongly encoded sequence in commit message.

Second one, tags, really _should_ have encoding header like commits.
On the other hand usually the message is version + PGP signature, so
there is no place for any encoding. Tags are read using git-cat-file,
which does not do any encoding/decoding.

Third, filenames in tree objects, "suffers" from git design decision:
for performance and simplicity git stories filenames in tree 'as is',
and relies on the fact that filenames are the same in tree objects,
in the index (dircache), in the filesystem during saving, and as read
from filesystem. Moreover I think that names encoding on filesystem
might depend on filesystem in question and be different from locale
specified encoding (locale is user local, filesystem is global).
On the other hand side one ususually does not use special characters
in filenames because of the problems they cause.

Fourth, blobs (file contents). They can use different encoding than
commit messages; moreover different files can use different encoding.
Encoding has to be specified externally; there is no place for encoding
header in the blob object structure.

Fifth, gitweb files include files read and transformed such as 
GIT_DIR/description file, or projects index file $projects_list,
and files containing fragments of HTML like README.html or header/footer
files.

Sixth, we sometimes have to decode to utf8 results of system calls
like getpwuid to get owner of a file (of a project), or decode to utf8
path (fragment) to the repository.


There are two places to specify gitweb output charset. First is charset
used in HTML output, which is also default charset (binmode) of STDOUT
stream. Gitweb uses utf-8 here, and utf-8 is recommended for XML and for
XHTML by W3C, although we could theoretically add an option to use
different charset by default, and decode (or not) to this charset, instead
of recoding everything (see above) to utf-8.

Second place is default charset for text/plain blob_plain output:
  # default blob_plain mimetype and default charset for text/plain blob
  our $default_blob_plain_mimetype = 'text/plain';
  our $default_text_plain_charset  = undef;
and for other *_plain output written as text/plain; charset=utf-8, and
which is actually dumpled :raw to STDOUT.


So what should be the solution? Add global, per gitweb installation
configureation variables $input_encoding and $fallback_input_encoding?
What do you think? Do you have other ideas?

-- 
Jakub Narebski
Poland

^ permalink raw reply

* [PATCH 3/3] Refresh VERSION file when building distribution tarball in "make dist"
From: Jakub Narebski @ 2007-06-01 16:34 UTC (permalink / raw)
  To: Jonas Fonseca; +Cc: git
In-Reply-To: <20070531131615.GA27044@diku.dk>

Overwrite contents of VERSION file from the HEAD revision with the
current version (at the time of building), so VERSION file in the
tarball generated by "make dist" (and which follows also rpm package
generated by "make rpm") is up to date.

Otherwise for example when building rpm it will be compiled with wrong
version string.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
On Thu, 31 May 2007, Jonas Fonseca wrote:

> Maybe you can test the newly released tig 0.7 tarball?
> 
> Your patch was added as commit 8cdf56913e7e486bb3f527c24ee4a4d19f2a4f61,
> with a few minor adjustments.

One of those changes was using HEAD version of VERSION file in
"make dist", instead of regenerating it and replacing it with the one
containing _current_ version in the tar file.

$ make rpm
sed -e 's/@@VERSION@@/0.7.4.g1995120/g' < tig.spec.in > tig.spec
git-archive --format=tar --prefix=tig-0.7.4.g1995120/ HEAD > tig-0.7.4.g1995120.tar
tar rf tig-0.7.4.g1995120.tar tig-0.7.4.g1995120/tig.spec
gzip -f -9 tig-0.7.4.g1995120.tar
rpmbuild -ta tig-0.7.4.g1995120.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.72336
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.72336
make[1]: Entering directory `/home/local/builddir/BUILD/tig-0.7.4.g1995120'
cc -Wall -O2 '-DVERSION="0.7.git"'    tig.c  -lcurses -o tig
asciidoc -b docbook -d manpage -aversion=0.7.git tig.1.txt
xmlto -m manpage.xsl man tig.1.xml
[...]

Note the mismatch in the versions: 0.7.4.g1995120 vs 0.7.git
(by the way, shouldn't it be 0.7.tig?), even when building from live
repo, and not from tarball.


This is 3rd patch in the series, but it is actually independent on
the rest, and can be applied in any order.

 Makefile |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0e42de6..bc8086f 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,10 @@ dist: tig.spec
 	git-archive --format=tar --prefix=$(TARNAME)/ HEAD > $(TARNAME).tar
 	@mkdir -p $(TARNAME)
 	@cp tig.spec $(TARNAME)
-	tar rf $(TARNAME).tar $(TARNAME)/tig.spec
+	echo $(VERSION) > $(TARNAME)/VERSION
+	tar rf $(TARNAME).tar \
+	       $(TARNAME)/tig.spec \
+	       $(TARNAME)/VERSION
 	@rm -rf $(TARNAME)
 	gzip -f -9 $(TARNAME).tar
 
-- 
1.5.2

^ permalink raw reply related

* [PATCH 1/3] Remove PDF version of manual from being build and installed
From: Jakub Narebski @ 2007-06-01 16:24 UTC (permalink / raw)
  To: Jonas Fonseca; +Cc: git
In-Reply-To: <20070531131615.GA27044@diku.dk>

Because PDF version of "The tig Manual" doesn't offer anything new
that is not present in HTML version, and building PDF requires
additional tools (docbook2pdf) and their dependencies present, remove
it from tig rpm.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Jakub Narebski <jnareb@gmail.com> wrote Wed, May 30, 2007:
> On Tue, 29 May 2007, Jonas Fonseca wrote:
>> Jakub Narebski <jnareb@gmail.com> wrote Mon, May 28, 2007:
>>
>>> I think we can skip generation of manual.pdf, and generate it only on
>>> request (e.g. "make doc-pdf"), or using doc-man and doc-html in place
>>> of doc in the spec file... but this is better left for the next
>>> commit.
>> 
>> Good idea, PDF is not essential and probably suboptimal to either of the
>> HTML versions of the manual.
>
> And it is very easy to implement: just replace 'doc' in make invocation
> in tig.spec.in by the 'doc-man doc-html'.

This patch (commit) does just that.


On Thu, 31 May 2007, Jonas Fonseca wrote:

> I will try to correct this together with the no-PDF doc-building.

I hope we didn't end up duplicating our efforts.

 tig.spec.in |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tig.spec.in b/tig.spec.in
index 2ce6cdb..b7753fd 100644
--- a/tig.spec.in
+++ b/tig.spec.in
@@ -10,7 +10,7 @@ Group: 		Development/Tools
 Vendor: 	Jonas Fonseca <fonseca@diku.dk>
 URL: 		http://jonas.nitro.dk/tig/
 Source: 	http://jonas.nitro.dk/tig/releases/%{name}-%{version}.tar.gz
-BuildRequires: 	ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3, /usr/bin/docbook2pdf}
+BuildRequires: 	ncurses-devel%{!?_without_docs:, xmlto, asciidoc > 6.0.3}
 BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: 	git-core, ncurses
 
@@ -31,7 +31,7 @@ Using it as a pager, it will display input from stdin and colorize it.
 CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}"
 %{__make} %{_smp_mflags} \
 	prefix=%{_prefix} \
-	all %{!?_without_docs: doc}
+	all %{!?_without_docs: doc-man doc-html}
 
 %install
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
@@ -49,8 +49,11 @@ CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}"
 %doc README COPYING INSTALL SITES BUGS TODO tigrc
 %{!?_without_docs: %{_mandir}/man1/*.1*}
 %{!?_without_docs: %{_mandir}/man5/*.5*}
-%{!?_without_docs: %doc *.html *.pdf}
+%{!?_without_docs: %doc *.html}
 
 %changelog
+* Fri Jun  1 2007 Jakub Narebski <jnareb@gmail.com>
+- Remove PDF version of manual from being build and installed
+
 * Mon May 28 2007 Jakub Narebski <jnareb@gmail.com>
 - Initial tig spec file
-- 
1.5.2

^ permalink raw reply related

* [PATCH 2/3] Include documentation sources for rpmbuild with '--without docs'
From: Jakub Narebski @ 2007-06-01 16:27 UTC (permalink / raw)
  To: Jonas Fonseca; +Cc: git
In-Reply-To: <20070531131615.GA27044@diku.dk>

This includes _all_ documentation sources (and not only manual.txt) in
the rpm file build with '--without docs' option.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Jakub Narebski <jnareb@gmail.com> wrote Wed, May 30, 2007:
> On Tue, 29 May 2007, Jonas Fonseca wrote:
>> Jakub Narebski <jnareb@gmail.com> wrote Mon, May 28, 2007:

>> I don't know if manual.txt should perhaps be included if
>> HTML and PDF files will not be generated.
>> 
>>> +%{!?_without_docs: %{_mandir}/man1/*.1*}
>>> +%{!?_without_docs: %{_mandir}/man5/*.5*}
>>> +%{!?_without_docs: %doc *.html *.pdf}
> 
> O.K. It would be as easy as %{?_without_docs: %doc *.txt}

Actually it does add more than manual.txt, it adds sources for
all tig documentation (including manpages).

This patch textually depends on earlier patch, but in fact
thic change is independent on previous one.

 tig.spec.in |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tig.spec.in b/tig.spec.in
index b7753fd..2385fb8 100644
--- a/tig.spec.in
+++ b/tig.spec.in
@@ -1,5 +1,5 @@
 # -*- mode: rpm-spec-mode; encoding: utf-8; -*-
-# Pass '--without docs' to rpmbuild if you don't want the documentation
+# Pass '--without docs' to rpmbuild if you don't want the documentation to be build
 
 Summary: 	Tig: text-mode interface for git
 Name: 		tig
@@ -50,9 +50,11 @@ CFLAGS="$RPM_OPT_FLAGS -DVERSION=tig-%{version}-%{release}"
 %{!?_without_docs: %{_mandir}/man1/*.1*}
 %{!?_without_docs: %{_mandir}/man5/*.5*}
 %{!?_without_docs: %doc *.html}
+%{?_without_docs:  %doc *.txt}
 
 %changelog
 * Fri Jun  1 2007 Jakub Narebski <jnareb@gmail.com>
+- Include documentation sources for --without docs
 - Remove PDF version of manual from being build and installed
 
 * Mon May 28 2007 Jakub Narebski <jnareb@gmail.com>
-- 
1.5.2

^ permalink raw reply related

* [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Josh Triplett @ 2007-06-01 22:20 UTC (permalink / raw)
  To: git; +Cc: 427078, 427078-forwarded

[-- Attachment #1: Type: text/plain, Size: 14302 bytes --]

Only git-ls-files(1) describes the gitignore format in detail, and it does so
with reference to git-ls-files options.  Most users don't use the plumbing
command git-ls-files directly, and shouldn't have to look in its manpage for
information on the gitignore format.

Create a new manpage gitignore(5) (Documentation/gitignore.txt), and factor
out the gitignore documentation into that file, changing it to refer to
.gitignore and $GIT_DIR/info/exclude as used by porcelain commands.  Reference
gitignore(5) from other relevant manpages and documentation.  Remove
now-redundant information on exclude patterns from git-ls-files(1), leaving
only information on how git-ls-files options specify exclude patterns and what
precedence they have.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
 Documentation/Makefile              |    2 +-
 Documentation/config.txt            |    3 +-
 Documentation/git-ls-files.txt      |   99 +++++-----------------------------
 Documentation/git-read-tree.txt     |    3 +-
 Documentation/git-status.txt        |    8 +--
 Documentation/gitignore.txt         |  100 +++++++++++++++++++++++++++++++++++
 Documentation/repository-layout.txt |    3 +-
 Documentation/user-manual.txt       |   12 ++--
 8 files changed, 129 insertions(+), 101 deletions(-)
 create mode 100644 Documentation/gitignore.txt

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3f92783..ef4425c 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -2,7 +2,7 @@ MAN1_TXT= \
 	$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
 		$(wildcard git-*.txt)) \
 	gitk.txt
-MAN5_TXT=gitattributes.txt
+MAN5_TXT=gitattributes.txt gitignore.txt
 MAN7_TXT=git.txt
 
 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 3d8f03d..bb4d6e0 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -259,7 +259,8 @@ Common unit suffixes of 'k', 'm', or 'g' are supported.
 core.excludeFile::
 	In addition to '.gitignore' (per-directory) and
 	'.git/info/exclude', git looks into this file for patterns
-	of files which are not meant to be tracked.
+	of files which are not meant to be tracked.  See
+	gitlink:gitignore[5].
 
 alias.*::
 	Command aliases for the gitlink:git[1] command wrapper - e.g.
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 43e0d22..a78a9ff 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -139,46 +139,24 @@ Exclude Patterns
 
 'git-ls-files' can use a list of "exclude patterns" when
 traversing the directory tree and finding files to show when the
-flags --others or --ignored are specified.
+flags --others or --ignored are specified.  gitlink:gitignore[5]
+specifies the format of exclude patterns.
 
-These exclude patterns come from these places:
+These exclude patterns come from these places, in order:
 
-  1. command line flag --exclude=<pattern> specifies a single
-     pattern.
+  1. The command line flag --exclude=<pattern> specifies a
+     single pattern.  Patterns are ordered in the same order
+     they appear in the command line.
 
-  2. command line flag --exclude-from=<file> specifies a list of
-     patterns stored in a file.
+  2. The command line flag --exclude-from=<file> specifies a
+     file containing a list of patterns.  Patterns are ordered
+     in the same order they appear in the file.
 
   3. command line flag --exclude-per-directory=<name> specifies
      a name of the file in each directory 'git-ls-files'
-     examines, and if exists, its contents are used as an
-     additional list of patterns.
-
-An exclude pattern file used by (2) and (3) contains one pattern
-per line.  A line that starts with a '#' can be used as comment
-for readability.
-
-There are three lists of patterns that are in effect at a given
-time.  They are built and ordered in the following way:
-
- * --exclude=<pattern> from the command line; patterns are
-   ordered in the same order as they appear on the command line.
-
- * lines read from --exclude-from=<file>; patterns are ordered
-   in the same order as they appear in the file.
-
- * When --exclude-per-directory=<name> is specified, upon
-   entering a directory that has such a file, its contents are
-   appended at the end of the current "list of patterns".  They
-   are popped off when leaving the directory.
-
-Each pattern in the pattern list specifies "a match pattern" and
-optionally the fate; either a file that matches the pattern is
-considered excluded or included.  A filename is matched against
-the patterns in the three lists; the --exclude-from list is
-checked first, then the --exclude-per-directory list, and then
-finally the --exclude list. The last match determines its fate.
-If there is no match in the three lists, the fate is "included".
+     examines, normally `.gitignore`.  Files in deeper
+     directories take precedence.  Patterns are ordered in the
+     same order they appear in the files.
 
 A pattern specified on the command line with --exclude or read
 from the file specified with --exclude-from is relative to the
@@ -186,58 +164,9 @@ top of the directory tree.  A pattern read from a file specified
 by --exclude-per-directory is relative to the directory that the
 pattern file appears in.
 
-An exclude pattern is of the following format:
-
- - an optional prefix '!' which means that the fate this pattern
-   specifies is "include", not the usual "exclude"; the
-   remainder of the pattern string is interpreted according to
-   the following rules.
-
- - if it does not contain a slash '/', it is a shell glob
-   pattern and used to match against the filename without
-   leading directories.
-
- - otherwise, it is a shell glob pattern, suitable for
-   consumption by fnmatch(3) with FNM_PATHNAME flag.  I.e. a
-   slash in the pattern must match a slash in the pathname.
-   "Documentation/\*.html" matches "Documentation/git.html" but
-   not "ppc/ppc.html".  As a natural exception, "/*.c" matches
-   "cat-file.c" but not "mozilla-sha1/sha1.c".
-
-An example:
-
---------------------------------------------------------------
-    $ cat .git/info/exclude
-    # ignore objects and archives, anywhere in the tree.
-    *.[oa]
-    $ cat Documentation/.gitignore
-    # ignore generated html files,
-    *.html
-    # except foo.html which is maintained by hand
-    !foo.html
-    $ git-ls-files --ignored \
-        --exclude='Documentation/*.[0-9]' \
-        --exclude-from=.git/info/exclude \
-        --exclude-per-directory=.gitignore
---------------------------------------------------------------
-
-Another example:
-
---------------------------------------------------------------
-    $ cat .gitignore
-    vmlinux*
-    $ ls arch/foo/kernel/vm*
-    arch/foo/kernel/vmlinux.lds.S
-    $ echo '!/vmlinux*' >arch/foo/kernel/.gitignore
---------------------------------------------------------------
-
-The second .gitignore keeps `arch/foo/kernel/vmlinux.lds.S` file
-from getting ignored.
-
-
 See Also
 --------
-gitlink:git-read-tree[1]
+gitlink:git-read-tree[1], gitlink:gitignore[5]
 
 
 Author
@@ -246,7 +175,7 @@ Written by Linus Torvalds <torvalds@osdl.org>
 
 Documentation
 --------------
-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <git@vger.kernel.org>.
 
 GIT
 ---
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 019c8be..acb5744 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -341,7 +341,8 @@ have finished your work-in-progress), attempt the merge again.
 
 See Also
 --------
-gitlink:git-write-tree[1]; gitlink:git-ls-files[1]
+gitlink:git-write-tree[1]; gitlink:git-ls-files[1];
+gitlink:gitignore[5]
 
 
 Author
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d701538..1fd1af1 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -42,11 +42,9 @@ mean the same thing and the latter is kept for backward
 compatibility) and `color.status.<slot>` configuration variables
 to colorize its output.
 
-As for gitlink:git-add[1], the configuration variable
-'core.excludesfile' can indicate a path to a file containing patterns
-of file names to exclude, in addition to patterns given in
-'info/exclude' and '.gitignore'.
-
+See Also
+--------
+gitlink:gitignore[5]
 
 Author
 ------
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
new file mode 100644
index 0000000..190bd9f
--- /dev/null
+++ b/Documentation/gitignore.txt
@@ -0,0 +1,100 @@
+gitignore(5)
+============
+
+NAME
+----
+gitignore - Specifies intentionally untracked files to ignore
+
+SYNOPSIS
+--------
+$GIT_DIR/info/exclude, .gitignore
+
+DESCRIPTION
+-----------
+
+A `gitignore` file specifies intentionally untracked files that
+git should ignore.  Each line in a `gitignore` file specifies a
+pattern.
+
+When deciding whether to ignore a path, git normally checks
+`gitignore` patterns from multiple sources, with the following
+order of precedence:
+
+ * Patterns read from the file specified by the configuration
+   variable 'core.excludesfile'.
+
+ * Patterns read from `$GIT_DIR/info/exclude`.
+
+ * Patterns read from a `.gitignore` file in the same directory
+   as the path, or in any parent directory, ordered from the
+   deepest such file to a file in the root of the repository.
+   These patterns match relative to the location of the
+   `.gitignore` file.  A project normally includes such
+   `.gitignore` files in its repository, containing patterns for
+   files generated as part of the project build.
+
+Some git plumbing tools, such as git-ls-files(1) and
+git-read-tree(1), read `gitignore` patterns specified by
+command-line options, or from files specified by command-line
+options.
+
+Patterns have the following format:
+
+ - A blank line matches no files, so it can serve as a separator
+   for readability.
+
+ - A line starting with # 
+
+ - An optional prefix '!' which negates the pattern; any
+   matching file excluded by a previous pattern will become
+   included again.
+
+ - If the pattern does not contain a slash '/', git treats it as
+   a shell glob pattern and checks for a match against the
+   pathname without leading directories.
+
+ - Otherwise, git treats the pattern as a shell glob suitable
+   for consumption by fnmatch(3) with the FNM_PATHNAME flag: any
+   slash in the pattern must match a slash in the pathname.  For
+   example, "Documentation/\*.html" matches
+   "Documentation/git.html" but not "ppc/ppc.html".  A leading
+   slash matches the beginning of the pathname; for example,
+   "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
+
+An example:
+
+--------------------------------------------------------------
+    $ cat .git/info/exclude
+    # ignore objects and archives, anywhere in the tree.
+    *.[oa]
+    $ cat Documentation/.gitignore
+    # ignore generated html files,
+    *.html
+    # except foo.html which is maintained by hand
+    !foo.html
+    $ git-ls-files --ignored \
+        --exclude='Documentation/*.[0-9]' \
+        --exclude-from=.git/info/exclude \
+        --exclude-per-directory=.gitignore
+--------------------------------------------------------------
+
+Another example:
+
+--------------------------------------------------------------
+    $ cat .gitignore
+    vmlinux*
+    $ ls arch/foo/kernel/vm*
+    arch/foo/kernel/vmlinux.lds.S
+    $ echo '!/vmlinux*' >arch/foo/kernel/.gitignore
+--------------------------------------------------------------
+
+The second .gitignore prevents git from ignoring
+`arch/foo/kernel/vmlinux.lds.S`.
+
+Documentation
+-------------
+Documentation by Josh Triplett.
+
+GIT
+---
+Part of the gitlink:git[7] suite
diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt
index 0459bd9..15221b5 100644
--- a/Documentation/repository-layout.txt
+++ b/Documentation/repository-layout.txt
@@ -155,8 +155,7 @@ info/exclude::
 	exclude pattern list. `.gitignore` is the per-directory
 	ignore file.  `git status`, `git add`, `git rm` and `git
 	clean` look at it but the core git commands do not look
-	at it.  See also: gitlink:git-ls-files[1] `--exclude-from`
-	and `--exclude-per-directory`.
+	at it.  See also: gitlink:gitignore[5].
 
 remotes::
 	Stores shorthands to be used to give URL and default
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index 4fabb8e..7eaafa8 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -1103,12 +1103,12 @@ showing up in the output of "`git status`", etc.
 
 Git therefore provides "exclude patterns" for telling git which files to
 actively ignore. Exclude patterns are thoroughly explained in the
-"Exclude Patterns" section of the gitlink:git-ls-files[1] manual page,
-but the heart of the concept is simply a list of files which git should
-ignore. Entries in the list may contain globs to specify multiple files,
-or may be prefixed by "`!`" to explicitly include (un-ignore) a previously
-excluded (ignored) file (i.e. later exclude patterns override earlier ones).
-The following example should illustrate such patterns:
+gitlink:gitignore[5] manual page, but the heart of the concept is simply
+a list of files which git should ignore. Entries in the list may contain
+globs to specify multiple files, or may be prefixed by "`!`" to
+explicitly include (un-ignore) a previously excluded (ignored) file
+(i.e. later exclude patterns override earlier ones).  The following
+example should illustrate such patterns:
 
 -------------------------------------------------
 # Lines starting with '#' are considered comments.
-- 
1.5.2



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply related

* Re: [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Josh Triplett @ 2007-06-01 22:18 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, 427078, 427078-forwarded
In-Reply-To: <7vtztrxs8r.fsf@assigned-by-dhcp.cox.net>

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

Junio C Hamano wrote:
> Josh Triplett <josh@freedesktop.org> writes:
> 
> Thanks, but shouldn't all the in-text mention of "gitignore(5)"
> and friends, not just in "See Also" section, use
> "gitlink:gitignore[5]" instead?

Yes, thanks.  I followed some other example that didn't do that.

New patch momentarily.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply

* Re: [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Junio C Hamano @ 2007-06-01 21:46 UTC (permalink / raw)
  To: Josh Triplett; +Cc: git, 427078, 427078-forwarded
In-Reply-To: <4660866B.7000304@freedesktop.org>

Josh Triplett <josh@freedesktop.org> writes:

Thanks, but shouldn't all the in-text mention of "gitignore(5)"
and friends, not just in "See Also" section, use
"gitlink:gitignore[5]" instead?

^ permalink raw reply

* Re: [PATCH] Use =20 when rfc2047 encoding spaces.
From: Jeffrey C. Ollie @ 2007-06-01 21:12 UTC (permalink / raw)
  To: git
In-Reply-To: <11807320922292-git-send-email-hoegsberg@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On Fri, 2007-06-01 at 17:08 -0400, Kristian Høgsberg wrote:
>
> -		if (is_rfc2047_special(ch)) {
> +		/* We encode ' ' using '=20' even though rfc2047
> +		 * allows using '_' for readability.  Unfortunately,
> +		 * doesn't understand this and just leaves the
> +		 * underscore in place. */
> +		if (is_rfc2047_special(ch) || ch == ' ') {

Looks like "much software" got left out of the comment.

Jeff


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] Use =20 when rfc2047 encoding spaces.
From: Kristian Høgsberg @ 2007-06-01 21:08 UTC (permalink / raw)
  To: git; +Cc: Kristian Høgsberg

Encode ' ' using '=20' even though rfc2047 allows using '_' for
readability.  Unfortunately, much software doesn't understand this and just
leaves the underscore in place.  Using '=20' seems to work better.

Signed-off-by: Kristian Høgsberg <hoegsberg@gmail.com>
---
 commit.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/commit.c b/commit.c
index bee066f..92b46f1 100644
--- a/commit.c
+++ b/commit.c
@@ -511,12 +511,14 @@ static int add_rfc2047(char *buf, const char *line, int len,
 	bp += i;
 	for (i = 0; i < len; i++) {
 		unsigned ch = line[i] & 0xFF;
-		if (is_rfc2047_special(ch)) {
+		/* We encode ' ' using '=20' even though rfc2047
+		 * allows using '_' for readability.  Unfortunately,
+		 * doesn't understand this and just leaves the
+		 * underscore in place. */
+		if (is_rfc2047_special(ch) || ch == ' ') {
 			sprintf(bp, "=%02X", ch);
 			bp += 3;
 		}
-		else if (ch == ' ')
-			*bp++ = '_';
 		else
 			*bp++ = ch;
 	}
-- 
1.5.0.6

^ permalink raw reply related

* Re: [PATCH] Unify write_index_file functions
From: Nicolas Pitre @ 2007-06-01 21:01 UTC (permalink / raw)
  To: Dana How; +Cc: Geert Bosch, git Mailing List
In-Reply-To: <56b7f5510706011316v6e4c6f9fj33ae61f0b30f1772@mail.gmail.com>

On Fri, 1 Jun 2007, Dana How wrote:

> (2) write_idx_file has a sha1 argument with different in & out meanings,
> requiring copies at some call sites.  Should this be 2 separate args?

I think the copy could be avoided entirely.  The pack_file_sha1 array 
doesn't need to have global scope.  The simple sha1[20] array with this 
patch can serve the pack_file_sha1 purpose as well just fine.


Nicolas

^ permalink raw reply

* Re: [PATCH] Unify write_index_file functions
From: Nicolas Pitre @ 2007-06-01 20:54 UTC (permalink / raw)
  To: Geert Bosch; +Cc: git Mailing List
In-Reply-To: <20070601194856.66DFB4D7206@potomac.gnat.com>

On Fri, 1 Jun 2007, Geert Bosch wrote:

> This patch creates a new pack-idx.c file containing a unified version of
> the write_index_file functions in builtin-pack-objects.c and index-pack.c.
> As the name "index" is overloaded in git, move in the direction
> of using "idx" and "pack idx" when refering to the pack index.
> There should be no change in functionality.

I intended to do exactly that (I even mentioned it in 81a216a5d6) but 
I'm glad you beat me to it.

A few comments.

Please use   pack-write.c rather than a new file.  This   pack-write.c 
was created exactly to gather common pack writing tasks.

Please also consider removing the pack index writing code from 
fast-import.c as well.

> @@ -24,9 +24,10 @@ git-pack-objects [{ -q | --progress | --all-progress }] [--max-pack-size=N] \n\
>  
>  struct object_entry {
>  	unsigned char sha1[20];
> -	uint32_t crc32;		/* crc of raw pack data for this object */
>  	off_t offset;		/* offset into the final pack file */
>  	unsigned long size;	/* uncompressed size */
> +	uint32_t crc32;		/* crc of raw pack data for this object */

Don't do this.  The crc32 field was carefully placed so the offset field 
is 64-bit aligned with no need for any padding.

In fact, those 3 fields should probably be defined in a structure of 
their own rather than hoping that no one will fail to change the 
ordering in all places.

Other than that it looks pretty good.


Nicolas


Nicolas

^ permalink raw reply

* [PATCH] Create a new manpage for the gitignore format, and reference it elsewhere
From: Josh Triplett @ 2007-06-01 20:49 UTC (permalink / raw)
  To: git; +Cc: 427078, 427078-forwarded

[-- Attachment #1: Type: text/plain, Size: 11515 bytes --]

Only git-ls-files(1) describes the gitignore format in detail, and it does so
with reference to git-ls-files options.  Most users don't use the plumbing
command git-ls-files directly, and shouldn't have to look in its manpage for
information on the gitignore format.

Create a new manpage gitignore(5) (Documentation/gitignore.txt), and factor
out the gitignore documentation into that file, changing it to refer to
.gitignore and $GIT_DIR/info/exclude as used by porcelain commands.  Reference
gitignore(5) from other relevant manpages.  Remove now-redundant information
on exclude patterns from git-ls-files(1), leaving only information on how
git-ls-files options specify exclude patterns and what precedence they have.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
 Documentation/Makefile          |    2 +-
 Documentation/git-ls-files.txt  |   99 +++++---------------------------------
 Documentation/git-read-tree.txt |    3 +-
 Documentation/git-status.txt    |    8 +--
 Documentation/gitignore.txt     |  100 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 120 insertions(+), 92 deletions(-)
 create mode 100644 Documentation/gitignore.txt

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3f92783..ef4425c 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -2,7 +2,7 @@ MAN1_TXT= \
 	$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
 		$(wildcard git-*.txt)) \
 	gitk.txt
-MAN5_TXT=gitattributes.txt
+MAN5_TXT=gitattributes.txt gitignore.txt
 MAN7_TXT=git.txt
 
 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT))
diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt
index 43e0d22..62d8739 100644
--- a/Documentation/git-ls-files.txt
+++ b/Documentation/git-ls-files.txt
@@ -139,46 +139,24 @@ Exclude Patterns
 
 'git-ls-files' can use a list of "exclude patterns" when
 traversing the directory tree and finding files to show when the
-flags --others or --ignored are specified.
+flags --others or --ignored are specified.  gitignore(5)
+specifies the format of exclude patterns.
 
-These exclude patterns come from these places:
+These exclude patterns come from these places, in order:
 
-  1. command line flag --exclude=<pattern> specifies a single
-     pattern.
+  1. The command line flag --exclude=<pattern> specifies a
+     single pattern.  Patterns are ordered in the same order
+     they appear in the command line.
 
-  2. command line flag --exclude-from=<file> specifies a list of
-     patterns stored in a file.
+  2. The command line flag --exclude-from=<file> specifies a
+     file containing a list of patterns.  Patterns are ordered
+     in the same order they appear in the file.
 
   3. command line flag --exclude-per-directory=<name> specifies
      a name of the file in each directory 'git-ls-files'
-     examines, and if exists, its contents are used as an
-     additional list of patterns.
-
-An exclude pattern file used by (2) and (3) contains one pattern
-per line.  A line that starts with a '#' can be used as comment
-for readability.
-
-There are three lists of patterns that are in effect at a given
-time.  They are built and ordered in the following way:
-
- * --exclude=<pattern> from the command line; patterns are
-   ordered in the same order as they appear on the command line.
-
- * lines read from --exclude-from=<file>; patterns are ordered
-   in the same order as they appear in the file.
-
- * When --exclude-per-directory=<name> is specified, upon
-   entering a directory that has such a file, its contents are
-   appended at the end of the current "list of patterns".  They
-   are popped off when leaving the directory.
-
-Each pattern in the pattern list specifies "a match pattern" and
-optionally the fate; either a file that matches the pattern is
-considered excluded or included.  A filename is matched against
-the patterns in the three lists; the --exclude-from list is
-checked first, then the --exclude-per-directory list, and then
-finally the --exclude list. The last match determines its fate.
-If there is no match in the three lists, the fate is "included".
+     examines, normally `.gitignore`.  Files in deeper
+     directories take precedence.  Patterns are ordered in the
+     same order they appear in the files.
 
 A pattern specified on the command line with --exclude or read
 from the file specified with --exclude-from is relative to the
@@ -186,58 +164,9 @@ top of the directory tree.  A pattern read from a file specified
 by --exclude-per-directory is relative to the directory that the
 pattern file appears in.
 
-An exclude pattern is of the following format:
-
- - an optional prefix '!' which means that the fate this pattern
-   specifies is "include", not the usual "exclude"; the
-   remainder of the pattern string is interpreted according to
-   the following rules.
-
- - if it does not contain a slash '/', it is a shell glob
-   pattern and used to match against the filename without
-   leading directories.
-
- - otherwise, it is a shell glob pattern, suitable for
-   consumption by fnmatch(3) with FNM_PATHNAME flag.  I.e. a
-   slash in the pattern must match a slash in the pathname.
-   "Documentation/\*.html" matches "Documentation/git.html" but
-   not "ppc/ppc.html".  As a natural exception, "/*.c" matches
-   "cat-file.c" but not "mozilla-sha1/sha1.c".
-
-An example:
-
---------------------------------------------------------------
-    $ cat .git/info/exclude
-    # ignore objects and archives, anywhere in the tree.
-    *.[oa]
-    $ cat Documentation/.gitignore
-    # ignore generated html files,
-    *.html
-    # except foo.html which is maintained by hand
-    !foo.html
-    $ git-ls-files --ignored \
-        --exclude='Documentation/*.[0-9]' \
-        --exclude-from=.git/info/exclude \
-        --exclude-per-directory=.gitignore
---------------------------------------------------------------
-
-Another example:
-
---------------------------------------------------------------
-    $ cat .gitignore
-    vmlinux*
-    $ ls arch/foo/kernel/vm*
-    arch/foo/kernel/vmlinux.lds.S
-    $ echo '!/vmlinux*' >arch/foo/kernel/.gitignore
---------------------------------------------------------------
-
-The second .gitignore keeps `arch/foo/kernel/vmlinux.lds.S` file
-from getting ignored.
-
-
 See Also
 --------
-gitlink:git-read-tree[1]
+gitlink:git-read-tree[1], gitlink:gitignore[5]
 
 
 Author
@@ -246,7 +175,7 @@ Written by Linus Torvalds <torvalds@osdl.org>
 
 Documentation
 --------------
-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <git@vger.kernel.org>.
 
 GIT
 ---
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 019c8be..acb5744 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -341,7 +341,8 @@ have finished your work-in-progress), attempt the merge again.
 
 See Also
 --------
-gitlink:git-write-tree[1]; gitlink:git-ls-files[1]
+gitlink:git-write-tree[1]; gitlink:git-ls-files[1];
+gitlink:gitignore[5]
 
 
 Author
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index d701538..1fd1af1 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -42,11 +42,9 @@ mean the same thing and the latter is kept for backward
 compatibility) and `color.status.<slot>` configuration variables
 to colorize its output.
 
-As for gitlink:git-add[1], the configuration variable
-'core.excludesfile' can indicate a path to a file containing patterns
-of file names to exclude, in addition to patterns given in
-'info/exclude' and '.gitignore'.
-
+See Also
+--------
+gitlink:gitignore[5]
 
 Author
 ------
diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
new file mode 100644
index 0000000..190bd9f
--- /dev/null
+++ b/Documentation/gitignore.txt
@@ -0,0 +1,100 @@
+gitignore(5)
+============
+
+NAME
+----
+gitignore - Specifies intentionally untracked files to ignore
+
+SYNOPSIS
+--------
+$GIT_DIR/info/exclude, .gitignore
+
+DESCRIPTION
+-----------
+
+A `gitignore` file specifies intentionally untracked files that
+git should ignore.  Each line in a `gitignore` file specifies a
+pattern.
+
+When deciding whether to ignore a path, git normally checks
+`gitignore` patterns from multiple sources, with the following
+order of precedence:
+
+ * Patterns read from the file specified by the configuration
+   variable 'core.excludesfile'.
+
+ * Patterns read from `$GIT_DIR/info/exclude`.
+
+ * Patterns read from a `.gitignore` file in the same directory
+   as the path, or in any parent directory, ordered from the
+   deepest such file to a file in the root of the repository.
+   These patterns match relative to the location of the
+   `.gitignore` file.  A project normally includes such
+   `.gitignore` files in its repository, containing patterns for
+   files generated as part of the project build.
+
+Some git plumbing tools, such as git-ls-files(1) and
+git-read-tree(1), read `gitignore` patterns specified by
+command-line options, or from files specified by command-line
+options.
+
+Patterns have the following format:
+
+ - A blank line matches no files, so it can serve as a separator
+   for readability.
+
+ - A line starting with # 
+
+ - An optional prefix '!' which negates the pattern; any
+   matching file excluded by a previous pattern will become
+   included again.
+
+ - If the pattern does not contain a slash '/', git treats it as
+   a shell glob pattern and checks for a match against the
+   pathname without leading directories.
+
+ - Otherwise, git treats the pattern as a shell glob suitable
+   for consumption by fnmatch(3) with the FNM_PATHNAME flag: any
+   slash in the pattern must match a slash in the pathname.  For
+   example, "Documentation/\*.html" matches
+   "Documentation/git.html" but not "ppc/ppc.html".  A leading
+   slash matches the beginning of the pathname; for example,
+   "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
+
+An example:
+
+--------------------------------------------------------------
+    $ cat .git/info/exclude
+    # ignore objects and archives, anywhere in the tree.
+    *.[oa]
+    $ cat Documentation/.gitignore
+    # ignore generated html files,
+    *.html
+    # except foo.html which is maintained by hand
+    !foo.html
+    $ git-ls-files --ignored \
+        --exclude='Documentation/*.[0-9]' \
+        --exclude-from=.git/info/exclude \
+        --exclude-per-directory=.gitignore
+--------------------------------------------------------------
+
+Another example:
+
+--------------------------------------------------------------
+    $ cat .gitignore
+    vmlinux*
+    $ ls arch/foo/kernel/vm*
+    arch/foo/kernel/vmlinux.lds.S
+    $ echo '!/vmlinux*' >arch/foo/kernel/.gitignore
+--------------------------------------------------------------
+
+The second .gitignore prevents git from ignoring
+`arch/foo/kernel/vmlinux.lds.S`.
+
+Documentation
+-------------
+Documentation by Josh Triplett.
+
+GIT
+---
+Part of the gitlink:git[7] suite
-- 
1.5.2



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply related

* Re: [PATCH] Unify write_index_file functions
From: Dana How @ 2007-06-01 20:16 UTC (permalink / raw)
  To: Geert Bosch; +Cc: git Mailing List, danahow
In-Reply-To: <20070601194856.66DFB4D7206@potomac.gnat.com>

Good stuff.  3 minor issues:

(1) Shawn named the new file containing common pack-writing
functions "pack-write.c"; in that spirit should your new file be "idx-write.c" ?

(2) write_idx_file has a sha1 argument with different in & out meanings,
requiring copies at some call sites.  Should this be 2 separate args?

(3) 2 files now have definitions of "struct object_entry" with no indications
that the first 4 fields should be the same as "struct idx_object_entry".
Please add at least some comments to the former (this is the only
thing I care strongly about here).  Better would be putting an idx_object_entry
as the first field in the object_entry's, but that would result in a lot
of trivial changes and could be done later.

Thanks!

Dana

On 6/1/07, Geert Bosch <bosch@gnat.com> wrote:
> This patch creates a new pack-idx.c file containing a unified version of
> the write_index_file functions in builtin-pack-objects.c and index-pack.c.
> As the name "index" is overloaded in git, move in the direction
> of using "idx" and "pack idx" when refering to the pack index.
> There should be no change in functionality.
>
> Signed-off-by: Geert Bosch <bosch@gnat.com>
> ---
>  Makefile               |    3 +-
>  builtin-pack-objects.c |  143 ++++--------------------------------------
>  index-pack.c           |  161 +++++-------------------------------------------
>  pack-idx.c             |  144 +++++++++++++++++++++++++++++++++++++++++++
>  pack.h                 |   15 +++++
>  5 files changed, 190 insertions(+), 276 deletions(-)
>  create mode 100644 pack-idx.c
>
> diff --git a/Makefile b/Makefile
> index 7527734..8e89cda 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -310,7 +310,8 @@ LIB_OBJS = \
>         interpolate.o \
>         lockfile.o \
>         patch-ids.o \
> -       object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \
> +       object.o pack-check.o pack-idx.o pack-write.o \
> +       patch-delta.o path.o pkt-line.o \
>         sideband.o reachable.o reflog-walk.o \
>         quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \
>         server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index e52332d..d4c5d2b 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -24,9 +24,10 @@ git-pack-objects [{ -q | --progress | --all-progress }] [--max-pack-size=N] \n\
>
>  struct object_entry {
>         unsigned char sha1[20];
> -       uint32_t crc32;         /* crc of raw pack data for this object */
>         off_t offset;           /* offset into the final pack file */
>         unsigned long size;     /* uncompressed size */
> +       uint32_t crc32;         /* crc of raw pack data for this object */
> +
>         unsigned int hash;      /* name hint hash */
>         unsigned int depth;     /* delta depth */
>         struct packed_git *in_pack;     /* already in pack */
> @@ -584,8 +585,7 @@ static int open_object_dir_tmp(const char *path)
>      return mkstemp(tmpname);
>  }
>
> -/* forward declarations for write_pack_file */
> -static void write_index_file(off_t last_obj_offset, unsigned char *sha1);
> +/* forward declaration for write_pack_file */
>  static int adjust_perm(const char *path, mode_t mode);
>
>  static void write_pack_file(void)
> @@ -641,15 +641,17 @@ static void write_pack_file(void)
>                 }
>
>                 if (!pack_to_stdout) {
> -                       unsigned char object_list_sha1[20];
> +                       unsigned char sha1[20];
>                         mode_t mode = umask(0);
>
>                         umask(mode);
>                         mode = 0444 & ~mode;
>
> -                       write_index_file(last_obj_offset, object_list_sha1);
> +                       hashcpy(sha1, pack_file_sha1);
> +                       idx_tmp_name = write_idx_file(NULL,
> +                               (struct idx_object_entry **) written_list, nr_written, sha1);
>                         snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
> -                                base_name, sha1_to_hex(object_list_sha1));
> +                                base_name, sha1_to_hex(sha1));
>                         if (adjust_perm(pack_tmp_name, mode))
>                                 die("unable to make temporary pack file readable: %s",
>                                     strerror(errno));
> @@ -657,14 +659,14 @@ static void write_pack_file(void)
>                                 die("unable to rename temporary pack file: %s",
>                                     strerror(errno));
>                         snprintf(tmpname, sizeof(tmpname), "%s-%s.idx",
> -                                base_name, sha1_to_hex(object_list_sha1));
> +                                base_name, sha1_to_hex(sha1));
>                         if (adjust_perm(idx_tmp_name, mode))
>                                 die("unable to make temporary index file readable: %s",
>                                     strerror(errno));
>                         if (rename(idx_tmp_name, tmpname))
>                                 die("unable to rename temporary index file: %s",
>                                     strerror(errno));
> -                       puts(sha1_to_hex(object_list_sha1));
> +                       puts(sha1_to_hex(sha1));
>                 }
>
>                 /* mark written objects as written to previous pack */
> @@ -693,123 +695,6 @@ static void write_pack_file(void)
>                 die("wrote %u objects as expected but %u unwritten", written, j);
>  }
>
> -static int sha1_sort(const void *_a, const void *_b)
> -{
> -       const struct object_entry *a = *(struct object_entry **)_a;
> -       const struct object_entry *b = *(struct object_entry **)_b;
> -       return hashcmp(a->sha1, b->sha1);
> -}
> -
> -static uint32_t index_default_version = 1;
> -static uint32_t index_off32_limit = 0x7fffffff;
> -
> -static void write_index_file(off_t last_obj_offset, unsigned char *sha1)
> -{
> -       struct sha1file *f;
> -       struct object_entry **sorted_by_sha, **list, **last;
> -       uint32_t array[256];
> -       uint32_t i, index_version;
> -       SHA_CTX ctx;
> -
> -       int fd = open_object_dir_tmp("tmp_idx_XXXXXX");
> -       if (fd < 0)
> -               die("unable to create %s: %s\n", tmpname, strerror(errno));
> -       idx_tmp_name = xstrdup(tmpname);
> -       f = sha1fd(fd, idx_tmp_name);
> -
> -       if (nr_written) {
> -               sorted_by_sha = written_list;
> -               qsort(sorted_by_sha, nr_written, sizeof(*sorted_by_sha), sha1_sort);
> -               list = sorted_by_sha;
> -               last = sorted_by_sha + nr_written;
> -       } else
> -               sorted_by_sha = list = last = NULL;
> -
> -       /* if last object's offset is >= 2^31 we should use index V2 */
> -       index_version = (last_obj_offset >> 31) ? 2 : index_default_version;
> -
> -       /* index versions 2 and above need a header */
> -       if (index_version >= 2) {
> -               struct pack_idx_header hdr;
> -               hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
> -               hdr.idx_version = htonl(index_version);
> -               sha1write(f, &hdr, sizeof(hdr));
> -       }
> -
> -       /*
> -        * Write the first-level table (the list is sorted,
> -        * but we use a 256-entry lookup to be able to avoid
> -        * having to do eight extra binary search iterations).
> -        */
> -       for (i = 0; i < 256; i++) {
> -               struct object_entry **next = list;
> -               while (next < last) {
> -                       struct object_entry *entry = *next;
> -                       if (entry->sha1[0] != i)
> -                               break;
> -                       next++;
> -               }
> -               array[i] = htonl(next - sorted_by_sha);
> -               list = next;
> -       }
> -       sha1write(f, array, 256 * 4);
> -
> -       /* Compute the SHA1 hash of sorted object names. */
> -       SHA1_Init(&ctx);
> -
> -       /* Write the actual SHA1 entries. */
> -       list = sorted_by_sha;
> -       for (i = 0; i < nr_written; i++) {
> -               struct object_entry *entry = *list++;
> -               if (index_version < 2) {
> -                       uint32_t offset = htonl(entry->offset);
> -                       sha1write(f, &offset, 4);
> -               }
> -               sha1write(f, entry->sha1, 20);
> -               SHA1_Update(&ctx, entry->sha1, 20);
> -       }
> -
> -       if (index_version >= 2) {
> -               unsigned int nr_large_offset = 0;
> -
> -               /* write the crc32 table */
> -               list = sorted_by_sha;
> -               for (i = 0; i < nr_written; i++) {
> -                       struct object_entry *entry = *list++;
> -                       uint32_t crc32_val = htonl(entry->crc32);
> -                       sha1write(f, &crc32_val, 4);
> -               }
> -
> -               /* write the 32-bit offset table */
> -               list = sorted_by_sha;
> -               for (i = 0; i < nr_written; i++) {
> -                       struct object_entry *entry = *list++;
> -                       uint32_t offset = (entry->offset <= index_off32_limit) ?
> -                               entry->offset : (0x80000000 | nr_large_offset++);
> -                       offset = htonl(offset);
> -                       sha1write(f, &offset, 4);
> -               }
> -
> -               /* write the large offset table */
> -               list = sorted_by_sha;
> -               while (nr_large_offset) {
> -                       struct object_entry *entry = *list++;
> -                       uint64_t offset = entry->offset;
> -                       if (offset > index_off32_limit) {
> -                               uint32_t split[2];
> -                               split[0]        = htonl(offset >> 32);
> -                               split[1] = htonl(offset & 0xffffffff);
> -                               sha1write(f, split, 8);
> -                               nr_large_offset--;
> -                       }
> -               }
> -       }
> -
> -       sha1write(f, pack_file_sha1, 20);
> -       sha1close(f, NULL, 1);
> -       SHA1_Final(sha1, &ctx);
> -}
> -
>  static int locate_object_entry_hash(const unsigned char *sha1)
>  {
>         int i;
> @@ -1825,12 +1710,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
>                 }
>                 if (!prefixcmp(arg, "--index-version=")) {
>                         char *c;
> -                       index_default_version = strtoul(arg + 16, &c, 10);
> -                       if (index_default_version > 2)
> +                       pack_idx_default_version = strtoul(arg + 16, &c, 10);
> +                       if (pack_idx_default_version > 2)
>                                 die("bad %s", arg);
>                         if (*c == ',')
> -                               index_off32_limit = strtoul(c+1, &c, 0);
> -                       if (*c || index_off32_limit & 0x80000000)
> +                               pack_idx_off32_limit = strtoul(c+1, &c, 0);
> +                       if (*c || pack_idx_off32_limit & 0x80000000)
>                                 die("bad %s", arg);
>                         continue;
>                 }
> diff --git a/index-pack.c b/index-pack.c
> index 58c4a9c..ed6ff9c 100644
> --- a/index-pack.c
> +++ b/index-pack.c
> @@ -13,13 +13,14 @@ static const char index_pack_usage[] =
>
>  struct object_entry
>  {
> +       unsigned char sha1[20];
>         off_t offset;
>         unsigned long size;
> -       unsigned int hdr_size;
>         uint32_t crc32;
> +
> +       unsigned int hdr_size;
>         enum object_type type;
>         enum object_type real_type;
> -       unsigned char sha1[20];
>  };
>
>  union delta_base {
> @@ -602,145 +603,6 @@ static void fix_unresolved_deltas(int nr_unresolved)
>         free(sorted_by_pos);
>  }
>
> -static uint32_t index_default_version = 1;
> -static uint32_t index_off32_limit = 0x7fffffff;
> -
> -static int sha1_compare(const void *_a, const void *_b)
> -{
> -       struct object_entry *a = *(struct object_entry **)_a;
> -       struct object_entry *b = *(struct object_entry **)_b;
> -       return hashcmp(a->sha1, b->sha1);
> -}
> -
> -/*
> - * On entry *sha1 contains the pack content SHA1 hash, on exit it is
> - * the SHA1 hash of sorted object names.
> - */
> -static const char *write_index_file(const char *index_name, unsigned char *sha1)
> -{
> -       struct sha1file *f;
> -       struct object_entry **sorted_by_sha, **list, **last;
> -       uint32_t array[256];
> -       int i, fd;
> -       SHA_CTX ctx;
> -       uint32_t index_version;
> -
> -       if (nr_objects) {
> -               sorted_by_sha =
> -                       xcalloc(nr_objects, sizeof(struct object_entry *));
> -               list = sorted_by_sha;
> -               last = sorted_by_sha + nr_objects;
> -               for (i = 0; i < nr_objects; ++i)
> -                       sorted_by_sha[i] = &objects[i];
> -               qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
> -                     sha1_compare);
> -       }
> -       else
> -               sorted_by_sha = list = last = NULL;
> -
> -       if (!index_name) {
> -               static char tmpfile[PATH_MAX];
> -               snprintf(tmpfile, sizeof(tmpfile),
> -                        "%s/tmp_idx_XXXXXX", get_object_directory());
> -               fd = mkstemp(tmpfile);
> -               index_name = xstrdup(tmpfile);
> -       } else {
> -               unlink(index_name);
> -               fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
> -       }
> -       if (fd < 0)
> -               die("unable to create %s: %s", index_name, strerror(errno));
> -       f = sha1fd(fd, index_name);
> -
> -       /* if last object's offset is >= 2^31 we should use index V2 */
> -       index_version = (objects[nr_objects-1].offset >> 31) ? 2 : index_default_version;
> -
> -       /* index versions 2 and above need a header */
> -       if (index_version >= 2) {
> -               struct pack_idx_header hdr;
> -               hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
> -               hdr.idx_version = htonl(index_version);
> -               sha1write(f, &hdr, sizeof(hdr));
> -       }
> -
> -       /*
> -        * Write the first-level table (the list is sorted,
> -        * but we use a 256-entry lookup to be able to avoid
> -        * having to do eight extra binary search iterations).
> -        */
> -       for (i = 0; i < 256; i++) {
> -               struct object_entry **next = list;
> -               while (next < last) {
> -                       struct object_entry *obj = *next;
> -                       if (obj->sha1[0] != i)
> -                               break;
> -                       next++;
> -               }
> -               array[i] = htonl(next - sorted_by_sha);
> -               list = next;
> -       }
> -       sha1write(f, array, 256 * 4);
> -
> -       /* compute the SHA1 hash of sorted object names. */
> -       SHA1_Init(&ctx);
> -
> -       /*
> -        * Write the actual SHA1 entries..
> -        */
> -       list = sorted_by_sha;
> -       for (i = 0; i < nr_objects; i++) {
> -               struct object_entry *obj = *list++;
> -               if (index_version < 2) {
> -                       uint32_t offset = htonl(obj->offset);
> -                       sha1write(f, &offset, 4);
> -               }
> -               sha1write(f, obj->sha1, 20);
> -               SHA1_Update(&ctx, obj->sha1, 20);
> -       }
> -
> -       if (index_version >= 2) {
> -               unsigned int nr_large_offset = 0;
> -
> -               /* write the crc32 table */
> -               list = sorted_by_sha;
> -               for (i = 0; i < nr_objects; i++) {
> -                       struct object_entry *obj = *list++;
> -                       uint32_t crc32_val = htonl(obj->crc32);
> -                       sha1write(f, &crc32_val, 4);
> -               }
> -
> -               /* write the 32-bit offset table */
> -               list = sorted_by_sha;
> -               for (i = 0; i < nr_objects; i++) {
> -                       struct object_entry *obj = *list++;
> -                       uint32_t offset = (obj->offset <= index_off32_limit) ?
> -                               obj->offset : (0x80000000 | nr_large_offset++);
> -                       offset = htonl(offset);
> -                       sha1write(f, &offset, 4);
> -               }
> -
> -               /* write the large offset table */
> -               list = sorted_by_sha;
> -               while (nr_large_offset) {
> -                       struct object_entry *obj = *list++;
> -                       uint64_t offset = obj->offset;
> -                       if (offset > index_off32_limit) {
> -                               uint32_t split[2];
> -                               split[0]        = htonl(offset >> 32);
> -                               split[1] = htonl(offset & 0xffffffff);
> -                               sha1write(f, split, 8);
> -                               nr_large_offset--;
> -                       }
> -               }
> -       }
> -
> -       sha1write(f, sha1, 20);
> -       sha1close(f, NULL, 1);
> -       free(sorted_by_sha);
> -       SHA1_Final(sha1, &ctx);
> -       return index_name;
> -}
> -
>  static void final(const char *final_pack_name, const char *curr_pack_name,
>                   const char *final_index_name, const char *curr_index_name,
>                   const char *keep_name, const char *keep_msg,
> @@ -830,6 +692,7 @@ int main(int argc, char **argv)
>         const char *curr_index, *index_name = NULL;
>         const char *keep_name = NULL, *keep_msg = NULL;
>         char *index_name_buf = NULL, *keep_name_buf = NULL;
> +       struct idx_object_entry **idx_objects;
>         unsigned char sha1[20];
>
>         for (i = 1; i < argc; i++) {
> @@ -865,12 +728,12 @@ int main(int argc, char **argv)
>                                 index_name = argv[++i];
>                         } else if (!prefixcmp(arg, "--index-version=")) {
>                                 char *c;
> -                               index_default_version = strtoul(arg + 16, &c, 10);
> -                               if (index_default_version > 2)
> +                               pack_idx_default_version = strtoul(arg + 16, &c, 10);
> +                               if (pack_idx_default_version > 2)
>                                         die("bad %s", arg);
>                                 if (*c == ',')
> -                                       index_off32_limit = strtoul(c+1, &c, 0);
> -                               if (*c || index_off32_limit & 0x80000000)
> +                                       pack_idx_off32_limit = strtoul(c+1, &c, 0);
> +                               if (*c || pack_idx_off32_limit & 0x80000000)
>                                         die("bad %s", arg);
>                         } else
>                                 usage(index_pack_usage);
> @@ -940,7 +803,13 @@ int main(int argc, char **argv)
>                             nr_deltas - nr_resolved_deltas);
>         }
>         free(deltas);
> -       curr_index = write_index_file(index_name, sha1);
> +
> +       idx_objects = xmalloc((nr_objects) * sizeof(struct idx_object_entry *));
> +       for (i = 0; i < nr_objects; i++)
> +               idx_objects[i] = (struct idx_object_entry *) &objects[i];
> +       curr_index = write_idx_file(index_name, idx_objects, nr_objects, sha1);
> +       free(idx_objects);
> +
>         final(pack_name, curr_pack,
>                 index_name, curr_index,
>                 keep_name, keep_msg,
> diff --git a/pack-idx.c b/pack-idx.c
> new file mode 100644
> index 0000000..ccf232e
> --- /dev/null
> +++ b/pack-idx.c
> @@ -0,0 +1,144 @@
> +#include "cache.h"
> +#include "pack.h"
> +#include "csum-file.h"
> +
> +uint32_t pack_idx_default_version = 1;
> +uint32_t pack_idx_off32_limit = 0x7fffffff;
> +
> +static int sha1_compare(const void *_a, const void *_b)
> +{
> +       struct idx_object_entry *a = *(struct idx_object_entry **)_a;
> +       struct idx_object_entry *b = *(struct idx_object_entry **)_b;
> +       return hashcmp(a->sha1, b->sha1);
> +}
> +
> +/*
> + * On entry *sha1 contains the pack content SHA1 hash, on exit it is
> + * the SHA1 hash of sorted object names. The objects array passed in
> + * will be sorted by SHA1 on exit.
> + */
> +const char *write_idx_file(const char *index_name, struct idx_object_entry **objects, int nr_objects, unsigned char *sha1)
> +{
> +       struct sha1file *f;
> +       struct idx_object_entry **sorted_by_sha, **list, **last;
> +       off_t last_obj_offset = 0;
> +       uint32_t array[256];
> +       int i, fd;
> +       SHA_CTX ctx;
> +       uint32_t index_version;
> +
> +       if (nr_objects) {
> +               sorted_by_sha = objects;
> +               list = sorted_by_sha;
> +               last = sorted_by_sha + nr_objects;
> +               for (i = 0; i < nr_objects; ++i) {
> +                       if (objects[i]->offset > last_obj_offset)
> +                               last_obj_offset = objects[i]->offset;
> +               }
> +               qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
> +                     sha1_compare);
> +       }
> +       else
> +               sorted_by_sha = list = last = NULL;
> +
> +       if (!index_name) {
> +               static char tmpfile[PATH_MAX];
> +               snprintf(tmpfile, sizeof(tmpfile),
> +                        "%s/tmp_idx_XXXXXX", get_object_directory());
> +               fd = mkstemp(tmpfile);
> +               index_name = xstrdup(tmpfile);
> +       } else {
> +               unlink(index_name);
> +               fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
> +       }
> +       if (fd < 0)
> +               die("unable to create %s: %s", index_name, strerror(errno));
> +       f = sha1fd(fd, index_name);
> +
> +       /* if last object's offset is >= 2^31 we should use index V2 */
> +       index_version = (last_obj_offset >> 31) ? 2 : pack_idx_default_version;
> +
> +       /* index versions 2 and above need a header */
> +       if (index_version >= 2) {
> +               struct pack_idx_header hdr;
> +               hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
> +               hdr.idx_version = htonl(index_version);
> +               sha1write(f, &hdr, sizeof(hdr));
> +       }
> +
> +       /*
> +        * Write the first-level table (the list is sorted,
> +        * but we use a 256-entry lookup to be able to avoid
> +        * having to do eight extra binary search iterations).
> +        */
> +       for (i = 0; i < 256; i++) {
> +               struct idx_object_entry **next = list;
> +               while (next < last) {
> +                       struct idx_object_entry *obj = *next;
> +                       if (obj->sha1[0] != i)
> +                               break;
> +                       next++;
> +               }
> +               array[i] = htonl(next - sorted_by_sha);
> +               list = next;
> +       }
> +       sha1write(f, array, 256 * 4);
> +
> +       /* compute the SHA1 hash of sorted object names. */
> +       SHA1_Init(&ctx);
> +
> +       /*
> +        * Write the actual SHA1 entries..
> +        */
> +       list = sorted_by_sha;
> +       for (i = 0; i < nr_objects; i++) {
> +               struct idx_object_entry *obj = *list++;
> +               if (index_version < 2) {
> +                       uint32_t offset = htonl(obj->offset);
> +                       sha1write(f, &offset, 4);
> +               }
> +               sha1write(f, obj->sha1, 20);
> +               SHA1_Update(&ctx, obj->sha1, 20);
> +       }
> +
> +       if (index_version >= 2) {
> +               unsigned int nr_large_offset = 0;
> +
> +               /* write the crc32 table */
> +               list = sorted_by_sha;
> +               for (i = 0; i < nr_objects; i++) {
> +                       struct idx_object_entry *obj = *list++;
> +                       uint32_t crc32_val = htonl(obj->crc32);
> +                       sha1write(f, &crc32_val, 4);
> +               }
> +
> +               /* write the 32-bit offset table */
> +               list = sorted_by_sha;
> +               for (i = 0; i < nr_objects; i++) {
> +                       struct idx_object_entry *obj = *list++;
> +                       uint32_t offset = (obj->offset <= pack_idx_off32_limit) ?
> +                               obj->offset : (0x80000000 | nr_large_offset++);
> +                       offset = htonl(offset);
> +                       sha1write(f, &offset, 4);
> +               }
> +
> +               /* write the large offset table */
> +               list = sorted_by_sha;
> +               while (nr_large_offset) {
> +                       struct idx_object_entry *obj = *list++;
> +                       uint64_t offset = obj->offset;
> +                       if (offset > pack_idx_off32_limit) {
> +                               uint32_t split[2];
> +                               split[0]        = htonl(offset >> 32);
> +                               split[1] = htonl(offset & 0xffffffff);
> +                               sha1write(f, split, 8);
> +                               nr_large_offset--;
> +                       }
> +               }
> +       }
> +
> +       sha1write(f, sha1, 20);
> +       sha1close(f, NULL, 1);
> +       SHA1_Final(sha1, &ctx);
> +       return index_name;
> +}
> diff --git a/pack.h b/pack.h
> index d667fb8..f6c5f2c 100644
> --- a/pack.h
> +++ b/pack.h
> @@ -34,6 +34,10 @@ struct pack_header {
>   */
>  #define PACK_IDX_SIGNATURE 0xff744f63  /* "\377tOc" */
>
> +/* These may be overridden by command-line parameters */
> +extern uint32_t pack_idx_default_version;
> +extern uint32_t pack_idx_off32_limit;
> +
>  /*
>   * Packed object index header
>   */
> @@ -42,6 +46,17 @@ struct pack_idx_header {
>         uint32_t idx_version;
>  };
>
> +/*
> + * Common part of object structure used for write_idx_file
> + */
> +struct idx_object_entry {
> +       unsigned char sha1[20];
> +       off_t offset;
> +       unsigned long size;
> +       uint32_t crc32;
> +};
> +
> +extern const char *write_idx_file(const char *index_name, struct idx_object_entry **objects, int nr_objects, unsigned char *sha1);
>
>  extern int verify_pack(struct packed_git *, int);
>  extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t);
> --
> 1.5.1
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell

^ permalink raw reply

* Re: [PATCH] Unify write_index_file functions
From: Junio C Hamano @ 2007-06-01 20:15 UTC (permalink / raw)
  To: Geert Bosch; +Cc: git Mailing List
In-Reply-To: <20070601194856.66DFB4D7206@potomac.gnat.com>

Geert Bosch <bosch@gnat.com> writes:

> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index e52332d..d4c5d2b 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -24,9 +24,10 @@ git-pack-objects [{ -q | --progress | --all-progress }] [--max-pack-size=N] \n\
>  
>  struct object_entry {
>  	unsigned char sha1[20];
> -	uint32_t crc32;		/* crc of raw pack data for this object */
>  	off_t offset;		/* offset into the final pack file */
>  	unsigned long size;	/* uncompressed size */
> +	uint32_t crc32;		/* crc of raw pack data for this object */
> +
>  	unsigned int hash;	/* name hint hash */
>  	unsigned int depth;	/* delta depth */
>  	struct packed_git *in_pack; 	/* already in pack */

Why?  off_t offset used to be 8-byte aligned but now it is not...

> diff --git a/index-pack.c b/index-pack.c
> index 58c4a9c..ed6ff9c 100644
> --- a/index-pack.c
> +++ b/index-pack.c
> @@ -13,13 +13,14 @@ static const char index_pack_usage[] =
>  
>  struct object_entry
>  {
> +	unsigned char sha1[20];
>  	off_t offset;
>  	unsigned long size;
> -	unsigned int hdr_size;
>  	uint32_t crc32;
> +
> +	unsigned int hdr_size;
>  	enum object_type type;
>  	enum object_type real_type;
> -	unsigned char sha1[20];
>  };
>  
>  union delta_base {

Ah, you wanted to match the shape of the early part of two
structures.  Sounds error prone for people who would want to
maintain both programs in the future.

Why not make the private "struct object_entry" in each users
have an embedded structure at the beginning like this:

	struct object_entry {
        	struct idx_object_entry idx;
                unsigned int hash;
                unsigned int depth;
                ...
	}; /* in builtin-pack-objects.c */

        struct object_entry {        
        	struct idx_object_entry idx;
                unsigned int hdr_size;
                enum object_type type;
                enum object_type real_type;
	}; /* in index-pack.c */

^ permalink raw reply

* Re: [PATCH] gitweb: use decode_utf8 directly
From: Ismail Dönmez @ 2007-06-01 20:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexandre Julliard, git, Jakub Narebski
In-Reply-To: <7vbqfzzbq8.fsf@assigned-by-dhcp.cox.net>

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

On Friday 01 June 2007 23:00:31 you wrote:
> Ismail Dönmez <ismail@pardus.org.tr> writes:
> > On Friday 01 June 2007 22:44:36 Junio C Hamano wrote:
> >> Alexandre Julliard <julliard@winehq.org> writes:
> >> > Sorry for the late nack, but it turns out that this patch breaks diff
> >> > output on the Wine server for files that are not utf-8.
> >> >
> >> > The cause is apparently that decode_utf8() returns undef for invalid
> >> > sequences instead of substituting a replacement char like
> >> > decode("utf8") does.
> >>
> >> Thanks for noticing.  Will revert.
> >
> > Why are reverting a correct bugfix? :( He's at most using outdated
> > software. *sigh*
>
> I would assume that on top of a revert, with an additional
>
> 	return $str if is_utf8($str);
>
> to to_utf8() you should be able to fix both installations that
> has old or new Encode.pm?

I can try the patch if you can send me what you propose. 

/ismail

-- 
Perfect is the enemy of good

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply

* Re: [PATCH] gitweb: use decode_utf8 directly
From: Junio C Hamano @ 2007-06-01 20:00 UTC (permalink / raw)
  To: Ismail Dönmez; +Cc: Alexandre Julliard, git, Jakub Narebski
In-Reply-To: <200706012247.57273.ismail@pardus.org.tr>

Ismail Dönmez <ismail@pardus.org.tr> writes:

> On Friday 01 June 2007 22:44:36 Junio C Hamano wrote:
>> Alexandre Julliard <julliard@winehq.org> writes:
>> > Sorry for the late nack, but it turns out that this patch breaks diff
>> > output on the Wine server for files that are not utf-8.
>> >
>> > The cause is apparently that decode_utf8() returns undef for invalid
>> > sequences instead of substituting a replacement char like
>> > decode("utf8") does.
>>
>> Thanks for noticing.  Will revert.
>
> Why are reverting a correct bugfix? :( He's at most using outdated software. 
> *sigh*

I would assume that on top of a revert, with an additional

	return $str if is_utf8($str);

to to_utf8() you should be able to fix both installations that
has old or new Encode.pm?

^ permalink raw reply

* Re: [PATCH] Let .git/config specify the url for submodules
From: Junio C Hamano @ 2007-06-01 19:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Lars Hjemli, skimo, git
In-Reply-To: <alpine.LFD.0.98.0706010919360.3957@woody.linux-foundation.org>

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Fri, 1 Jun 2007, Lars Hjemli wrote:
> ...
> Ack. I think the natural thing for a lot of cases is the trivial "module 
> name == path" case, so having to have
>
> 	[path "kernel"]
> 		module = kernel
>
> for that case just sounds unnecessary.
>
> That said, I wonder if it wouldn't be more natural to do things the other 
> way around, because quite often a "module" (under CVS conventions) is a 
> *set* of directories, so with that in mind, it might be better to have the 
> mapping be something like this:
>
> 	[module "infrastructure"]
> 		submodule = lib
> 		submodule = build
>
> 	[submodule "lib"]
> 		url = git://xyzzy/lib-1.2.3
>
> 	[submodule "build"]
> 		url = git://xyzzy/build-0.61
>
> and make the rule be:
>  - submodules are named by their paths (ie "path == submodule")
>  - a module is a set of such submodules/paths
>  - if no "module" is defined, the default is to just use the 
>    path/submodule name

I take that if you do want to name a submodule differently from
its (currently in-tree) path, you would do something like...

	[submodule "xyzzylib"]
        	path = lib
                url = git://xyzzy/lib-1.2.3

> IOW, in the above case, we have *three* modules:
>
>  - module "infrastructure", that is the union of submodules/paths "lib" 
>    and "build"
>  - module "lib" (== submodule/path "lib")
>  - module "build" (== submodule/path "build")
>
> and when you do a 
>
> 	git submodule checkout infrastructure
>
> it would be basically equivalent to
>
> 	git submodule checkout lib
> 	git submodule checkout build

Sounds very sensible.

^ permalink raw reply

* Re: [PATCH] Add basic test-script for git-submodule
From: Junio C Hamano @ 2007-06-01 19:50 UTC (permalink / raw)
  To: Lars Hjemli
  Cc: Johannes Sixt, Junio C Hamano, Johannes Schindelin,
	git@vger.kernel.org
In-Reply-To: <op.ts8g4dsa9pspc6@localhost>

"Lars Hjemli" <hjemli@gmail.com> writes:

> This test tries to verify basic sanity of git-submodule, i.e. that it is
> able to clone and update a submodule repository, that its status output is
> sane, and that it barfs when the submodule path is occupied during init.
>
> Signed-off-by: Lars Hjemli <hjemli@gmail.com>

Micronit...

> +test_expect_success 'the --cached sha1 should be rev1' '
> +	git-submodule --cached status | grep "^\+$rev1"
> +'

What's the purpose of that solitary backslash?

^ permalink raw reply

* [PATCH] Unify write_index_file functions
From: Geert Bosch @ 2007-06-01 19:18 UTC (permalink / raw)
  To: git Mailing List

This patch creates a new pack-idx.c file containing a unified version of
the write_index_file functions in builtin-pack-objects.c and index-pack.c.
As the name "index" is overloaded in git, move in the direction
of using "idx" and "pack idx" when refering to the pack index.
There should be no change in functionality.

Signed-off-by: Geert Bosch <bosch@gnat.com>
---
 Makefile               |    3 +-
 builtin-pack-objects.c |  143 ++++--------------------------------------
 index-pack.c           |  161 +++++-------------------------------------------
 pack-idx.c             |  144 +++++++++++++++++++++++++++++++++++++++++++
 pack.h                 |   15 +++++
 5 files changed, 190 insertions(+), 276 deletions(-)
 create mode 100644 pack-idx.c

diff --git a/Makefile b/Makefile
index 7527734..8e89cda 100644
--- a/Makefile
+++ b/Makefile
@@ -310,7 +310,8 @@ LIB_OBJS = \
 	interpolate.o \
 	lockfile.o \
 	patch-ids.o \
-	object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \
+	object.o pack-check.o pack-idx.o pack-write.o \
+	patch-delta.o path.o pkt-line.o \
 	sideband.o reachable.o reflog-walk.o \
 	quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \
 	server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index e52332d..d4c5d2b 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -24,9 +24,10 @@ git-pack-objects [{ -q | --progress | --all-progress }] [--max-pack-size=N] \n\
 
 struct object_entry {
 	unsigned char sha1[20];
-	uint32_t crc32;		/* crc of raw pack data for this object */
 	off_t offset;		/* offset into the final pack file */
 	unsigned long size;	/* uncompressed size */
+	uint32_t crc32;		/* crc of raw pack data for this object */
+
 	unsigned int hash;	/* name hint hash */
 	unsigned int depth;	/* delta depth */
 	struct packed_git *in_pack; 	/* already in pack */
@@ -584,8 +585,7 @@ static int open_object_dir_tmp(const char *path)
     return mkstemp(tmpname);
 }
 
-/* forward declarations for write_pack_file */
-static void write_index_file(off_t last_obj_offset, unsigned char *sha1);
+/* forward declaration for write_pack_file */
 static int adjust_perm(const char *path, mode_t mode);
 
 static void write_pack_file(void)
@@ -641,15 +641,17 @@ static void write_pack_file(void)
 		}
 
 		if (!pack_to_stdout) {
-			unsigned char object_list_sha1[20];
+			unsigned char sha1[20];
 			mode_t mode = umask(0);
 
 			umask(mode);
 			mode = 0444 & ~mode;
 
-			write_index_file(last_obj_offset, object_list_sha1);
+			hashcpy(sha1, pack_file_sha1);
+			idx_tmp_name = write_idx_file(NULL,
+				(struct idx_object_entry **) written_list, nr_written, sha1);
 			snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
-				 base_name, sha1_to_hex(object_list_sha1));
+				 base_name, sha1_to_hex(sha1));
 			if (adjust_perm(pack_tmp_name, mode))
 				die("unable to make temporary pack file readable: %s",
 				    strerror(errno));
@@ -657,14 +659,14 @@ static void write_pack_file(void)
 				die("unable to rename temporary pack file: %s",
 				    strerror(errno));
 			snprintf(tmpname, sizeof(tmpname), "%s-%s.idx",
-				 base_name, sha1_to_hex(object_list_sha1));
+				 base_name, sha1_to_hex(sha1));
 			if (adjust_perm(idx_tmp_name, mode))
 				die("unable to make temporary index file readable: %s",
 				    strerror(errno));
 			if (rename(idx_tmp_name, tmpname))
 				die("unable to rename temporary index file: %s",
 				    strerror(errno));
-			puts(sha1_to_hex(object_list_sha1));
+			puts(sha1_to_hex(sha1));
 		}
 
 		/* mark written objects as written to previous pack */
@@ -693,123 +695,6 @@ static void write_pack_file(void)
 		die("wrote %u objects as expected but %u unwritten", written, j);
 }
 
-static int sha1_sort(const void *_a, const void *_b)
-{
-	const struct object_entry *a = *(struct object_entry **)_a;
-	const struct object_entry *b = *(struct object_entry **)_b;
-	return hashcmp(a->sha1, b->sha1);
-}
-
-static uint32_t index_default_version = 1;
-static uint32_t index_off32_limit = 0x7fffffff;
-
-static void write_index_file(off_t last_obj_offset, unsigned char *sha1)
-{
-	struct sha1file *f;
-	struct object_entry **sorted_by_sha, **list, **last;
-	uint32_t array[256];
-	uint32_t i, index_version;
-	SHA_CTX ctx;
-
-	int fd = open_object_dir_tmp("tmp_idx_XXXXXX");
-	if (fd < 0)
-		die("unable to create %s: %s\n", tmpname, strerror(errno));
-	idx_tmp_name = xstrdup(tmpname);
-	f = sha1fd(fd, idx_tmp_name);
-
-	if (nr_written) {
-		sorted_by_sha = written_list;
-		qsort(sorted_by_sha, nr_written, sizeof(*sorted_by_sha), sha1_sort);
-		list = sorted_by_sha;
-		last = sorted_by_sha + nr_written;
-	} else
-		sorted_by_sha = list = last = NULL;
-
-	/* if last object's offset is >= 2^31 we should use index V2 */
-	index_version = (last_obj_offset >> 31) ? 2 : index_default_version;
-
-	/* index versions 2 and above need a header */
-	if (index_version >= 2) {
-		struct pack_idx_header hdr;
-		hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
-		hdr.idx_version = htonl(index_version);
-		sha1write(f, &hdr, sizeof(hdr));
-	}
-
-	/*
-	 * Write the first-level table (the list is sorted,
-	 * but we use a 256-entry lookup to be able to avoid
-	 * having to do eight extra binary search iterations).
-	 */
-	for (i = 0; i < 256; i++) {
-		struct object_entry **next = list;
-		while (next < last) {
-			struct object_entry *entry = *next;
-			if (entry->sha1[0] != i)
-				break;
-			next++;
-		}
-		array[i] = htonl(next - sorted_by_sha);
-		list = next;
-	}
-	sha1write(f, array, 256 * 4);
-
-	/* Compute the SHA1 hash of sorted object names. */
-	SHA1_Init(&ctx);
-
-	/* Write the actual SHA1 entries. */
-	list = sorted_by_sha;
-	for (i = 0; i < nr_written; i++) {
-		struct object_entry *entry = *list++;
-		if (index_version < 2) {
-			uint32_t offset = htonl(entry->offset);
-			sha1write(f, &offset, 4);
-		}
-		sha1write(f, entry->sha1, 20);
-		SHA1_Update(&ctx, entry->sha1, 20);
-	}
-
-	if (index_version >= 2) {
-		unsigned int nr_large_offset = 0;
-
-		/* write the crc32 table */
-		list = sorted_by_sha;
-		for (i = 0; i < nr_written; i++) {
-			struct object_entry *entry = *list++;
-			uint32_t crc32_val = htonl(entry->crc32);
-			sha1write(f, &crc32_val, 4);
-		}
-
-		/* write the 32-bit offset table */
-		list = sorted_by_sha;
-		for (i = 0; i < nr_written; i++) {
-			struct object_entry *entry = *list++;
-			uint32_t offset = (entry->offset <= index_off32_limit) ?
-				entry->offset : (0x80000000 | nr_large_offset++);
-			offset = htonl(offset);
-			sha1write(f, &offset, 4);
-		}
-
-		/* write the large offset table */
-		list = sorted_by_sha;
-		while (nr_large_offset) {
-			struct object_entry *entry = *list++;
-			uint64_t offset = entry->offset;
-			if (offset > index_off32_limit) {
-				uint32_t split[2];
-				split[0]        = htonl(offset >> 32);
-				split[1] = htonl(offset & 0xffffffff);
-				sha1write(f, split, 8);
-				nr_large_offset--;
-			}
-		}
-	}
-
-	sha1write(f, pack_file_sha1, 20);
-	sha1close(f, NULL, 1);
-	SHA1_Final(sha1, &ctx);
-}
-
 static int locate_object_entry_hash(const unsigned char *sha1)
 {
 	int i;
@@ -1825,12 +1710,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 		}
 		if (!prefixcmp(arg, "--index-version=")) {
 			char *c;
-			index_default_version = strtoul(arg + 16, &c, 10);
-			if (index_default_version > 2)
+			pack_idx_default_version = strtoul(arg + 16, &c, 10);
+			if (pack_idx_default_version > 2)
 				die("bad %s", arg);
 			if (*c == ',')
-				index_off32_limit = strtoul(c+1, &c, 0);
-			if (*c || index_off32_limit & 0x80000000)
+				pack_idx_off32_limit = strtoul(c+1, &c, 0);
+			if (*c || pack_idx_off32_limit & 0x80000000)
 				die("bad %s", arg);
 			continue;
 		}
diff --git a/index-pack.c b/index-pack.c
index 58c4a9c..ed6ff9c 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -13,13 +13,14 @@ static const char index_pack_usage[] =
 
 struct object_entry
 {
+	unsigned char sha1[20];
 	off_t offset;
 	unsigned long size;
-	unsigned int hdr_size;
 	uint32_t crc32;
+
+	unsigned int hdr_size;
 	enum object_type type;
 	enum object_type real_type;
-	unsigned char sha1[20];
 };
 
 union delta_base {
@@ -602,145 +603,6 @@ static void fix_unresolved_deltas(int nr_unresolved)
 	free(sorted_by_pos);
 }
 
-static uint32_t index_default_version = 1;
-static uint32_t index_off32_limit = 0x7fffffff;
-
-static int sha1_compare(const void *_a, const void *_b)
-{
-	struct object_entry *a = *(struct object_entry **)_a;
-	struct object_entry *b = *(struct object_entry **)_b;
-	return hashcmp(a->sha1, b->sha1);
-}
-
-/*
- * On entry *sha1 contains the pack content SHA1 hash, on exit it is
- * the SHA1 hash of sorted object names.
- */
-static const char *write_index_file(const char *index_name, unsigned char *sha1)
-{
-	struct sha1file *f;
-	struct object_entry **sorted_by_sha, **list, **last;
-	uint32_t array[256];
-	int i, fd;
-	SHA_CTX ctx;
-	uint32_t index_version;
-
-	if (nr_objects) {
-		sorted_by_sha =
-			xcalloc(nr_objects, sizeof(struct object_entry *));
-		list = sorted_by_sha;
-		last = sorted_by_sha + nr_objects;
-		for (i = 0; i < nr_objects; ++i)
-			sorted_by_sha[i] = &objects[i];
-		qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
-		      sha1_compare);
-	}
-	else
-		sorted_by_sha = list = last = NULL;
-
-	if (!index_name) {
-		static char tmpfile[PATH_MAX];
-		snprintf(tmpfile, sizeof(tmpfile),
-			 "%s/tmp_idx_XXXXXX", get_object_directory());
-		fd = mkstemp(tmpfile);
-		index_name = xstrdup(tmpfile);
-	} else {
-		unlink(index_name);
-		fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
-	}
-	if (fd < 0)
-		die("unable to create %s: %s", index_name, strerror(errno));
-	f = sha1fd(fd, index_name);
-
-	/* if last object's offset is >= 2^31 we should use index V2 */
-	index_version = (objects[nr_objects-1].offset >> 31) ? 2 : index_default_version;
-
-	/* index versions 2 and above need a header */
-	if (index_version >= 2) {
-		struct pack_idx_header hdr;
-		hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
-		hdr.idx_version = htonl(index_version);
-		sha1write(f, &hdr, sizeof(hdr));
-	}
-
-	/*
-	 * Write the first-level table (the list is sorted,
-	 * but we use a 256-entry lookup to be able to avoid
-	 * having to do eight extra binary search iterations).
-	 */
-	for (i = 0; i < 256; i++) {
-		struct object_entry **next = list;
-		while (next < last) {
-			struct object_entry *obj = *next;
-			if (obj->sha1[0] != i)
-				break;
-			next++;
-		}
-		array[i] = htonl(next - sorted_by_sha);
-		list = next;
-	}
-	sha1write(f, array, 256 * 4);
-
-	/* compute the SHA1 hash of sorted object names. */
-	SHA1_Init(&ctx);
-
-	/*
-	 * Write the actual SHA1 entries..
-	 */
-	list = sorted_by_sha;
-	for (i = 0; i < nr_objects; i++) {
-		struct object_entry *obj = *list++;
-		if (index_version < 2) {
-			uint32_t offset = htonl(obj->offset);
-			sha1write(f, &offset, 4);
-		}
-		sha1write(f, obj->sha1, 20);
-		SHA1_Update(&ctx, obj->sha1, 20);
-	}
-
-	if (index_version >= 2) {
-		unsigned int nr_large_offset = 0;
-
-		/* write the crc32 table */
-		list = sorted_by_sha;
-		for (i = 0; i < nr_objects; i++) {
-			struct object_entry *obj = *list++;
-			uint32_t crc32_val = htonl(obj->crc32);
-			sha1write(f, &crc32_val, 4);
-		}
-
-		/* write the 32-bit offset table */
-		list = sorted_by_sha;
-		for (i = 0; i < nr_objects; i++) {
-			struct object_entry *obj = *list++;
-			uint32_t offset = (obj->offset <= index_off32_limit) ?
-				obj->offset : (0x80000000 | nr_large_offset++);
-			offset = htonl(offset);
-			sha1write(f, &offset, 4);
-		}
-
-		/* write the large offset table */
-		list = sorted_by_sha;
-		while (nr_large_offset) {
-			struct object_entry *obj = *list++;
-			uint64_t offset = obj->offset;
-			if (offset > index_off32_limit) {
-				uint32_t split[2];
-				split[0]	= htonl(offset >> 32);
-				split[1] = htonl(offset & 0xffffffff);
-				sha1write(f, split, 8);
-				nr_large_offset--;
-			}
-		}
-	}
-
-	sha1write(f, sha1, 20);
-	sha1close(f, NULL, 1);
-	free(sorted_by_sha);
-	SHA1_Final(sha1, &ctx);
-	return index_name;
-}
-
 static void final(const char *final_pack_name, const char *curr_pack_name,
 		  const char *final_index_name, const char *curr_index_name,
 		  const char *keep_name, const char *keep_msg,
@@ -830,6 +692,7 @@ int main(int argc, char **argv)
 	const char *curr_index, *index_name = NULL;
 	const char *keep_name = NULL, *keep_msg = NULL;
 	char *index_name_buf = NULL, *keep_name_buf = NULL;
+	struct idx_object_entry **idx_objects;
 	unsigned char sha1[20];
 
 	for (i = 1; i < argc; i++) {
@@ -865,12 +728,12 @@ int main(int argc, char **argv)
 				index_name = argv[++i];
 			} else if (!prefixcmp(arg, "--index-version=")) {
 				char *c;
-				index_default_version = strtoul(arg + 16, &c, 10);
-				if (index_default_version > 2)
+				pack_idx_default_version = strtoul(arg + 16, &c, 10);
+				if (pack_idx_default_version > 2)
 					die("bad %s", arg);
 				if (*c == ',')
-					index_off32_limit = strtoul(c+1, &c, 0);
-				if (*c || index_off32_limit & 0x80000000)
+					pack_idx_off32_limit = strtoul(c+1, &c, 0);
+				if (*c || pack_idx_off32_limit & 0x80000000)
 					die("bad %s", arg);
 			} else
 				usage(index_pack_usage);
@@ -940,7 +803,13 @@ int main(int argc, char **argv)
 			    nr_deltas - nr_resolved_deltas);
 	}
 	free(deltas);
-	curr_index = write_index_file(index_name, sha1);
+
+	idx_objects = xmalloc((nr_objects) * sizeof(struct idx_object_entry *));
+	for (i = 0; i < nr_objects; i++)
+		idx_objects[i] = (struct idx_object_entry *) &objects[i];
+	curr_index = write_idx_file(index_name, idx_objects, nr_objects, sha1);
+	free(idx_objects);
+
 	final(pack_name, curr_pack,
 		index_name, curr_index,
 		keep_name, keep_msg,
diff --git a/pack-idx.c b/pack-idx.c
new file mode 100644
index 0000000..ccf232e
--- /dev/null
+++ b/pack-idx.c
@@ -0,0 +1,144 @@
+#include "cache.h"
+#include "pack.h"
+#include "csum-file.h"
+
+uint32_t pack_idx_default_version = 1;
+uint32_t pack_idx_off32_limit = 0x7fffffff;
+
+static int sha1_compare(const void *_a, const void *_b)
+{
+	struct idx_object_entry *a = *(struct idx_object_entry **)_a;
+	struct idx_object_entry *b = *(struct idx_object_entry **)_b;
+	return hashcmp(a->sha1, b->sha1);
+}
+
+/*
+ * On entry *sha1 contains the pack content SHA1 hash, on exit it is
+ * the SHA1 hash of sorted object names. The objects array passed in
+ * will be sorted by SHA1 on exit.
+ */
+const char *write_idx_file(const char *index_name, struct idx_object_entry **objects, int nr_objects, unsigned char *sha1)
+{
+	struct sha1file *f;
+	struct idx_object_entry **sorted_by_sha, **list, **last;
+	off_t last_obj_offset = 0;
+	uint32_t array[256];
+	int i, fd;
+	SHA_CTX ctx;
+	uint32_t index_version;
+
+	if (nr_objects) {
+		sorted_by_sha = objects;
+		list = sorted_by_sha;
+		last = sorted_by_sha + nr_objects;
+		for (i = 0; i < nr_objects; ++i) {
+			if (objects[i]->offset > last_obj_offset)
+				last_obj_offset = objects[i]->offset;
+		}
+		qsort(sorted_by_sha, nr_objects, sizeof(sorted_by_sha[0]),
+		      sha1_compare);
+	}
+	else
+		sorted_by_sha = list = last = NULL;
+
+	if (!index_name) {
+		static char tmpfile[PATH_MAX];
+		snprintf(tmpfile, sizeof(tmpfile),
+			 "%s/tmp_idx_XXXXXX", get_object_directory());
+		fd = mkstemp(tmpfile);
+		index_name = xstrdup(tmpfile);
+	} else {
+		unlink(index_name);
+		fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);
+	}
+	if (fd < 0)
+		die("unable to create %s: %s", index_name, strerror(errno));
+	f = sha1fd(fd, index_name);
+
+	/* if last object's offset is >= 2^31 we should use index V2 */
+	index_version = (last_obj_offset >> 31) ? 2 : pack_idx_default_version;
+
+	/* index versions 2 and above need a header */
+	if (index_version >= 2) {
+		struct pack_idx_header hdr;
+		hdr.idx_signature = htonl(PACK_IDX_SIGNATURE);
+		hdr.idx_version = htonl(index_version);
+		sha1write(f, &hdr, sizeof(hdr));
+	}
+
+	/*
+	 * Write the first-level table (the list is sorted,
+	 * but we use a 256-entry lookup to be able to avoid
+	 * having to do eight extra binary search iterations).
+	 */
+	for (i = 0; i < 256; i++) {
+		struct idx_object_entry **next = list;
+		while (next < last) {
+			struct idx_object_entry *obj = *next;
+			if (obj->sha1[0] != i)
+				break;
+			next++;
+		}
+		array[i] = htonl(next - sorted_by_sha);
+		list = next;
+	}
+	sha1write(f, array, 256 * 4);
+
+	/* compute the SHA1 hash of sorted object names. */
+	SHA1_Init(&ctx);
+
+	/*
+	 * Write the actual SHA1 entries..
+	 */
+	list = sorted_by_sha;
+	for (i = 0; i < nr_objects; i++) {
+		struct idx_object_entry *obj = *list++;
+		if (index_version < 2) {
+			uint32_t offset = htonl(obj->offset);
+			sha1write(f, &offset, 4);
+		}
+		sha1write(f, obj->sha1, 20);
+		SHA1_Update(&ctx, obj->sha1, 20);
+	}
+
+	if (index_version >= 2) {
+		unsigned int nr_large_offset = 0;
+
+		/* write the crc32 table */
+		list = sorted_by_sha;
+		for (i = 0; i < nr_objects; i++) {
+			struct idx_object_entry *obj = *list++;
+			uint32_t crc32_val = htonl(obj->crc32);
+			sha1write(f, &crc32_val, 4);
+		}
+
+		/* write the 32-bit offset table */
+		list = sorted_by_sha;
+		for (i = 0; i < nr_objects; i++) {
+			struct idx_object_entry *obj = *list++;
+			uint32_t offset = (obj->offset <= pack_idx_off32_limit) ?
+				obj->offset : (0x80000000 | nr_large_offset++);
+			offset = htonl(offset);
+			sha1write(f, &offset, 4);
+		}
+
+		/* write the large offset table */
+		list = sorted_by_sha;
+		while (nr_large_offset) {
+			struct idx_object_entry *obj = *list++;
+			uint64_t offset = obj->offset;
+			if (offset > pack_idx_off32_limit) {
+				uint32_t split[2];
+				split[0]	= htonl(offset >> 32);
+				split[1] = htonl(offset & 0xffffffff);
+				sha1write(f, split, 8);
+				nr_large_offset--;
+			}
+		}
+	}
+
+	sha1write(f, sha1, 20);
+	sha1close(f, NULL, 1);
+	SHA1_Final(sha1, &ctx);
+	return index_name;
+}
diff --git a/pack.h b/pack.h
index d667fb8..f6c5f2c 100644
--- a/pack.h
+++ b/pack.h
@@ -34,6 +34,10 @@ struct pack_header {
  */
 #define PACK_IDX_SIGNATURE 0xff744f63	/* "\377tOc" */
 
+/* These may be overridden by command-line parameters */
+extern uint32_t pack_idx_default_version;
+extern uint32_t pack_idx_off32_limit;
+
 /*
  * Packed object index header
  */
@@ -42,6 +46,17 @@ struct pack_idx_header {
 	uint32_t idx_version;
 };
 
+/*
+ * Common part of object structure used for write_idx_file
+ */
+struct idx_object_entry {
+	unsigned char sha1[20];
+	off_t offset;
+	unsigned long size;
+	uint32_t crc32;
+};
+
+extern const char *write_idx_file(const char *index_name, struct idx_object_entry **objects, int nr_objects, unsigned char *sha1);
 
 extern int verify_pack(struct packed_git *, int);
 extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t);
-- 
1.5.1

^ permalink raw reply related


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