Git development
 help / color / mirror / Atom feed
* [PATCH] Make GIT-VERSION-GEN tolerate missing git describe command
From: John Ellson @ 2005-12-30 16:23 UTC (permalink / raw)
  To: git

I think it is probably a bug that "git non_existent_command"
returns its error message to stdout without an error, where
"git-non_existent_command" behaves differently and does return an
error.

Older versions of git did not implement "git describe"  and
GIT-VERSION-GEN produces an empty version string if run on
a system with such a git installed.  The consequence
is that "make rpm" fails.

This patch fixes GIT-VERSION-GEN so that it works in the
absence of a working "git describe"

----------------------------------------

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 196402c..845b9dc 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -2,7 +2,7 @@

  GVF=GIT-VERSION-FILE

-VN=$(git describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
+VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
  VN=$(expr "$VN" : v'\(.*\)')
  if test -r $GVF
  then

----------------------------------------


Signed-off-by: John Ellson <ellson@research.att.com>

^ permalink raw reply related

* [ANNOUNCE] qgit 1.0
From: Marco Costalba @ 2005-12-30 10:24 UTC (permalink / raw)
  To: git; +Cc: proski

qgit, a git GUI viewer.

With qgit you will be able to browse revisions history, view patch content and changed
files, graphically following different development branches.


FEATURES

  - View revisions, diffs, files history, files annotation, archive tree.

  - Commit changes visually cherry picking modified files.

  - Apply or format patch series from selected commits, drag and
    drop commits between two instances of qgit.

   - qgit implements a GUI for the most common StGIT commands like push/pop
    and apply/format patches. You can also create new patches or refresh
    current top one using the same semantics of git commit, i.e. cherry picking
    single modified files.


NEW IN THIS RELEASE

 From the last release candidate qgit has undergone an heavy stress test by me
and Pavel. We have found and fixed many crash bugs.
These bugs may not be exploitable by a 'normal' use of the tool, anyway we
feel qgit is pretty stable now.

Another, important, fix is a nasty and subtle 'data missing while loading' bug.
This one, reported and debugged by Pavel Roskin, is due to an elusive race and
is visible only on some platforms and only under certain conditions.

Thanks to everybody who helped qgit with patches and suggestions and particularly to Pavel.


DOWNLOAD

TARBALL: http://prdownloads.sourceforge.net/qgit/qgit-1.0.tar.bz2?download
GIT: http://digilander.libero.it/mcostalba/qgit.git
BINARY (against Qt3.3): http://digilander.libero.it/mcostalba/qgit

Links page: http://digilander.libero.it/mcostalba/


INSTALLATION

You need scons and qt-mt developer libs, version 3.3.4 or better, already installed.

qgit is NOT compatible with Qt4.

On some platforms (Debian) you should set QTDIR before to compile.

- unpack tar file
- make
- make install

qgit will be installed in $HOME/bin


CHANGELOG (from qgit-1.0rc2)

- check 'sign off' setting flag for patch apply too

- fix a crash when getting annotation under stress test [by Pavel Roskin]

- fix crash in file viewer under stress test

- use 'Head' to label current branch, use 'Branch' otherwise

- fix crash when quickly refreshing repo (F5) with tree viewer open

- fix a race: cancel pending annotation before to update the state.

- reuse of invalid lastItem in MainImpl::appendHistCommit [by Pavel Roskin]

- fix a missing/corrupted data bug in git reading functions (very bad!)

- fix missed tree selection in same cases

- fix regression: file viewer broken with deleted files

- fix crash when closing qgit while starting up

- fix a crash when closing file viewer before file content is loaded

- fix regression: codecs settings broken

- ensure current rev is visible when opening diff viewer

- defer author date transformation to increase loading speed

- various small fixes and GUI tweaks

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

^ permalink raw reply

* local git push bug wrt GIT_OBJECT_DIRECTORY
From: Matt Draisey @ 2005-12-30  6:08 UTC (permalink / raw)
  To: git

Using git-send-pack to push to a local repository will propagate the
environment variable GIT_OBJECT_DIRECTORY to git-receive-pack.
git-receive-pack correctly ignores GIT_DIR (as opposed to what the
documentation says) but, unfortunately, honours GIT_OBJECT_DIRECTORY.

It's not clear to me whether the correct behaviour is for git-send-pack
to clean up its environment before it execs or for git-receive-pack to
ignore most GIT variables.

Interposing a short script with env -i or env -uGIT_OBJECT_DIRECTORY is
the easiest workaround.

^ permalink raw reply

* Re: [ANNOUNCE] GIT 1.0.0b quickfix
From: H. Peter Anvin @ 2005-12-29 23:14 UTC (permalink / raw)
  To: Krzysztof Halasa
  Cc: Andreas Ericsson, Junio C Hamano, Ingo Oeser, linux-kernel,
	Linus Torvalds, Benjamin Herrenschmidt, git
In-Reply-To: <m3lkyaptwt.fsf@defiant.localdomain>

Krzysztof Halasa wrote:
> 
> This is uncertain. If the time is quantified 5 hrs might as well contain
> much less quanta than 3 kg, let alone 20 cm :-)

You're forgetting that if time is quantized, it's as part of a general 
quantization of space-time.  Thus, there would be as many quanta in 5 
hrs as in 539,626,442,400,000 cm.

	-hpa

^ permalink raw reply

* Re: Cogito: cg-push doesn't push tags?
From: Linus Torvalds @ 2005-12-29 22:10 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0512291404240.3298@g5.osdl.org>



On Thu, 29 Dec 2005, Linus Torvalds wrote:
>
> But in the meantime you can hack around it with something like
> 
> 	git send-pack <destination> $(cd .git/refs/ ; echo tags/*)
> 
> which is a silly way to list all tags ;)

Actually, I guess it should use "find tags/ -type f" or something like 
that instead of "echo tags/*". Otherwise you don't get tags with slashes 
right.

		Linus

^ permalink raw reply

* Re: Cogito: cg-push doesn't push tags?
From: Linus Torvalds @ 2005-12-29 22:08 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Git Mailing List
In-Reply-To: <43B45C39.8040501@zytor.com>



On Thu, 29 Dec 2005, H. Peter Anvin wrote:
>
> It seems that cg-push in cogito 0.16.2 doesn't push new tags when used over
> git+ssh transport?  Am I completely wet behind the ears, or is that a bug?

List the tags you want pushed. 

The git transport (whether over ssh or locally) will default to updating 
only _shared_ references. So any heads that you have updated it will 
update by default. But if you want to create a new branch or tag on the 
other end, you need to list it explicitly (and once you do, it won't do 
the default ones at all).

Now, "git fetch" has a "--tags" argument that is shorthand for "all tags", 
and I think we should add that to "git send-pack" too just because it's 
both a common operation _and_ it mirrors "git fetch". But in the meantime 
you can hack around it with something like

	git send-pack <destination> $(cd .git/refs/ ; echo tags/*)


which is a silly way to list all tags ;)

		Linus

^ permalink raw reply

* Cogito: cg-push doesn't push tags?
From: H. Peter Anvin @ 2005-12-29 21:59 UTC (permalink / raw)
  To: Git Mailing List

It seems that cg-push in cogito 0.16.2 doesn't push new tags when used 
over git+ssh transport?  Am I completely wet behind the ears, or is that 
a bug?

In particular, it seems to manifest itself when the *only* thing that 
has changed is tags.

	-hpa

^ permalink raw reply

* What's in git.git today
From: Junio C Hamano @ 2005-12-28 23:32 UTC (permalink / raw)
  To: git

GIT 1.0.6 was silently pushed out.  Again, it has one notable
fix among minor test fixes.

 - Do not mark tags fetched via --tags flag as mergeable.

   This is to fix "git pull --tags"; it tried to merge all of
   the tags by mistake --- it should not merge any of them.

I have verified that the patch by Gerrit to fix merge-order test
is correct, but have not got around to apply it yet.

The master branch has the following enhancements in addition to
what is in 1.0.6.  I intend to have 1.1 release with them early
next year, when I come back from the new year break.

 - "git clone -o branchname" to specify name of the branch used
   to keep track of the upstream (Johannes).
 
 - "core.sharedrepository" and "git init-db --shared" to help
   group writable repositories (Johannes).

 - IPV6 literal address in git networking protocol (Hideaki).

 - "git pack-redundant" is more efficient (Lukas).

 - "git describe" and associated Makefile changes to give GIT
   releases a bit more descriptive names (Linus and me).

 - "git checkout <treeish> <path>..." and "git checkout -- <path>..."
   can be used to restore named paths even from a subdirectory.

 - git-receive-pack propagates hooks' refusal to update back to
   git-send-pack.

I'll be away from the network and will be back on the second
week of January.  I wish everybody a happy new year.

^ permalink raw reply

* Re: [PATCH] Avoid allocating 0 bytes, was Re: [PATCH 4/4] git-compat-util.h: dietlibc-friendly x{malloc,realloc,calloc}
From: Johannes Schindelin @ 2005-12-28 20:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Wong, git
In-Reply-To: <Pine.LNX.4.63.0512262134290.19331@wbgn013.biozentrum.uni-wuerzburg.de>

Hi,

On Mon, 26 Dec 2005, Johannes Schindelin wrote:

> On Mon, 26 Dec 2005, Junio C Hamano wrote:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > 
> > > diff --git a/csum-file.c b/csum-file.c
> > > index 5f9249a..2c0f097 100644
> > > --- a/csum-file.c
> > > +++ b/csum-file.c
> > > @@ -121,6 +121,9 @@ int sha1write_compressed(struct sha1file
> > >  	unsigned long maxsize;
> > >  	void *out;
> > >  
> > > +	if (size == 0)
> > > +		return 0;
> > > +
> > >  	memset(&stream, 0, sizeof(stream));
> > >  	deflateInit(&stream, Z_DEFAULT_COMPRESSION);
> > >  	maxsize = deflateBound(&stream, size);
> > 
> > I think this and the one in sha1_file.c::write_sha1_file() are
> > wrong; 0-size input would not result in 0-size output.  Have you
> > tested them by actually exercising the codepaths you touched?
> 
> No, I did not test them.

Now I did. To make a long story short: this patch is wrong, wrong, wrong. 
Further, I think it is safe to assume that deflateBound() returns > 0.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 2/4] short circuit out of a few places where we would allocate zero bytes
From: H. Peter Anvin @ 2005-12-28 16:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Eric Wong, git list
In-Reply-To: <Pine.LNX.4.64.0512272036380.14098@g5.osdl.org>

Linus Torvalds wrote:
> 
> On Tue, 27 Dec 2005, H. Peter Anvin wrote:
> 
>>Better yet, either always return NULL or allocate 1 byte in that case, to get
>>consistent behaviour.
> 
> Yes. However, if you do the "return NULL" case (which is nicest), you'll 
> have to wrap "free()" too. There are some libraries where passing "free()" 
> a NULL pointer causes a SIGSEGV.
> 
> That said, I think that would be preferable to changing the source code to 
> unnecessarily avoid zero-sized allocations. Having a "xfree()" to match 
> "xmalloc()" makes sense. 
> 

Yeah, although that might break GNU code which uses xmalloc that is 
included (GNU doesn't have xfree.)  The easiest is just to allocate 1 
byte when the user asks for 0.

Anyone knows what GNU xmalloc does?

	-hpa

^ permalink raw reply

* Re: [ANNOUNCE] GIT preformatted documentation available.
From: Adrien Beau @ 2005-12-28 16:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vu0cuc4c2.fsf@assigned-by-dhcp.cox.net>

On 12/27/05, Junio C Hamano <junkio@cox.net> wrote:
>
> I was asked to provide pre-formatted man pages (and perhaps html
> pages), since the time of kernel developers are better spent on
> what they do best, rather than preparing the xmlto toolchain.
>
> I was planning to do a tarball every time I do a "release", but
> that would mean it is no better than the current way --- you
> could extract manpages out of rpm anyway.
>
> So instead, I'll do independent branches "html" and "man" in
> git.git repository to keep the preformatted documentation.

Having preformatted documentation is a great step forward, but it
would be even better if we could have it without installing some weird
RPM tool or a local copy of the Git repository -- not all my machines
have that.

Besides, it's not very beginner- or newcomer-friendly. Grab the
source; discover you need a complex toolchain to have manpages; maybe
learn sometime later that "all you had to do" was get an RPM and
explode some parts of it -- nah, it just doesn't feel right.

You're already generating five RPMs and two tarballs everytime you
release a version, would it be much more taxing to generate a third
tarball?

That said, those two new branches are neat. Thanks!

^ permalink raw reply

* Re: git-inject-tarball
From: Johannes Schindelin @ 2005-12-28 16:18 UTC (permalink / raw)
  To: Simon Richter; +Cc: Anand Kumria, git
In-Reply-To: <43B2B474.1000603@hogyros.de>

Hi,

On Wed, 28 Dec 2005, Simon Richter wrote:

> Well, the most important thing for such a tool IMO would be that it wouldn't
> overwrite any uncommitted changes, so it's not as trivial as it seems.

Ah, but that's easy:

	test -z "$(git-diff-index --name-only HEAD)" || exit 1

(This is just the idea; you should also output an error message.)

Hth,
Dscho

^ permalink raw reply

* Re: [PATCH] debian/ directory
From: Kalle Valo @ 2005-12-28 16:17 UTC (permalink / raw)
  To: git
In-Reply-To: <20051228112018.19646.qmail@c226d15586b0bf.315fe32.mid.smarden.org>

Gerrit Pape <pape@smarden.org> writes:

>> different from what I have, so I'd like to avoid potential
>> confusion and reduce work by the official maintainer and myself.
>
> Thanks.  The most notable change is that debhelper isn't used to do the
> packaging stuff, and the build-dependency has been dropped; this is
> after my personal preference.
>
> Below is the diff for reference, I think though it might be better if
> you don't include the debian/ directory in the upstream package at all.

One upside in Junio's debian packages is that they[1] work also in
sarge[2]. If he stops building them, we sarge users will miss them.
Any volunteers to maintain them, for example, through backports.org?

[1] at least git-core and git-doc work
[2] Debian 3.1

-- 
Kalle Valo

^ permalink raw reply

* Re: git-inject-tarball
From: Simon Richter @ 2005-12-28 15:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Anand Kumria, git
In-Reply-To: <Pine.LNX.4.63.0512281230070.15184@wbgn013.biozentrum.uni-wuerzburg.de>

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

Hi,

Johannes Schindelin wrote:

> Something like this?

> -- snip --
> #!/bin/sh
> 
> TARFILE="$1"
> test -z "$TARFILE" && TARFILE=-
> 
> git-ls-files -z | xargs -0 rm
> tar xvf "$TARFILE" | xargs git add
> git-update-index --remove $(git-ls-files)
> -- snap --

Well, the most important thing for such a tool IMO would be that it 
wouldn't overwrite any uncommitted changes, so it's not as trivial as it 
seems.

    Simon

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

^ permalink raw reply

* Re: git-inject-tarball
From: Johannes Schindelin @ 2005-12-28 11:42 UTC (permalink / raw)
  To: Anand Kumria; +Cc: git
In-Reply-To: <pan.2005.12.28.02.40.14.577883@progsoc.org>

Hi,

On Wed, 28 Dec 2005, Anand Kumria wrote:

> 
> Hi,
> 
> In the Everyday commands[1], there is an example of of extracting a
> tarball and then working with it.  I'm finding that I'm doing this fairly
> often -- I was just wondering if anyone had anything like a
> 'git-inject-tarball' script they'd written up.

Something like this?

-- snip --
#!/bin/sh

TARFILE="$1"
test -z "$TARFILE" && TARFILE=-

git-ls-files -z | xargs -0 rm
tar xvf "$TARFILE" | xargs git add
git-update-index --remove $(git-ls-files)
-- snap --

Notes:
	- this updates the index to match the given tarfile, you still 
	  have to commit yourself
	- it does not handle compressed tarfiles (you have to do something
	  like "cat bla.tar.gz | gzip -d | sh git-untar.sh")
	- it does not remove empty directories (i.e. if the current index 
	  contains a file "a/b", and the tarfile does not, and the
	  directory "a" is now empty, this is not handled)
	- usually, tarfiles contain files inside a subdirectory. There is
	  no facility to strip the subdirectory

Hth,
Dscho

^ permalink raw reply

* [PATCH] fix skipping merge-order test with NO_OPENSSL=1.
From: Gerrit Pape @ 2005-12-28 11:25 UTC (permalink / raw)
  To: git

Hi, when building git with NO_OPENSSL=1, the rev-list-merge-order
selftests fail.  Moving the check for 'OpenSSL not linked' in the usage
output to after test no 1 and fixing the syntax works for me.

Regards, Gerrit.


* move git-rev-list --merge-order usage check for 'OpenSSL not linked' after
  test 1.

Signed-off-by: Gerrit Pape <pape@smarden.org>

---

 t/t6001-rev-list-merge-order.sh |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

635cc4875b6bd8b6afb80742c7927ef4233ec562
diff --git a/t/t6001-rev-list-merge-order.sh b/t/t6001-rev-list-merge-order.sh
index 8ec9ebb..2f3c6f8 100755
--- a/t/t6001-rev-list-merge-order.sh
+++ b/t/t6001-rev-list-merge-order.sh
@@ -8,13 +8,6 @@ test_description='Tests git-rev-list --m
 . ./test-lib.sh
 . ../t6000lib.sh # t6xxx specific functions
 
-if git-rev-list --merge-order 2>&1 | grep 'OpenSSL not linked' >/dev/null
-then
-    test_expect_success 'skipping merge-order test' :
-    test_done
-    exit
-fi    
-
 # test-case specific test function
 check_adjacency()
 {
@@ -114,6 +107,13 @@ test_expect_success 'rev-list has correc
 19
 EOF
 
+if git-rev-list --merge-order HEAD 2>&1 | grep 'OpenSSL not linked' >/dev/null
+then
+    test_expect_success 'skipping merge-order test' :
+    test_done
+    exit
+fi
+
 normal_adjacency_count=$(git-rev-list HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
 merge_order_adjacency_count=$(git-rev-list --merge-order HEAD | check_adjacency | grep -c "\^" | tr -d ' ')
 test_expect_success '--merge-order produces as many or fewer discontinuities' '[ $merge_order_adjacency_count -le $normal_adjacency_count ]'
-- 
1.0.3

^ permalink raw reply related

* [PATCH] debian/ directory
From: Gerrit Pape @ 2005-12-28 11:20 UTC (permalink / raw)
  To: git
In-Reply-To: <7v64pbc4fh.fsf@assigned-by-dhcp.cox.net>

On Tue, Dec 27, 2005 at 12:47:14AM -0800, Junio C Hamano wrote:
> Starting from this one I won't be touching debian/ directory,
> nor supplying pre-built Debian binaries anymore.
> The official maintainer seems to be reasonably quick to package
> up things.  The packaging procedure used there seems to be quite

Yes, I'm trying to keep up with your development speed..

> different from what I have, so I'd like to avoid potential
> confusion and reduce work by the official maintainer and myself.

Thanks.  The most notable change is that debhelper isn't used to do the
packaging stuff, and the build-dependency has been dropped; this is
after my personal preference.

Below is the diff for reference, I think though it might be better if
you don't include the debian/ directory in the upstream package at all.
It may well be that I'm not always available immediately if things need
to be changed in debian/, but do as you wish.

Regards, Gerrit.


* don't use debhelper, use implicit rules.
* rename package git-tk to gitk; adjust Build-Depends*, Depends, Recommends,
  Suggests, Section, Description; Replaces: cogito (<< 0.16rc2-0) (ease
  upgrade from previous cogito packages which include git-core); Conflicts:
  git (<< 4.3.20-8) (/usr/bin/git transition).
* build with NO_OPENSSL=1 WITH_SEND_EMAIL=1 WITH_OWN_SUBPROCESS_PY=1
  prefix=/usr, python 2.3; disable t/t6001-rev-list-merge-order.sh (test
  fails with NO_OPENSSL=1).

Signed-off-by: Gerrit Pape <pape@smarden.org>

---

 debian/changelog         |  114 ++++++++++++++----------
 debian/compat            |    1 
 debian/control           |  141 +++++++++++++++++++++---------
 debian/copyright         |   38 ++++----
 debian/docs              |    1 
 debian/git-arch.files    |    2 
 debian/git-core.doc-base |   13 ---
 debian/git-core.docs     |    1 
 debian/git-core.files    |    1 
 debian/git-core.postinst |    5 +
 debian/git-core.prerm    |    5 +
 debian/git-cvs.files     |    2 
 debian/git-doc.docs      |    2 
 debian/git-doc.files     |    4 -
 debian/git-email.files   |    2 
 debian/git-svn.files     |    2 
 debian/git-tk.files      |    2 
 debian/implicit          |   93 ++++++++++++++++++++
 debian/rules             |  215 ++++++++++++++++++++++++++--------------------
 19 files changed, 410 insertions(+), 234 deletions(-)
 delete mode 100644 debian/compat
 delete mode 100644 debian/docs
 delete mode 100644 debian/git-arch.files
 delete mode 100644 debian/git-core.doc-base
 create mode 100644 debian/git-core.docs
 delete mode 100644 debian/git-core.files
 create mode 100755 debian/git-core.postinst
 create mode 100755 debian/git-core.prerm
 delete mode 100644 debian/git-cvs.files
 create mode 100644 debian/git-doc.docs
 delete mode 100644 debian/git-doc.files
 delete mode 100644 debian/git-email.files
 delete mode 100644 debian/git-svn.files
 delete mode 100644 debian/git-tk.files
 create mode 100644 debian/implicit

580d1d4562b44410f2cc5b7c1f81ced6b0b3d646
diff --git a/debian/changelog b/debian/changelog
index d7f7591..1df7491 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,73 +1,93 @@
-git-core (1.0.GIT-0) unstable; urgency=low
+git-core (1.0.5-1) unstable; urgency=low
 
-  * Post GIT 1.0 development track.
+  * new upstream point release.
+  * debian/rules: don't take upstream changelog from upstream
+    debian/changelog.
+  * debian/changelog.upstream: remove again.
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 22:28:33 -0800
+ -- Gerrit Pape <pape@smarden.org>  Tue, 27 Dec 2005 13:25:53 +0000
 
-git-core (1.0.0.GIT-0) unstable; urgency=low
+git-core (1.0.3-1) unstable; urgency=low
 
-  * Post GIT 1.0.0 development track.
+  * new upstream point release.
+  * debian/changelog.upstream: new: upstream changelog taken from upstream
+    debian/changelog.
+  * debian/rules: install debian/changelog.upstream as upstream changelog;
+    remove obsolete VERSION variable.
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 12:12:05 -0800
+ -- Gerrit Pape <pape@smarden.org>  Fri, 23 Dec 2005 14:58:14 +0000
 
-git-core (1.0.4-0) unstable; urgency=low
+git-core (1.0.0-1) unstable; urgency=medium
 
-  * GIT 1.0.4.
+  * new upstream release: GIT 1.0.0.
 
- -- Junio C Hamano <junkio@cox.net>  Sat, 24 Dec 2005 00:01:20 -0800
+ -- Gerrit Pape <pape@smarden.org>  Wed, 21 Dec 2005 16:17:18 +0000
 
-git-core (1.0.3-0) unstable; urgency=low
+git-core (0.99.9n-1) unstable; urgency=low
 
-  * GIT 1.0.3 maintenance release.
+  * new upstream version: GIT 0.99.9n aka 1.0rc6.
+  * debian/rules: rename git program in git-core package to git-scm,
+    handle /usr/bin/git program through update-alternatives (as suggested
+    by Ian Beckwith, see #342363).
+  * debian/control: git-core: Conflicts: git (<< 4.3.20-8) (closes:
+    #342363).
+  * debian/git-core.postinst, debian/git-core.prerm: new: run
+    update-alternatives --install /usr/bin/git git /usr/bin/git-scm with
+    priority 70 on configure, and --remove on remove respectively.
 
- -- Junio C Hamano <junkio@cox.net>  Thu, 22 Dec 2005 18:13:33 -0800
+ -- Gerrit Pape <pape@smarden.org>  Thu, 15 Dec 2005 11:24:51 +0000
 
-git-core (1.0.0b-0) unstable; urgency=low
+git-core (0.99.9m-1) unstable; urgency=low
 
-  * GIT 1.0.0b to include two more fixes.
+  * new upstream version: GIT 0.99.9m aka 1.0rc5.
+    * sets PYTHONPATH for selftests (fixes autobuild test failures).
+  * switch from tarball-in-tarball approach to original upstream tarball.
+  * debian/changelog: add changelog history, Junio C Hamano, Ryan Anderson,
+    Eric Biederman previously were maintaining this package unofficially.
+  * debian/control: Build-Depends: rcs (for selftests); git-core:
+    Recommends: patch, less, Suggests: cogito; git-arch: Suggests: tla,
+    bazzar; git-cvs: Depends: cvsps, Suggests: cvs; git-svn: Depends:
+    libsvn-core-perl (closes:#342617), Suggests: subversion; git-email:
+    Depends: libmail-sendmail-perl, libemail-valod-perl; update short
+    description (lots taken from upstream unofficial package, thx).
+  * debian/git-core.docs, debian/git-doc.docs: adapt.
+  * debian/rules: adapt; remove target unpack; add target patch; adapt
+    target clean.
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 13:50:21 -0800
+ -- Gerrit Pape <pape@smarden.org>  Wed, 14 Dec 2005 19:48:41 +0000
 
-git-core (1.0.0a-0) unstable; urgency=low
+git-core (0.99.9l-1) unstable; urgency=low
 
-  * GIT 1.0.0a to include the following fixes:
-  
-    - Avoid misleading success message on error (Johannes)
-    - objects/info/packs: work around bug in http-fetch.c::fetch_indices()
-    - http-fetch.c: fix objects/info/pack parsing.
-    - An off-by-one bug found by valgrind (Pavel)
+  * new upstream version.
+  * debian/rules: apply diffs with patch -p1.
+  * debian/control, debian/rules: split off git-arch, git-cvs, git-svn,
+    git-email packages, as suggested by upstream:
+    http://article.gmane.org/gmane.comp.version-control.git/13185
+  * debian/git-doc.docs: get docs from temporary install directory;
+    include *.txt docs.
+  * debian/control: git-doc: Section: doc; Suggests: git-core, git-arch,
+    git-cvs, git-svn, git-email, gitk; git-core: Suggests: git-arch,
+    git-cvs, git-svn, git-email, gitk.
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 13:17:17 -0800
+ -- Gerrit Pape <pape@smarden.org>  Mon,  5 Dec 2005 18:04:37 +0000
 
-git-core (1.0.0-0) unstable; urgency=low
+git-core (0.99.9k-1) unstable; urgency=low
 
-  * GIT 1.0.0
+  * new upstream version.
+  * debian/implicit: update to revision 1.11.
+  * debian/git-doc.docs: add git/Documentation/howto,
+    git/Documentation/technical (closes: #341178).
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 00:01:00 -0800
+ -- Gerrit Pape <pape@smarden.org>  Tue, 29 Nov 2005 21:45:53 +0000
 
-git-core (0.99.9n-0) unstable; urgency=low
+git-core (0.99.9j-1) unstable; urgency=low
 
-  * GIT 0.99.9n aka 1.0rc6
+  * initial version.
+  * debian/control: git-core: Replaces: cogito (<< 0.16rc2-0); cogito >=
+    0.16rc2-0 no longer includes the git core components, but depends on
+    the git-core package (see #338789).
 
- -- Junio C Hamano <junkio@cox.net>  Wed, 14 Dec 2005 17:27:08 -0800
-
-git-core (0.99.9m-0) unstable; urgency=low
-
-  * GIT 0.99.9m aka 1.0rc5
-
- -- Junio C Hamano <junkio@cox.net>  Sun, 11 Dec 2005 16:48:06 -0800
-
-git-core (0.99.9l-0) unstable; urgency=low
-
-  * GIT 0.99.9l aka 1.0rc4
-
- -- Junio C Hamano <junkio@cox.net>  Sat,  3 Dec 2005 23:45:23 -0800
-
-git-core (0.99.9k-0) unstable; urgency=low
-
-  * GIT 0.99.9k but not 1.0rc yet.
-
- -- Junio C Hamano <junkio@cox.net>  Fri, 25 Nov 2005 16:33:11 -0800
+ -- Gerrit Pape <pape@smarden.org>  Fri, 18 Nov 2005 22:26:36 +0000
 
 git-core (0.99.9j-0) unstable; urgency=low
 
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index b8626c4..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-4
diff --git a/debian/control b/debian/control
index ded0a57..33551b5 100644
--- a/debian/control
+++ b/debian/control
@@ -1,63 +1,118 @@
 Source: git-core
 Section: devel
 Priority: optional
-Maintainer: Junio C Hamano <junkio@cox.net>
-Build-Depends-Indep: libz-dev, libssl-dev, libcurl3-dev|libcurl3-gnutls-dev|libcurl3-openssl-dev, asciidoc (>= 7), xmlto, debhelper (>= 4.0.0), bc, libexpat-dev
-Standards-Version: 3.6.1
+Maintainer: Gerrit Pape <pape@smarden.org>
+Build-Depends: libz-dev, libcurl3-gnutls-dev, asciidoc, xmlto, libexpat1-dev, rcs
+Standards-Version: 3.6.2.0
 
 Package: git-core
 Architecture: any
-Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, rcs
-Recommends: rsync, curl, ssh, python (>= 2.4.0), less
-Suggests: cogito, patch
-Conflicts: git, cogito (<< 0.13)
-Description: The git content addressable filesystem
- GIT comes in two layers. The bottom layer is merely an extremely fast
- and flexible filesystem-based database designed to store directory trees
- with regard to their history. The top layer is a SCM-like tool which
- enables human beings to work with the database in a manner to a degree
- similar to other SCM tools.
+Depends: ${shlibs:Depends}, rcs
+Recommends: git-doc, patch, less, rsync, curl, openssh-client, python
+Suggests: git-arch, git-cvs, git-svn, git-email, gitk, cogito
+Replaces: cogito (<< 0.16rc2-0)
+Conflicts: git (<< 4.3.20-8)
+Description: content addressable filesystem
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides the git core components.
 
 Package: git-doc
+Section: doc
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, git-core
-Description: The git content addressable filesystem, Documentation
- This package contains documentation for GIT.
-
-Package: git-tk
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, tk8.4
-Description: The git content addressable filesystem, GUI add-on
- This package contains 'gitk', the git revision tree visualizer.
-
-Package: git-svn
-Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, libsvn-core-perl (>= 1.2.1)
-Suggests: subversion
-Description: The git content addressable filesystem, SVN interoperability
- This package contains 'git-svnimport', to import development history from
- SVN repositories.
+Suggests: git-core, git-arch, git-cvs, git-svn, git-email, gitk
+Description: content addressable filesystem (documentation)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides the documentation.
 
 Package: git-arch
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core
+Depends: git-core (= ${Source-Version})
+Recommends: git-doc
 Suggests: tla, bazaar
-Description: The git content addressable filesystem, GNUArch interoperability
- This package contains 'git-archimport', to import development history from
- GNUArch repositories.
+Replaces: cogito (<< 0.16rc2-0)
+Description: content addressable filesystem (arch interoperability)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides tools for importing development history from arch
+ repositories.
 
 Package: git-cvs
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, git-core, cvsps (>= 2.1)
+Depends: git-core (= ${Source-Version}), cvsps
+Recommends: git-doc
 Suggests: cvs
-Description: The git content addressable filesystem, CVS interoperability
- This package contains 'git-cvsimport', to import development history from
- CVS repositories.
+Replaces: cogito (<< 0.16rc2-0)
+Description: content addressable filesystem (cvs interoperability)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides tools for importing development history from cvs
+ repositories.
 
-Package: git-email
+Package: git-svn
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, git-core, libmail-sendmail-perl, libemail-valid-perl
-Description: The git content addressable filesystem, e-mail add-on
- This package contains 'git-send-email', to send a series of patch e-mails.
-
+Depends: git-core (= ${Source-Version}), libsvn-core-perl
+Recommends: git-doc
+Suggests: subversion
+Replaces: cogito (<< 0.16rc2-0)
+Description: content addressable filesystem (svn interoperability)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides tools for importing development history from
+ subversion repositories.
 
+Package: git-email
+Architecture: all
+Depends: git-core (= ${Source-Version}), libmail-sendmail-perl, libemail-valid-perl
+Recommends: git-doc
+Replaces: cogito (<< 0.16rc2-0)
+Description: content addressable filesystem (email add-on)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides tools for sending series of patch emails.
+
+Package: gitk
+Architecture: all
+Depends: git-core (= ${Source-Version}), tk8.4
+Recommends: git-doc
+Replaces: cogito (<< 0.16rc2-0)
+Description: content addressable filesystem (revision tree visualizer)
+ This is a stupid (but extremely fast) directory content manager.  It
+ doesn't do a whole lot, but what it 'does' do is track directory
+ contents efficiently.
+ .
+ Amongst other projects, the Linux kernel source tree is managed through
+ the git content manager.
+ .
+ This package provides the gitk program, a tcl/tk revision tree visualizer.
diff --git a/debian/copyright b/debian/copyright
index ea61eff..d84775a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,24 +1,24 @@
-This package was downloaded from ftp.kernel.org:/pub/software/scm/git/.
+This package was debianized by Sebastian Kuzminsky <seb@highlab.com>
+on Thu, 5 May 2005 10:27:14 -0600,
+and was adopted by Gerrit Pape <pape@smarden.org>
+on Wed, 16 Nov 2005 19:37:14 +0000.
 
-Upstream Author: Linus Torvalds and many others
+It was downloaded from http://www.kernel.org/pub/software/scm/git/
+
+Upstream authors: Linus Torvalds and many others
 
 Copyright:
 
- Copyright 2005, Linus Torvalds and others.
- 
-   This package is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 dated June, 1991.
-
-   This package is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this package; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+This software is copyright (c) 2005, Linus Torvalds and others.
+
+You can redistribute this software and/or modify it under the terms of
+the GNU General Public License as published by the Free Software
+Foundation; version 2 dated June, 1991.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
 
-On Debian GNU/Linux systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
+On Debian systems, the complete text of the GNU General Public License
+can be found in /usr/share/common-licenses/GPL-2 file.
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index e845566..0000000
--- a/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-README
diff --git a/debian/git-arch.files b/debian/git-arch.files
deleted file mode 100644
index d744954..0000000
--- a/debian/git-arch.files
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/git-arch*
-/usr/share/man/*/git-arch*
diff --git a/debian/git-core.doc-base b/debian/git-core.doc-base
deleted file mode 100644
index eff1a95..0000000
--- a/debian/git-core.doc-base
+++ /dev/null
@@ -1,13 +0,0 @@
-Document: git-core
-Title: git reference
-Abstract: This manual describes git
-Section: Devel
-
-Format: HTML
-Index: /usr/share/doc/git-core/git.html
-Files: /usr/share/doc/git-core/*.html
- /usr/share/doc/git-core/*/*.html
-
-Format: text
-Files: /usr/share/doc/git-core/*.txt
- /usr/share/doc/git-core/*/*.txt
diff --git a/debian/git-core.docs b/debian/git-core.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/debian/git-core.docs
@@ -0,0 +1 @@
+README
diff --git a/debian/git-core.files b/debian/git-core.files
deleted file mode 100644
index 74e4e23..0000000
--- a/debian/git-core.files
+++ /dev/null
@@ -1 +0,0 @@
-/usr
diff --git a/debian/git-core.postinst b/debian/git-core.postinst
new file mode 100755
index 0000000..230f515
--- /dev/null
+++ b/debian/git-core.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'configure' || exit 0
+update-alternatives --install /usr/bin/git git /usr/bin/git-scm 70
diff --git a/debian/git-core.prerm b/debian/git-core.prerm
new file mode 100755
index 0000000..26feff4
--- /dev/null
+++ b/debian/git-core.prerm
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'remove' || exit 0
+update-alternatives --remove git /usr/bin/git-scm
diff --git a/debian/git-cvs.files b/debian/git-cvs.files
deleted file mode 100644
index a6b40ff..0000000
--- a/debian/git-cvs.files
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/git-cvs*
-/usr/share/man/*/git-cvs*
diff --git a/debian/git-doc.docs b/debian/git-doc.docs
new file mode 100644
index 0000000..b0a52bc
--- /dev/null
+++ b/debian/git-doc.docs
@@ -0,0 +1,2 @@
+tmp/html/*
+Documentation/technical
diff --git a/debian/git-doc.files b/debian/git-doc.files
deleted file mode 100644
index 0daf545..0000000
--- a/debian/git-doc.files
+++ /dev/null
@@ -1,4 +0,0 @@
-/usr/share/doc/git-core/*.txt
-/usr/share/doc/git-core/*.html
-/usr/share/doc/git-core/*/*.html
-/usr/share/doc/git-core/*/*.txt
diff --git a/debian/git-email.files b/debian/git-email.files
deleted file mode 100644
index 2d6a51f..0000000
--- a/debian/git-email.files
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/git-send-email
-/usr/share/man/*/git-send-email.*
diff --git a/debian/git-svn.files b/debian/git-svn.files
deleted file mode 100644
index eea8d83..0000000
--- a/debian/git-svn.files
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/git-svn*
-/usr/share/man/*/git-svn*
diff --git a/debian/git-tk.files b/debian/git-tk.files
deleted file mode 100644
index 478ec94..0000000
--- a/debian/git-tk.files
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/gitk
-/usr/share/man/man1/gitk.*
diff --git a/debian/implicit b/debian/implicit
new file mode 100644
index 0000000..7a7ee98
--- /dev/null
+++ b/debian/implicit
@@ -0,0 +1,93 @@
+# $Id: implicit,v 1.11 2005/11/29 21:57:55 pape Exp $
+
+.PHONY: deb-checkdir deb-checkuid
+
+deb-checkdir:
+	@test -e debian/control || sh -cx '! : wrong directory'
+deb-checkuid:
+	@test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb: %.deb-docs %.deb-DEBIAN
+	@rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \
+	  $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \
+	  $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.udeb: %.deb-DEBIAN
+	@rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \
+	  $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.deb-checkdir:
+	@test -d debian/$* || sh -cx '! : directory debian/$* missing'
+	@test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb-docs-base:
+	: implicit
+	@rm -f debian/$*/usr/share/doc/$*/* || :
+	@install -d -m0755 debian/$*/usr/share/doc/$*
+	: debian/$*/usr/share/doc/$*/
+	@sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/'
+	@sh -cx 'install -m0644 debian/changelog \
+	  debian/$*/usr/share/doc/$*/changelog.Debian'
+	@test ! -r changelog || \
+	  sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/'
+	@test -r debian/$*/usr/share/doc/$*/changelog || \
+	  sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \
+	    debian/$*/usr/share/doc/$*/changelog'
+	@test -s debian/$*/usr/share/doc/$*/changelog || \
+	  sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog'
+	@gzip -9 debian/$*/usr/share/doc/$*/changelog*
+%.deb-docs-docs:
+	@for i in `cat debian/$*.docs 2>/dev/null || :`; do \
+	  if test -d $$i; then \
+	    sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \
+	    for j in $$i/*; do \
+	      sh -cx "install -m0644 $$j \
+	        debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \
+	    done || exit 1; \
+	    continue; \
+	  fi; \
+	  sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \
+	done
+	@test ! -r debian/$*.README.Debian || \
+	  sh -cx 'install -m0644 debian/$*.README.Debian \
+	    debian/$*/usr/share/doc/$*/README.Debian'
+	@if test -r debian/$*.NEWS.Debian; then \
+	  sh -cx 'install -m0644 debian/$*.NEWS.Debian \
+	    debian/$*/usr/share/doc/$*/NEWS.Debian && \
+	      gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \
+	fi
+%.deb-docs-examples:
+	@rm -rf debian/$*/usr/share/doc/$*/examples
+	: debian/$*/usr/share/doc/$*/examples/
+	@test ! -r debian/$*.examples || \
+	  install -d -m0755 debian/$*/usr/share/doc/$*/examples
+	@for i in `cat debian/$*.examples 2>/dev/null || :`; do \
+	  sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \
+	    || exit 1; \
+	done
+%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples
+	: debian/$*/usr/share/doc/$*/ ok
+
+%.deb-DEBIAN-base:
+	@rm -rf debian/$*/DEBIAN
+	: debian/$*/DEBIAN/
+	@install -d -m0755 debian/$*/DEBIAN
+	@for i in conffiles shlibs templates; do \
+	  test ! -r debian/$*.$$i || \
+	    sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+	      || exit 1; \
+	done
+%.deb-DEBIAN-scripts:
+	@for i in preinst prerm postinst postrm config; do \
+	  test ! -r debian/$*.$$i || \
+	    sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+	      || exit 1; \
+	done
+%.deb-DEBIAN-md5sums:
+	: debian/$*/DEBIAN/md5sums
+	@rm -f debian/$*/DEBIAN/md5sums
+	@cd debian/$* && find * -path 'DEBIAN' -prune -o \
+	  -type f -exec md5sum {} >>DEBIAN/md5sums \;
+%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \
+	  %.deb-DEBIAN-md5sums
+	: debian/$*/DEBIAN/ ok
diff --git a/debian/rules b/debian/rules
index 4ab221c..b0607ed 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,109 +1,134 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+ARCH ?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 
-CFLAGS = -g -Wall
+CC =gcc
+CFLAGS =-g -Wall
+STRIP =strip
+OPTS =NO_OPENSSL=1 WITH_SEND_EMAIL=1 WITH_OWN_SUBPROCESS_PY=1 prefix=/usr
+
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+  STRIP =: strip
+endif
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
+  CFLAGS +=-O0
 else
-       CFLAGS += -O2
+  CFLAGS +=-O2
 endif
-export CFLAGS
-
-#
-# On PowerPC we compile against the hand-crafted assembly, on all
-# other architectures we compile against GPL'ed sha1 code lifted
-# from Mozilla.  OpenSSL is strangely licensed and best avoided
-# in Debian.
-#
-HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
-ifeq (${HOST_ARCH},powerpc)
-	export PPC_SHA1=YesPlease
+ifeq (powerpc,$(ARCH))
+  OPTS +=PPC_SHA1=1
 else
-	export MOZILLA_SHA1=YesPlease
+ifeq (arm,$(ARCH))
+  OPTS +=ARM_SHA1=1
+endif
 endif
 
-# We do have the requisite perl modules in the mainline, and
-# have no reason to shy away from this script.
-export WITH_SEND_EMAIL=YesPlease
-
-PREFIX := /usr
-MANDIR := /usr/share/man/
-
-SRC    := ./
-DOC    := Documentation/
-DESTDIR  := $(CURDIR)/debian/tmp
-DOC_DESTDIR := $(DESTDIR)/usr/share/doc/git-core/
-MAN_DESTDIR := $(DESTDIR)/$(MANDIR)
-
-build: debian/build-stamp
-debian/build-stamp:
-	dh_testdir
-	$(MAKE) prefix=$(PREFIX) PYTHON_PATH=/usr/bin/python2.4 all test doc
-	touch debian/build-stamp
-
-debian-clean:
-	dh_testdir
-	dh_testroot
-	rm -f debian/build-stamp
-	dh_clean
+TMP =$(shell pwd)/tmp
+GIT =$(shell pwd)/debian/git
 
-clean: debian-clean
-	$(MAKE) clean
+patch: deb-checkdir patch-stamp
+patch-stamp:
+	for i in `ls -t debian/diff/*.diff || :`; do \
+	  patch -p1 <$$i || exit 1; \
+	done
+	touch patch-stamp
+
+build: deb-checkdir build-arch-stamp build-indep-stamp
+build-arch-stamp: patch-stamp
+	-gcc -v
+	# don't run git-rev-list --merge-order tests
+	rm -f t/t6001-rev-list-merge-order.sh
+	$(MAKE) all test CC='$(CC)' CFLAGS='$(CFLAGS)' $(OPTS)
+	$(MAKE) -CDocumentation man
+	touch build-arch-stamp
+build-indep-stamp: build-arch-stamp
+	$(MAKE) -CDocumentation man html
+	touch build-indep-stamp
 
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k 
-	dh_installdirs 
-
-	make DESTDIR=$(DESTDIR) prefix=$(PREFIX) mandir=$(MANDIR) \
-		install install-doc
-
-	make -C Documentation DESTDIR=$(DESTDIR) prefix=$(PREFIX) \
-		WEBDOC_DEST=$(DOC_DESTDIR) install-webdoc
-
-	dh_movefiles -p git-arch
-	dh_movefiles -p git-cvs
-	dh_movefiles -p git-svn
-	dh_movefiles -p git-tk
-	dh_movefiles -p git-email
-	dh_movefiles -p git-doc
-	dh_movefiles -p git-core
-	find debian/tmp -type d -o -print | sed -e 's/^/? /'
-
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs -a
-	dh_installdocs -a
-	dh_strip -a
-	dh_compress  -a
-	dh_fixperms -a
-	dh_perl -a
-	dh_makeshlibs -a
-	dh_installdeb -a
-	dh_shlibdeps -a
-	dh_gencontrol -a
-	dh_md5sums -a
-	dh_builddeb -a
-
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs -i
-	dh_installdocs -i
-	dh_compress  -i
-	dh_fixperms -i
-	dh_makeshlibs -i
-	dh_installdeb -i
-	dh_shlibdeps -i
-	dh_gencontrol -i
-	dh_md5sums -i
-	dh_builddeb -i
+clean: deb-checkdir deb-checkuid
+	$(MAKE) clean
+	rm -f git-send-email compat/subprocess.pyc
+	! test -e patch-stamp || \
+	  for i in `ls -tr debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
+	rm -rf '$(TMP)'
+	rm -f patch-stamp build-arch-stamp build-indep-stamp
+	rm -rf '$(GIT)'-core '$(GIT)'-doc '$(GIT)'-arch '$(GIT)'-cvs \
+	  '$(GIT)'-svn '$(GIT)'-email '$(GIT)'k
+	rm -f debian/files debian/substvars changelog
+
+install: install-arch install-indep
+install-arch: deb-checkdir deb-checkuid build-arch-stamp
+	# git-core
+	rm -rf '$(GIT)-core'
+	install -d -m0755 '$(GIT)'-core/usr/bin
+	$(MAKE) install install-doc $(OPTS) DESTDIR='$(GIT)'-core
+	# don't include arch, cvs, svn, email tools, and gitk program
+	for i in git-arch git-cvs git-svn git-send-email; do \
+	  rm -f '$(GIT)'-core/usr/bin/$$i*; \
+	done
+	rm -f '$(GIT)'-core/usr/bin/gitk
+	# handle git program through alternatives mechanism (see #342363), rename
+	# to git-scm
+	mv -f '$(GIT)'-core/usr/bin/git '$(GIT)'-core/usr/bin/git-scm
+	for i in '$(GIT)'-core/usr/bin/*; do \
+	  test "`head -c2 $$i`" = '#!' || $(STRIP) -R .comment -R .note $$i; \
+	done
+	install -d -m0755 '$(GIT)'-core/usr/share
+	mv -f '$(GIT)'-core/usr/man '$(GIT)'-core/usr/share/
+	# don't include arch, cvs, svn, email, and gitk man pages
+	for i in git-arch git-cvs git-svn git-send-email; do \
+	  rm -f '$(GIT)'-core/usr/share/man/man1/$$i*; \
+	done
+	rm -f '$(GIT)'-core/usr/share/man/man1/gitk.1
+	chmod 0644 '$(GIT)'-core/usr/share/man/man?/*.[0-9]
+	gzip -9 '$(GIT)'-core/usr/share/man/man?/*.[0-9]
+	# no upstream changelog
+	cp /dev/null changelog
+install-indep: build-arch-stamp build-indep-stamp
+	rm -rf '$(TMP)'
+	install -d -m0755 '$(TMP)'
+	$(MAKE) install install-doc $(OPTS) DESTDIR='$(TMP)'
+	$(MAKE) -CDocumentation install-webdoc WEBDOC_DEST='$(TMP)'/html \
+	  2>/dev/null
+	# git-doc
+	rm -rf '$(GIT)'-doc
+	install -d -m0755 '$(GIT)'-doc
+	# git-arch, git-cvs, git-svn, git-email
+	for i in arch cvs svn email; do \
+	  rm -rf '$(GIT)'-$$i && \
+	  install -d -m0755 '$(GIT)'-$$i/usr/bin && \
+	  install -m0755 '$(TMP)'/usr/bin/git-*$$i* '$(GIT)'-$$i/usr/bin/ && \
+	  install -d -m0755 '$(GIT)'-$$i/usr/share/man/man1 && \
+	  install -m0644 '$(TMP)'/usr/man/man1/git-*$$i* \
+	    '$(GIT)'-$$i/usr/share/man/man1/ && \
+	  gzip -9 '$(GIT)'-$$i/usr/share/man/man1/*.1 || exit 1; \
+	done
+	# gitk
+	rm -rf '$(GIT)'k
+	install -d -m0755 '$(GIT)'k/usr/bin
+	install -m0755 '$(TMP)'/usr/bin/gitk '$(GIT)'k/usr/bin/gitk
+	install -d -m0755 '$(GIT)'k/usr/share/man/man1
+	install -m0644 '$(TMP)'/usr/man/man1/gitk.1 \
+	  '$(GIT)'k/usr/share/man/man1/
+	gzip -9 '$(GIT)'k/usr/share/man/man1/*.1
+	# no upstream changelog
+	cp /dev/null changelog
 
 binary: binary-arch binary-indep
+binary-arch: install-arch git-core.deb
+	rm -f debian/substvars
+	dpkg-shlibdeps '$(GIT)'-core/usr/bin/*
+	dpkg-gencontrol -isp -pgit-core -P'$(GIT)'-core
+	dpkg -b '$(GIT)'-core ..
+binary-indep: install-indep git-doc.deb git-arch.deb git-cvs.deb git-svn.deb \
+	  git-email.deb gitk.deb
+	rm -f debian/substvars
+	for i in -doc -arch -cvs -svn -email k; do \
+	  dpkg-gencontrol -isp -pgit$$i -P'$(GIT)'$$i && \
+	  dpkg -b '$(GIT)'$$i .. || exit 1; \
+	done
+
+.PHONY: patch build clean install install-arch install-indep binary \
+	  binary-arch binary-indep
 
-.PHONY: build clean binary install clean debian-clean
+include debian/implicit
-- 
1.0.3

^ permalink raw reply related

* git-inject-tarball
From: Anand Kumria @ 2005-12-28  2:40 UTC (permalink / raw)
  To: git


Hi,

In the Everyday commands[1], there is an example of of extracting a
tarball and then working with it.  I'm finding that I'm doing this fairly
often -- I was just wondering if anyone had anything like a
'git-inject-tarball' script they'd written up.

Thanks,
Anand

[1]: http://www.kernel.org/pub/software/scm/git/docs/everyday.html

^ permalink raw reply

* Re: [PATCH 2/4] short circuit out of a few places where we would allocate zero bytes
From: Junio C Hamano @ 2005-12-28  5:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0512272036380.14098@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> That said, I think that would be preferable to changing the source code to 
> unnecessarily avoid zero-sized allocations.

Yes, that has essentially been the plan (according to the
discussion lead to 7e4a2a848377241b8fb4f624d1151bbf2f8d5814
commit on the list).

After eradicating zero-sized allocations where that change makes
the overall code cleaner (which Johannes and Eric did most of
the heavylifting and I think mostly done), we would apply
something like this, instead of doing x*alloc(size ? size : 1)
at the calling site.

About die(), I think the current code structure is fine.  If we
were doing a library, propagating NULL from C library *alloc()
back to our caller and having the caller deal with it is the
right thing, but most of the callers of x*alloc() are our main
programs and there aren't much they can do when we run out of
memory.

---
diff --git a/git-compat-util.h b/git-compat-util.h
index 0c98c99..a71728e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -63,6 +63,8 @@ extern char *gitstrcasestr(const char *h
 static inline void *xmalloc(size_t size)
 {
 	void *ret = malloc(size);
+	if (!ret && !size)
+		ret = malloc(1); /* funny c library */
 	if (!ret)
 		die("Out of memory, malloc failed");
 	return ret;
@@ -71,6 +73,8 @@ static inline void *xmalloc(size_t size)
 static inline void *xrealloc(void *ptr, size_t size)
 {
 	void *ret = realloc(ptr, size);
+	if (!ret && !size)
+		ret = realloc(ptr, 1); /* funny c library */
 	if (!ret)
 		die("Out of memory, realloc failed");
 	return ret;
@@ -79,6 +83,8 @@ static inline void *xrealloc(void *ptr, 
 static inline void *xcalloc(size_t nmemb, size_t size)
 {
 	void *ret = calloc(nmemb, size);
+	if (!ret && (!nmemb || !size))
+		ret = calloc(1, 1); /* funny c library */
 	if (!ret)
 		die("Out of memory, calloc failed");
 	return ret;

^ permalink raw reply related

* Re: [PATCH 2/4] short circuit out of a few places where we would allocate zero bytes
From: Linus Torvalds @ 2005-12-28  4:38 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Eric Wong, git list
In-Reply-To: <43B21312.50603@zytor.com>



On Tue, 27 Dec 2005, H. Peter Anvin wrote:
> 
> Better yet, either always return NULL or allocate 1 byte in that case, to get
> consistent behaviour.

Yes. However, if you do the "return NULL" case (which is nicest), you'll 
have to wrap "free()" too. There are some libraries where passing "free()" 
a NULL pointer causes a SIGSEGV.

That said, I think that would be preferable to changing the source code to 
unnecessarily avoid zero-sized allocations. Having a "xfree()" to match 
"xmalloc()" makes sense. 

		Linus

^ permalink raw reply

* Re: [PATCH 2/4] short circuit out of a few places where we would allocate zero bytes
From: H. Peter Anvin @ 2005-12-28  4:22 UTC (permalink / raw)
  To: Eric Wong; +Cc: git list
In-Reply-To: <20051224121243.GA3963@mail.yhbt.net>

Eric Wong wrote:
> dietlibc versions of malloc, calloc and realloc all return NULL if
> they're told to allocate 0 bytes, causes the x* wrappers to die().
> 
> There are several more places where these calls could end up asking
> for 0 bytes, too...
> 
> Maybe simply not die()-ing in the x* wrappers if 0/NULL is returned
> when the requested size is zero is a safer and easier way to go.
> 

Better yet, either always return NULL or allocate 1 byte in that case, 
to get consistent behaviour.

	-hpa

^ permalink raw reply

* Re: Add a "git-describe" command
From: Johannes Schindelin @ 2005-12-28  2:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7j9q3vdu.fsf@assigned-by-dhcp.cox.net>

Hi,

On Tue, 27 Dec 2005, Junio C Hamano wrote:

> One problem with git-describe is that getting tags is a concious
> user action, and you need to do "git fetch --tags" from time to
> time in order to see the v1.0.4-g6e9961d6 name.

This is probably the biggest problem. I trust you to set the correct 
version in the Makefile just before tagging it.

Also, Linus hinted at similarities between git-describe and git-name-rev:

---
[PATCH] Teach name-rev to understand the "--inverse" flag

If "--inverse" is passed to name-rev, instead of naming the given revs
by the available refs, it does the opposite. The output is sorted by
distance, i.e. how many hops are between the rev and the ref. If the ref is
not an ancestor of the rev, the distance is inifinite, and the name is
undefined.

You can combine "--inverse" with "--tags", in effect getting the list of tags
ordered such that the tag describing the rev best comes first.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	I guess this is what Linus has been hinting at when he said that
	git-name-rev could be adapted to achieve something similar to
	git-describe.

 name-rev.c |   85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 78 insertions(+), 7 deletions(-)

b1831f3f66f659445d2628dda73a1d79fc8c3b6f
diff --git a/name-rev.c b/name-rev.c
index 65333d4..4f7c04e 100644
--- a/name-rev.c
+++ b/name-rev.c
@@ -5,19 +5,21 @@
 #include "refs.h"
 
 static const char name_rev_usage[] =
-	"git-name-rev [--tags] ( --all | --stdin | commitish [commitish...] )\n";
+	"git-name-rev [--tags] ( --all | --stdin | \n"
+	"                       [--inverse] commitish [commitish...] )\n";
 
 typedef struct rev_name {
 	const char *tip_name;
 	int merge_traversals;
 	int generation;
+	int distance;
 } rev_name;
 
 static long cutoff = LONG_MAX;
 
 static void name_rev(struct commit *commit,
 		const char *tip_name, int merge_traversals, int generation,
-		int deref)
+		int distance, int deref)
 {
 	struct rev_name *name = (struct rev_name *)commit->object.util;
 	struct commit_list *parents;
@@ -50,6 +52,7 @@ copy_data:
 		name->tip_name = tip_name;
 		name->merge_traversals = merge_traversals;
 		name->generation = generation;
+		name->distance = distance;
 	} else
 		return;
 
@@ -66,10 +69,10 @@ copy_data:
 				sprintf(new_name, "%s^%d", tip_name, parent_number);
 
 			name_rev(parents->item, new_name,
-				merge_traversals + 1 , 0, 0);
+				merge_traversals + 1 , 0, distance + 1, 0);
 		} else {
 			name_rev(parents->item, tip_name, merge_traversals,
-				generation + 1, 0);
+				generation + 1, distance + 1, 0);
 		}
 	}
 }
@@ -98,7 +101,7 @@ static int name_ref(const char *path, co
 		while ((p = strchr(path, '/')))
 			path = p+1;
 
-		name_rev(commit, strdup(path), 0, 0, deref);
+		name_rev(commit, strdup(path), 0, 0, 0, deref);
 	}
 	return 0;
 }
@@ -118,12 +121,56 @@ static const char* get_rev_name(struct o
 
 	return buffer;
 }
-	
+
+typedef struct {
+	const char* name;
+	struct object* o;
+} named_commit_t;
+static named_commit_t* ref_list = NULL;
+static int ref_count = 0;
+
+static int inverse_build_ref_list(const char *path, const unsigned char *sha1)
+{
+	struct object *o = deref_tag(parse_object(sha1), path, 0);
+
+	if ((!tags_only || !strncmp(path, "refs/tags/", 10)) &&
+			o->type == commit_type) {
+		struct commit* commit = (struct commit*)o;
+
+		if (cutoff > commit->date)
+			cutoff = commit->date;
+
+		if ((ref_count % 256) == 0)
+			ref_list = xrealloc(ref_list,
+				sizeof(named_commit_t*) * (ref_count + 256));
+		ref_list[ref_count].name = strdup(path);
+		ref_list[ref_count].o = (struct object*)commit;
+		ref_count++;
+	}
+	return 0;
+}
+
+static int name_comp(const void* a, const void* b)
+{
+	const rev_name* c = ((const named_commit_t*)a)->o->util;
+	const rev_name* d = ((const named_commit_t*)b)->o->util;
+
+	if (!c)
+		return 1;
+	if (!d)
+		return -1;
+	if (c->distance > d->distance)
+		return 1;
+	if (c->distance < d->distance)
+		return -1;
+	return 0;
+}
+
 int main(int argc, char **argv)
 {
 	struct object_list *revs = NULL;
 	struct object_list **walker = &revs;
-	int as_is = 0, all = 0, transform_stdin = 0;
+	int as_is = 0, all = 0, inverse = 0, transform_stdin = 0;
 
 	setup_git_directory();
 
@@ -142,6 +189,9 @@ int main(int argc, char **argv)
 			} else if (!strcmp(*argv, "--tags")) {
 				tags_only = 1;
 				continue;
+			} else if (!strcmp(*argv, "--inverse")) {
+				inverse = 1;
+				continue;
 			} else if (!strcmp(*argv, "--all")) {
 				if (argc > 1)
 					die("Specify either a list, or --all, not both!");
@@ -181,6 +231,27 @@ int main(int argc, char **argv)
 		walker = &((*walker)->next);
 	}
 
+	if (inverse) {
+		int i;
+
+		if (transform_stdin || all || !revs)
+			usage(name_rev_usage);
+
+		for_each_ref(inverse_build_ref_list);
+		
+		tags_only = 0;
+		for (; revs; revs = revs->next)
+			name_ref(revs->name, revs->item->sha1);
+
+		qsort(ref_list, ref_count, sizeof(named_commit_t), name_comp);
+
+		for (i = 0; i < ref_count; i++)
+			printf("%s %s\n", ref_list[i].name,
+				get_rev_name(ref_list[i].o));
+
+		return 0;
+	}
+
 	for_each_ref(name_ref);
 
 	if (transform_stdin) {
-- 
1.0.GIT

^ permalink raw reply related

* [PATCH 5/6] git-describe: documentation.
From: Junio C Hamano @ 2005-12-28  0:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0512241409300.14098@g5.osdl.org>


Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 Documentation/git-describe.txt |   79 ++++++++++++++++++++++++++++++++++++++++
 Documentation/git.txt          |    3 ++
 2 files changed, 82 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/git-describe.txt

82c11e802b05278d902138abc627982273b777c7
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
new file mode 100644
index 0000000..0efe82a
--- /dev/null
+++ b/Documentation/git-describe.txt
@@ -0,0 +1,79 @@
+git-describe(1)
+===============
+
+NAME
+----
+git-describe - Show the most recent tag that is reachable from a commit.
+
+
+SYNOPSIS
+--------
+'git-describe' [--all] [--tags] [--abbrev=<n>] <committish>...
+
+DESCRIPTION
+-----------
+The command finds the most recent tag that is reachable from a
+commit, and if the commit itself is pointed at by the tag, shows
+the tag.  Otherwise, it suffixes the tag name with abbreviated
+object name of the commit.
+
+
+OPTIONS
+-------
+<committish>::
+	The object name of the comittish. 
+
+--all::
+	Instead of using only the annotated tags, use any ref
+	found in `.git/refs/`.
+
+--tags::
+	Instead of using only the annotated tags, use any tag
+	found in `.git/refs/tags`.
+
+--abbrev=<n>::
+	Instead of using the default 8 hexadecimal digits as the
+	abbreviated object name, use <n> digits.
+
+
+EXAMPLES
+--------
+
+With something like git.git current tree, I get:
+
+	[torvalds@g5 git]$ git-describe parent
+	v1.0.4-g2414721b
+
+i.e. the current head of my "parent" branch is based on v1.0.4,
+but since it has a few commits on top of that, it has added the
+git hash of the thing to the end: "-g" + 8-char shorthand for
+the commit `2414721b194453f058079d897d13c4e377f92dc6`.
+
+Doing a "git-describe" on a tag-name will just show the tag name:
+
+	[torvalds@g5 git]$ git-describe v1.0.4
+	v1.0.4
+
+With --all, the command can use branch heads as references, so
+the output shows the reference path as well:
+
+	[torvalds@g5 git]$ git describe --all --abbrev=4 v1.0.5^2
+	tags/v1.0.0-g975b
+
+	[torvalds@g5 git]$ git describe --all HEAD^
+	heads/lt/describe-g975b
+
+
+Author
+------
+Written by Linus Torvalds <torvalds@osdl.org>, but somewhat
+butchered by Junio C Hamano <junkio@cox.net>
+
+Documentation
+--------------
+Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 5f068c2..90c5bfa 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -139,6 +139,9 @@ Interrogation commands
 gitlink:git-cat-file[1]::
 	Provide content or type/size information for repository objects.
 
+gitlink:git-describe[1]::
+	Show the most recent tag that is reachable from a commit.
+
 gitlink:git-diff-index[1]::
 	Compares content and mode of blobs between the index and repository.
 
-- 
1.0.5-geb9d

^ permalink raw reply related

* [PATCH 4/6] git-describe: still prefer annotated tag under --all and --tags
From: Junio C Hamano @ 2005-12-28  0:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0512241409300.14098@g5.osdl.org>

Even though --all and --tags can be used to include non
annotated tags in the reference point candidates, prefer to use
annotated tags if there are more than one refs that name the
same commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 describe.c |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

43214fab3416d54dcf41a8f89c59484e9c930b23
diff --git a/describe.c b/describe.c
index ee38f5f..84d96b5 100644
--- a/describe.c
+++ b/describe.c
@@ -17,6 +17,7 @@ static int abbrev = DEFAULT_ABBREV;
 static int names = 0, allocs = 0;
 static struct commit_name {
 	const struct commit *commit;
+	int prio; /* annotated tag = 2, tag = 1, head = 0 */
 	char path[];
 } **name_array = NULL;
 
@@ -33,13 +34,16 @@ static struct commit_name *match(struct 
 	return NULL;
 }
 
-static void add_to_known_names(const char *path, const struct commit *commit)
+static void add_to_known_names(const char *path,
+			       const struct commit *commit,
+			       int prio)
 {
 	int idx;
 	int len = strlen(path)+1;
 	struct commit_name *name = xmalloc(sizeof(struct commit_name) + len);
 
 	name->commit = commit;
+	name->prio = prio; 
 	memcpy(name->path, path, len);
 	idx = names;
 	if (idx >= allocs) {
@@ -53,23 +57,32 @@ static void add_to_known_names(const cha
 static int get_name(const char *path, const unsigned char *sha1)
 {
 	struct commit *commit = lookup_commit_reference_gently(sha1, 1);
+	struct object *object;
+	int prio;
+
 	if (!commit)
 		return 0;
+	object = parse_object(sha1);
 	/* If --all, then any refs are used.
 	 * If --tags, then any tags are used.
 	 * Otherwise only annotated tags are used.
 	 */
+	if (!strncmp(path, "refs/tags/", 10)) {
+		if (object->type == tag_type)
+			prio = 2;
+		else
+			prio = 1;
+	}
+	else
+		prio = 0;
+
 	if (!all) {
-		if (strncmp(path, "refs/tags/", 10))
+		if (!prio)
+			return 0;
+		if (!tags && prio < 2)
 			return 0;
-		if (!tags) {
-			struct object *object;
-			object = parse_object(sha1);
-			if (object->type != tag_type)
-				return 0;
-		}
 	}
-	add_to_known_names(all ? path : path + 10, commit);
+	add_to_known_names(all ? path + 5 : path + 10, commit, prio);
 	return 0;
 }
 
@@ -79,6 +92,9 @@ static int compare_names(const void *_a,
 	struct commit_name *b = *(struct commit_name **)_b;
 	unsigned long a_date = a->commit->date;
 	unsigned long b_date = b->commit->date;
+
+	if (a->prio != b->prio)
+		return b->prio - a->prio;
 	return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
 }
 
-- 
1.0.5-geb9d

^ permalink raw reply related

* [PATCH 6/6] Makefile: use git-describe to mark the git version.
From: Junio C Hamano @ 2005-12-28  0:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0512241409300.14098@g5.osdl.org>

Note: with this commit, the GIT maintainer workflow must change.
GIT-VERSION-GEN is now the file to munge when the default
version needs to be changed, not Makefile.  The tag needs to be
pushed into the repository to build the official tarball and
binary package beforehand.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---
 * Only lightly tested.  Especially bootstrapping might be
   fishy, but I'll be heading off to Japan for fishful new year
   meals in a few days ;-), so...

 .gitignore      |    1 +
 GIT-VERSION-GEN |   18 ++++++++++++++++++
 Makefile        |   10 ++++++++--
 3 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100755 GIT-VERSION-GEN

8e517cdeb5644b9857c8a9d8ce204ec9b7405297
diff --git a/.gitignore b/.gitignore
index 6bd508e..47d76f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+GIT-VERSION-FILE
 git
 git-add
 git-am
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
new file mode 100755
index 0000000..196402c
--- /dev/null
+++ b/GIT-VERSION-GEN
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+GVF=GIT-VERSION-FILE
+
+VN=$(git describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
+VN=$(expr "$VN" : v'\(.*\)')
+if test -r $GVF
+then
+	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
+else
+	VC=unset
+fi
+test "$VN" = "$VC" || {
+	echo >&2 "GIT_VERSION = $VN"
+	echo "GIT_VERSION = $VN" >$GVF
+}
+
+
diff --git a/Makefile b/Makefile
index 47e7898..6f1d123 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,9 @@ all:
 # Define USE_STDEV below if you want git to care about the underlying device
 # change being considered an inode change from the update-cache perspective.
 
-GIT_VERSION = 1.0.GIT
+GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
+	@sh ./GIT-VERSION-GEN
+-include GIT-VERSION-FILE
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
@@ -369,7 +371,7 @@ all: $(ALL_PROGRAMS)
 all:
 	$(MAKE) -C templates
 
-git$X: git.c $(LIB_FILE) Makefile
+git$X: git.c $(LIB_FILE) Makefile GIT-VERSION-FILE
 	$(CC) -DGIT_EXEC_PATH='"$(bindir)"' -DGIT_VERSION='"$(GIT_VERSION)"' \
 		$(CFLAGS) $(COMPAT_CFLAGS) -o $@ $(filter %.c,$^) $(LIB_FILE)
 
@@ -499,6 +501,7 @@ deb: dist
 ### Cleaning rules
 
 clean:
+	rm -f GIT-VERSION-FILE
 	rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE)
 	rm -f $(PROGRAMS) $(SIMPLE_PROGRAMS) git$X
 	rm -f $(filter-out gitk,$(SCRIPTS))
@@ -511,3 +514,6 @@ clean:
 	$(MAKE) -C templates clean
 	$(MAKE) -C t/ clean
 
+.PHONY: all install clean
+.PHONY: .FORCE-GIT-VERSION-FILE
+
-- 
1.0.5-geb9d

^ 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