* Re: [PATCH] archimport improvements
From: Martin Langhoff @ 2005-11-14 22:38 UTC (permalink / raw)
To: Eric Wong; +Cc: git list
In-Reply-To: <20051112202150.GA2037@Muzzle>
Eric,
thanks for resending those so quickly. I think I'm going to sit on the
'overhaul of changeset application' patch a bit -- I'll test & ack
your other patches for merge soonish but I want to review and test
this one carefully.
My main concern is that it seems to be calling tla get for each
revision that it imports. For large trees, this is slow. I would be
much happier with a fast Perl-based approach. Have you got a public
repo with directory renames?
Additional comments follow...
On 11/13/05, Eric Wong <normalperson@yhbt.net> wrote:
> > > * Identify git branches as an Arch "archive,category<--branch>--version"
> > > Anything less than that is ambiguous as far as history and patch
> > > relationships go.
> >
> > These bug/sanity fixes are _good_. As you mention, I wasn't aware that
> > patchnames could show up not having a --branch part. Tricky...
>
> Thanks. I got lazy one day and started ignoring --branch on some of my
> personal projects to save my fingers :)
Yup, makes sense. My concern now is that existing imports will change
the name of branches and tags going forward. Can I ask you to resend
that patch with the new branchname mangling as default, and the old
one as optional?
I know it'll force us to go back to using shellquote, but I am not too
worried by that dependency at the moment.
> > > Current weaknesses:
> > >
> > > * (Present in the original code as well).
> > > The code still assumes that dates in commit logs can be trusted, which is
> > > fine in most cases, but a wayward branch can screw up git-archimport and
> > > cause parents to be missed.
> >
> > Fair enough. You mention an alternative strategy (tla ancestry) --
> > have you tried it at all?
>
> No, not yet.
Also interested in this if you get around to it.
cheers,
martin
^ permalink raw reply
* [PATCH] cogito: more files to ignore
From: Pavel Roskin @ 2005-11-14 22:49 UTC (permalink / raw)
To: git, Petr Baudis
Ignore cogito tarballs generated by "make dist" and
Documentation/tutorial-script/Playground generated by
Documentation/tutorial-script/script.sh
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/.gitignore b/.gitignore
index 396ceb0..8fd37ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ build-stamp
configure-stamp
debian/files
debian/cogito/*
+cogito-*.tar.gz
diff --git a/Documentation/tutorial-script/.gitignore b/Documentation/tutorial-script/.gitignore
index ed6a55f..f1c7834 100644
--- a/Documentation/tutorial-script/.gitignore
+++ b/Documentation/tutorial-script/.gitignore
@@ -1 +1,2 @@
!*.txt
+Playground
--
Regards,
Pavel Roskin
^ permalink raw reply related
* [PATCH] cg-status: quote head name
From: Pavel Roskin @ 2005-11-14 22:57 UTC (permalink / raw)
To: git, Petr Baudis
cg-status should quote head name to deal with branches that have active
characters (e.g. spaces) in the name.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/cg-status b/cg-status
index b67f505..2cb86be 100755
--- a/cg-status
+++ b/cg-status
@@ -124,8 +124,8 @@ if [ "$gitstatus" ]; then
echo "Heads:"
for head in $_git/refs/heads/*; do
- headsha1=$(cat $head)
- headname=$(basename $head)
+ headsha1=$(cat "$head")
+ headname=$(basename "$head")
[ "$headname" = "cg-seek-point" ] && continue
cf=" "; rf=" "
[ "$headname" = "$_git_head" ] && cf=">"
--
Regards,
Pavel Roskin
^ permalink raw reply related
* git's rev-parse.c function show_datestring presumes gnu date
From: Randal L. Schwartz @ 2005-11-14 23:02 UTC (permalink / raw)
To: git
git-rev-parse calls GNU date externally for --since, --after, --before,
and --until, which will fail on at least OpenBSD and Mac OSX (Darwin).
At a minimum, this code can be commented out on such platforms. Better
would be to have some sort of suitable replacement.
Perhaps the Makefile can test if "date" is GNU date as well.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply
* Re: [PATCH 1/1] git-cvsexportcommit.perl: Fix usage() output.
From: Junio C Hamano @ 2005-11-14 23:04 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Kevin Geiss, git
In-Reply-To: <46a038f90511141420u11e396d3q9a6710c79abe0ca3@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
> ... I'm happy with Kevin's patches -- what's the ideal
> workflow for this? Is the sign-off line important enough that
> I should setup a public repo for you to pull from?
Given that you are far more familiar with that part of the code,
and I suspect I'd be asking your help in archimport as well, a
repo I can pull from would be more preferable (and sign-off by
you is certainly an added bonus). If a public repo is too much
hassle, however, e-mail forwarding is perfectly fine as well.
Your choice.
BTW, there is no "mana" points involved in deciding if I
directly pull from somewhere. Even if that were the case, you
have accumulated enough of them already ;-).
> BTW, File::Basename is a standard library usually installed w perl --
> it shouldn't add any painful dependencies. Not sure if that matters.
Although some might find "${\function}" expansion too cute for
their taste, Keven's code is fine as-is for me. I launched the
baloon just wanting to see what others have to say ;-).
^ permalink raw reply
* Re: git's rev-parse.c function show_datestring presumes gnu date
From: Linus Torvalds @ 2005-11-14 23:08 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: git
In-Reply-To: <86zmo6vnnj.fsf@blue.stonehenge.com>
On Mon, 14 Nov 2005, Randal L. Schwartz wrote:
>
> git-rev-parse calls GNU date externally for --since, --after, --before,
> and --until, which will fail on at least OpenBSD and Mac OSX (Darwin).
>
> At a minimum, this code can be commented out on such platforms. Better
> would be to have some sort of suitable replacement.
I really wanted to do the date parsing myself, rather than call out to
date, but I got lazy.
It shouldn't be all that difficult to do some trivial cases (gnu date
handles totally insane things, we could easily do with just a simpler
thing).
Anybody want to handle
- partial real dates ("August 5th" - figure out the year automatically,
and notice that it might be _last_ year since the date only makes
sense if it's in the past)
- relative dates ("5 days ago", "yesterday", "one week ago")
It shouldn't be that hard, and if you do _not_ touch the date.c functions
(which have to be totally dependable) you can be pretty damn lazy and lax
and just guess a lot.
Linus
^ permalink raw reply
* [PATCH] cogito tutorial-script - more testsuite improvements
From: Pavel Roskin @ 2005-11-14 23:14 UTC (permalink / raw)
To: git, Petr Baudis
Report line in should_fail(). Require bash, since reporting calling
line is bash specific. Set "-e" flag in the script, so that e.g.
"bash -x script.sh" cannot cancel it accidentally. Trap and report
unexpected errors.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/Documentation/tutorial-script/script.sh b/Documentation/tutorial-script/script.sh
index 8cdfe36..bc70b77 100755
--- a/Documentation/tutorial-script/script.sh
+++ b/Documentation/tutorial-script/script.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash
#
# FIXME: This script has many GITisms. Some of them are unnecessary, while
# some stem from missing Cogito features (especially no support for pushing
@@ -10,10 +10,16 @@
# for executing this script to make sure we did not break it with any
# Cogito changes.
should_fail () {
- echo "Expected failure, got success - aborting" >&2
+ echo "Expected failure, got success on line ${BASH_LINENO[0]}" \
+ "- aborting" >&2
+ trap - exit
exit 1
}
+# Conversely, if something fails when it shouldn't, report it and exit.
+set -e
+trap 'echo >&2 "Unexpected error $? on line $LINENO"; exit 1' exit
+
### Set up playground
sh 0000-playground.sh
@@ -309,4 +315,5 @@ cg-add stack.h
cg-commit -m "Merge with 0.4"
# Great, we are done.
+trap - exit
echo "Script completed successfully!"
--
Regards,
Pavel Roskin
^ permalink raw reply related
* [PATCH 1/3] Document the -n command-line option to git-unpack-objects
From: Nikolai Weibull @ 2005-11-14 23:20 UTC (permalink / raw)
To: git; +Cc: Nikolai Weibull
In-Reply-To: <11320104011696-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
This patch documents the -n command-line option to git-unpack-objects,
as it was previously undocumented.
Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
---
Documentation/git-unpack-objects.txt | 6 +++++-
unpack-objects.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
applies-to: 963d67921d6f65c08d51a8c93811f03274c34703
0d2b0b51463fe0fed667a7169b94d7ee52677e69
diff --git a/Documentation/git-unpack-objects.txt b/Documentation/git-unpack-objects.txt
index b716ba1..31ea34d 100644
--- a/Documentation/git-unpack-objects.txt
+++ b/Documentation/git-unpack-objects.txt
@@ -8,7 +8,7 @@ git-unpack-objects - Unpack objects from
SYNOPSIS
--------
-'git-unpack-objects' [-q] <pack-file
+'git-unpack-objects' [-n] [-q] <pack-file
DESCRIPTION
@@ -19,6 +19,10 @@ one-object" format in $GIT_OBJECT_DIRECT
OPTIONS
-------
+-n::
+ Only list the objects that would be unpacked, don't actually unpack
+ them.
+
-q::
The command usually shows percentage progress. This
flag suppresses it.
diff --git a/unpack-objects.c b/unpack-objects.c
index 8ae1a1c..8490895 100644
--- a/unpack-objects.c
+++ b/unpack-objects.c
@@ -6,7 +6,7 @@
#include <sys/time.h>
static int dry_run, quiet;
-static const char unpack_usage[] = "git-unpack-objects [-q] < pack-file";
+static const char unpack_usage[] = "git-unpack-objects [-n] [-q] < pack-file";
/* We always read in 4kB chunks. */
static unsigned char buffer[4096];
---
0.99.9g
^ permalink raw reply related
* [PATCH 2/3] Document a couple of missing command-line options.
From: Nikolai Weibull @ 2005-11-14 23:20 UTC (permalink / raw)
To: git; +Cc: Nikolai Weibull
In-Reply-To: <11320104011582-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
This patch adds documentation to quite a few command-line options.
Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
---
Documentation/git-checkout-index.txt | 10 +++++-----
Documentation/git-prune-packed.txt | 6 ++++++
Documentation/git-read-tree.txt | 4 ++++
3 files changed, 15 insertions(+), 5 deletions(-)
applies-to: fc4d52c0050cf3af0aa501ba7e33d3e0622f0fdc
798cec0159df6f4fefd35c63ad4a59a0399bbd22
diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt
index 94b283a..5bff486 100644
--- a/Documentation/git-checkout-index.txt
+++ b/Documentation/git-checkout-index.txt
@@ -18,21 +18,21 @@ Will copy all files listed from the inde
OPTIONS
-------
--u::
+-u|--index::
update stat information for the checked out entries in
the index file.
--q::
+-q|--quiet::
be quiet if files exist or are not in the index
--f::
+-f|--force::
forces overwrite of existing files
--a::
+-a|--all::
checks out all files in the index. Cannot be used
together with explicit filenames.
--n::
+-n|--no-create::
Don't checkout new files, only refresh files already checked
out.
diff --git a/Documentation/git-prune-packed.txt b/Documentation/git-prune-packed.txt
index 28a1500..8d96a91 100644
--- a/Documentation/git-prune-packed.txt
+++ b/Documentation/git-prune-packed.txt
@@ -23,6 +23,12 @@ compression applied, stored in a single
Packs are used to reduce the load on mirror systems, backup engines, disk storage, etc.
+OPTIONS
+-------
+-n::
+ Don't actually remove any objects, only show those that would have been
+ removed.
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org>
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index e219c6a..7be0cbd 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -30,6 +30,10 @@ OPTIONS
-m::
Perform a merge, not just a read.
+--reset::
+
+ Same as -m except that unmerged entries will be silently ignored.
+
-u::
After a successful merge, update the files in the work
tree with the result of the merge.
---
0.99.9g
^ permalink raw reply related
* [PATCH 0/3] Documentation additions and fixes
From: Nikolai Weibull @ 2005-11-14 23:20 UTC (permalink / raw)
To: git
While going over my Zsh-completion functions I found some options still
missing from the documentation. I also found some problems with some of
the documentation, so I fixed them as well.
nikolai
Documentation/git-checkout-index.txt | 10 +++++-----
Documentation/git-commit-tree.txt | 2 +-
Documentation/git-prune-packed.txt | 6 ++++++
Documentation/git-read-tree.txt | 4 ++++
Documentation/git-unpack-objects.txt | 6 +++++-
Documentation/git-update-index.txt | 2 +-
unpack-objects.c | 2 +-
7 files changed, 23 insertions(+), 9 deletions(-)
^ permalink raw reply
* [PATCH 3/3] Documentation nitpicking
From: Nikolai Weibull @ 2005-11-14 23:20 UTC (permalink / raw)
To: git; +Cc: Nikolai Weibull
In-Reply-To: <11320104011291-git-send-email-mailing-lists.git@rawuncut.elitemail.org>
This patch fixes some small problems with the documentation.
Signed-off-by: Nikolai Weibull <nikolai@bitwi.se>
---
Documentation/git-commit-tree.txt | 2 +-
Documentation/git-update-index.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
applies-to: 118fb90e721428900a0588074894a4b198044762
683a61f6648873de0a73c8c60a86064cf4f4911d
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index b64cd6a..5cf6bd3 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -8,7 +8,7 @@ git-commit-tree - Creates a new commit o
SYNOPSIS
--------
-'git-commit-tree' <tree> [-p <parent commit>]\ < changelog
+'git-commit-tree' <tree> [-p <parent commit>]\* < changelog
DESCRIPTION
-----------
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 52874c8..fdcb8be 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -60,7 +60,7 @@ OPTIONS
Directly insert the specified info into the index.
--index-info::
- Read index info from stdin.
+ Read index information from stdin.
--chmod=(+|-)x::
Set the execute permissions on the updated files.
---
0.99.9g
^ permalink raw reply related
* Re: [PATCH] git-daemon: --inetd implies --syslog
From: H. Peter Anvin @ 2005-11-14 23:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Andreas Ericsson, git
In-Reply-To: <7vlkzrx84p.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
>
> Thanks; I am OK with what you are trying to do with this change,
> except that:
>
> - I suspect closing stderr is still needed (the "workaround"
> was about inetd connection sending output to both fd 1 and 2
> to the client, which would corrupt the protocol conversation
> when exec'ed program writes anything to its standard error
> stream).
>
> - I would have preferred the removal of needless else as a
> separate cleanup patch (this is minor).
>
> Peter, I am CC'ing this to you because I do not know how you run
> the daemon on kernel.org machines -- I suspect you use --syslog
> already and am hoping you are OK with this change.
Yeah, I use --inetd --syslog.
-hpa
^ permalink raw reply
* Re: [Question] info/grafts file.
From: Carl Baldwin @ 2005-11-15 0:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vhdafx81m.fsf@assigned-by-dhcp.cox.net>
This is fine, I just needed to know.
How hard is it to, in a generic way, take a grafts file and reconstruct
commits to include the parents in the graft file in the actual tree? I
am wondering because I couldn't, after much work, get git-svnimport to
find my merges correctly. So, I am needing to hand-graft some merges in
to make things right. Any suggestions? I could try to figure something
out if I can find some time. I'm good with graph traversals and such.
Carl
On Mon, Nov 14, 2005 at 12:56:37PM -0800, Junio C Hamano wrote:
> Grafts are considered local preference, and not copied when
> cloned. I am unsure this was a right decision, but that is how
> things are right now.
>
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Carl Baldwin Systems VLSI Laboratory
Hewlett Packard Company
MS 88 work: 970 898-1523
3404 E. Harmony Rd. work: Carl.N.Baldwin@hp.com
Fort Collins, CO 80525 home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
^ permalink raw reply
* [PATCH]: cogito testsuite: use git-symbolic-ref
From: Pavel Roskin @ 2005-11-15 1:13 UTC (permalink / raw)
To: git, Petr Baudis
cogito testsuite fails if git is compiled with USE_SYMLINK_HEAD=0.
To fix it, use git-symbolic-ref instead of readlink.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/t/t9300-seek.sh b/t/t9300-seek.sh
index d3fed11..a6f3a65 100755
--- a/t/t9300-seek.sh
+++ b/t/t9300-seek.sh
@@ -30,7 +30,7 @@ test_expect_success 'seeking to the firs
test_expect_success 'we should have .git/head-name == master' \
"[ $(cat .git/head-name) = master ]"
test_expect_success 'current branch should be cg-seek-point' \
- "[ $(basename $(readlink .git/HEAD)) = cg-seek-point ]"
+ "[ $(basename $(git-symbolic-ref HEAD)) = cg-seek-point ]"
test_expect_success 'current commit should be commit1' \
"[ $(cg-object-id -c) = $commit1 ]"
@@ -47,14 +47,16 @@ test_expect_success 'identical should be
test_expect_success 'seeking to the second commit' \
"cg-seek $commit2"
test_expect_success 'we should not unseeked properly' \
- "([ -e .git/head-name ] && [ $(basename $(readlink .git/HEAD)) = cg-seek-point ])"
+ "([ -e .git/head-name ] &&
+ [ $(basename $(git-symbolic-ref HEAD)) = cg-seek-point ])"
test_expect_success 'current commit should be commit2' \
"[ $(cg-object-id -c) = $commit2 ]"
test_expect_success 'seeking to the last (well, still second) commit' \
"cg-seek master"
test_expect_success 'we should be unseeked properly' \
- "([ ! -e .git/head-name ] && [ $(basename $(readlink .git/HEAD)) = master ])"
+ "([ ! -e .git/head-name ] &&
+ [ $(basename $(git-symbolic-ref HEAD)) = master ])"
test_expect_success 'current commit should be commit2' \
"[ $(cg-object-id -c) = $commit2 ]"
@@ -88,7 +90,8 @@ test_expect_success 'identical should be
test_expect_success 'unseeking' \
"cg-seek"
test_expect_success 'we should be unseeked properly' \
- "([ ! -e .git/head-name ] && [ $(basename $(readlink .git/HEAD)) = master ])"
+ "([ ! -e .git/head-name ] &&
+ [ $(basename $(git-symbolic-ref HEAD)) = master ])"
test_expect_success 'current commit should be commit2' \
"[ $(cg-object-id -c) = $commit2 ]"
--
Regards,
Pavel Roskin
^ permalink raw reply related
* Re: Getting rid of symlinks in .git?
From: Junio C Hamano @ 2005-11-15 2:22 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <81b0412b0511110443x48415032k8ca40d999071e8a9@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> writes:
> But you shouldn't care if you have reasonably recent git everywhere:
> symlinks and their absence already handled: .git/config created by
> init-db contains the configuration parameter for filemode, which
> decides whether it is safe to use the symlinks on the underlying
> filesystem.
No, no no nononononono....
core.filemode is whether the executable bit is trustworthy and
does not have anything to do with symlinked heads, although
these two happen to become problematic on VFAT.
Currently we have USE_SYMLINK_HEAD and have failing symlink()
call fall back on regular file symrefs.
But this may not matter as long as nobody would want to force
regular file symrefs on a filesystem that is capable of doing a
symlink. That is the only thing we cannot do right now.
^ permalink raw reply
* Re: [PATCH] GIT commit statistics.
From: Junio C Hamano @ 2005-11-15 3:00 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git
In-Reply-To: <46a038f90511140051o1fa5ef7cyb9dd723fb8161ef9@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
>> I've never felt need to "merge" the binary files myself and had
>> never got around doing this, but if you are interested, it would
>> go something like this:
>
> That's quite a bit of C hacking...
I'll be pushing out something along the lines I said in the
proposed updates branch tonight. I've even run 1 (one) test
;-). The relevant commits are these:
+ [pu~5^2] rebase: make it usable for binary files as well.
+ [pu~5^2^] diff: --full-index
+ [pu~5^2~2] apply: allow-binary-replacement.
+ [pu~5^2~3] Rewrite rebase to use git-format-patch piped to git-am.
Note that this does not make generated "binary patch" usable
across repositories yet. Since our patches are reversible out
of principle, making it usable across repositories involves
recording both the pre- and post-image of binary blobs in the
patch output, which may be a useful option in some cases but not
necessary for the immediate application of intra-repo rebasing.
^ permalink raw reply
* Re: git's rev-parse.c function show_datestring presumes gnu date
From: Linus Torvalds @ 2005-11-15 3:29 UTC (permalink / raw)
To: Randal L. Schwartz, Junio C Hamano; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0511141504530.3263@g5.osdl.org>
On Mon, 14 Nov 2005, Linus Torvalds wrote:
>
> It shouldn't be all that difficult to do some trivial cases (gnu date
> handles totally insane things, we could easily do with just a simpler
> thing).
Ok. This is the insane patch to do this.
It really isn't very careful, and the reason I call it "approxidate()"
will become obvious when you look at the code. It is very liberal in what
it accepts, to the point where sometimes the results may not make a whole
lot of sense.
It accepts "last week" as a date string, by virtue of "last" parsing as
the number 1, and it totally ignoring superfluous fluff like "ago", so
"last week" ends up being exactly the same thing as "1 week ago". Fine so
far.
It has strange side effects: "last december" will actually parse as "Dec
1", which actually _does_ turn out right, because it will then notice that
it's not December yet, so it will decide that you must be talking about a
date last year. So it actually gets it right, but it's kind of for the
"wrong" reasons.
It also accepts the numbers 1..10 in string format ("one" .. "ten"), so
you can do "ten weeks ago" or "ten hours ago" and it will do the right
thing.
But it will do some really strange thigns too: the string "this will last
forever", will not recognize anyting but "last", which is recognized as
"1", which since it doesn't understand anything else it will think is the
day of the month. So if you do
gitk --since="this will last forever"
the date will actually parse as the first day of the current month.
And it will parse the string "now" as "now", but only because it doesn't
understand it at all, and it makes everything relative to "now".
Similarly, it doesn't actually parse the "ago" or "from now", so "2 weeks
ago" is exactly the same as "2 weeks from now". It's the current date
minus 14 days.
But hey, it's probably better (and certainly faster) than depending on GNU
date. So now you can portably do things like
gitk --since="two weeks and three days ago"
git log --since="July 5"
git-whatchanged --since="10 hours ago"
git log --since="last october"
and it will actually do exactly what you thought it would do (I think). It
will count 17 days backwards, and it will do so even if you don't have GNU
date installed.
(I don't do "last monday" or similar yet, but I can extend it to that too
if people want).
It was kind of fun trying to write code that uses such totally relaxed
"understanding" of dates yet tries to get it right for the trivial cases.
The result should be mixed with a few strange preprocessor tricks, and be
submitted for the IOCCC ;)
Feel free to try it out, and see how many strange dates it gets right. Or
wrong.
And if you find some interesting (and valid - not "interesting" as in
"strange", but "interesting" as in "I'd be interested in actually doing
this) thing it gets wrong - usually by not understanding it and silently
just doing some strange things - please holler.
Now, as usual this certainly hasn't been getting a lot of testing. But my
code always works, no?
Linus
----
diff --git a/cache.h b/cache.h
index 677c6ac..dcfee1e 100644
--- a/cache.h
+++ b/cache.h
@@ -257,6 +257,7 @@ extern void *read_object_with_reference(
const char *show_date(unsigned long time, int timezone);
int parse_date(const char *date, char *buf, int bufsize);
void datestamp(char *buf, int bufsize);
+unsigned long approxidate(const char *);
extern int setup_ident(void);
extern char *get_ident(const char *name, const char *email, const char *date_str);
diff --git a/date.c b/date.c
index 63f5a09..73c063b 100644
--- a/date.c
+++ b/date.c
@@ -5,6 +5,7 @@
*/
#include <time.h>
+#include <sys/time.h>
#include "cache.h"
@@ -460,3 +461,126 @@ void datestamp(char *buf, int bufsize)
date_string(now, offset, buf, bufsize);
}
+
+static void update_tm(struct tm *tm, unsigned long sec)
+{
+ time_t n = mktime(tm) - sec;
+ localtime_r(&n, tm);
+}
+
+static const char *number_name[] = {
+ "zero", "one", "two", "three", "four",
+ "five", "six", "seven", "eight", "nine", "ten",
+};
+
+static struct typelen {
+ const char *type;
+ int length;
+} typelen[] = {
+ { "seconds", 1 },
+ { "minutes", 60 },
+ { "hours", 60*60 },
+ { "days", 24*60*60 },
+ { "weeks", 7*24*60*60 },
+ { NULL }
+};
+
+static const char *approxidate_alpha(const char *date, struct tm *tm, int *num)
+{
+ struct typelen *tl;
+ const char *end = date;
+ int n = 1, i;
+
+ while (isalpha(*++end))
+ n++;
+
+ for (i = 0; i < 12; i++) {
+ int match = match_string(date, month_names[i]);
+ if (match >= 3) {
+ tm->tm_mon = i;
+ return end;
+ }
+ }
+
+ if (match_string(date, "yesterday") > 8) {
+ update_tm(tm, 24*60*60);
+ return end;
+ }
+
+ if (!*num) {
+ for (i = 1; i < 11; i++) {
+ int len = strlen(number_name[i]);
+ if (match_string(date, number_name[i]) == len) {
+ *num = i;
+ return end;
+ }
+ }
+ if (match_string(date, "last") == 4)
+ *num = 1;
+ return end;
+ }
+
+ tl = typelen;
+ while (tl->type) {
+ int len = strlen(tl->type);
+ if (match_string(date, tl->type) >= len-1) {
+ update_tm(tm, tl->length * *num);
+ *num = 0;
+ return end;
+ }
+ tl++;
+ }
+
+ if (match_string(date, "months") >= 5) {
+ int n = tm->tm_mon - *num;
+ *num = 0;
+ while (n < 0) {
+ n += 12;
+ tm->tm_year--;
+ }
+ tm->tm_mon = n;
+ return end;
+ }
+
+ if (match_string(date, "years") >= 4) {
+ tm->tm_year -= *num;
+ *num = 0;
+ return end;
+ }
+
+ return end;
+}
+
+unsigned long approxidate(const char *date)
+{
+ int number = 0;
+ struct tm tm, now;
+ struct timeval tv;
+ char buffer[50];
+
+ if (parse_date(date, buffer, sizeof(buffer)) > 0)
+ return strtoul(buffer, NULL, 10);
+
+ gettimeofday(&tv, NULL);
+ localtime_r(&tv.tv_sec, &tm);
+ now = tm;
+ for (;;) {
+ unsigned char c = *date;
+ if (!c)
+ break;
+ date++;
+ if (isdigit(c)) {
+ char *end;
+ number = strtoul(date-1, &end, 10);
+ date = end;
+ continue;
+ }
+ if (isalpha(c))
+ date = approxidate_alpha(date-1, &tm, &number);
+ }
+ if (number > 0 && number < 32)
+ tm.tm_mday = number;
+ if (tm.tm_mon > now.tm_mon)
+ tm.tm_year--;
+ return mktime(&tm);
+}
diff --git a/rev-parse.c b/rev-parse.c
index 5a98982..bb4949a 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -131,25 +131,12 @@ static int show_reference(const char *re
static void show_datestring(const char *flag, const char *datestr)
{
- FILE *date;
static char buffer[100];
- static char cmd[1000];
- int len;
/* date handling requires both flags and revs */
if ((filter & (DO_FLAGS | DO_REVS)) != (DO_FLAGS | DO_REVS))
return;
- len = strlen(flag);
- memcpy(buffer, flag, len);
-
- snprintf(cmd, sizeof(cmd), "date --date=%s +%%s", sq_quote(datestr));
- date = popen(cmd, "r");
- if (!date || !fgets(buffer + len, sizeof(buffer) - len, date))
- die("git-rev-list: bad date string");
- pclose(date);
- len = strlen(buffer);
- if (buffer[len-1] == '\n')
- buffer[--len] = 0;
+ snprintf(buffer, sizeof(buffer), "%s%lu", flag, approxidate(datestr));
show(buffer);
}
^ permalink raw reply related
* [ANNOUNCE] GIT 0.99.9i aka 1.0rc2
From: Junio C Hamano @ 2005-11-15 4:17 UTC (permalink / raw)
To: git; +Cc: linux-kernel
GIT 0.99.9i aka 1.0rc2 is found at usual places.
I think the source-tree-wise almost everything is done except:
- http-fetch file descriptor leak fix; I tried Nick's
clean-ups, but haven't tried Pasky's patch yet. Walt reports
neither patch fixed the problem. I wasted the weekend not
being able to reproduce this myself, until Pasky reminded me
that I have an old special code in git-clone, which was
unrelated to this problem, but nevertheless was masking it.
- Preparation for later dash-less "git frotz" installation
scheme. As I said earlier, I intend to do 1.0 with a
Makefile that installs everything in one directory (either
$HOME/bin or /usr/bin) by default, but at least we should
encourage our users to get used to spelling the subcommands
in dash-less form. Andreas Ericsson's git wrapper
implementation was reviewed favourably on the list, and I'd
like to go with it.
- archimport update by Eric Wong has not been reviewed yet;
this is difficult for me since I do not use tla anymore, and
I am asking help from Martin Langhoff. I am hoping Eric and
Martin would come up with an updated patch that satisfies the
needs of both, at that time the update will happen.
Personally I do not think 1.0 has to wait for this.
There is a bit of restructuring in the binary packaging for RPM
(and probably Debian side needs matching change as well) before
1.0 can happen.
Anyway, here is the short-log between 0.99.9g and 0.99.9i.
Please give it a good beating.
-- >8 -- cut here -- >8 --
Alex Riesen:
allow git-update-ref create refs with slashes in names
Andreas Ericsson:
git-clone: Keep remote names when cloning unless explicitly told not to.
git-clone: Allow cloning into directories other than child of current dir.
git-branch: Mention -d and -D in man-page.
Chris Wright:
specfile cleanups
Fredrik Kuivinen:
merge-recursive: Indent the output properly
merge-recursive: Add copyright notice
merge-recursive: Use '~' instead of '_' to separate file names from branch names
Jim Radford:
Add missing git-core and cvsps RPM dependencies.
Josef Weidendorfer:
Let git-clone/git-fetch follow HTTP redirections
Bugfix: stop if directory already exists
Remove git-rename. git-mv does the same
Junio C Hamano:
Documentation: "host:path/to/repo" is git native over ssh.
Do not lose author name information to locale gotchas.
Add --pretty=fuller
octopus: do not do AND'ed merge base.
RPM: arch submodule needs tla.
merge-base: fully contaminate the well.
merge-base: avoid unnecessary postprocessing.
Add test case for merge-base.
git-show-branch: tighten merge-base computation.
Fully detect uninteresting commits.
t1200: use --topo-order to keep the show-branch output stable.
INSTALL: duplicate python requirements from Makefile
merge with /dev/null as base, instead of punting O==empty case
merge-one-file: use common as base, instead of emptiness.
Documentation: git-apply --no-add
merge-one-file: use empty- or common-base condintionally in two-stage merge.
git-prune: prune redundant packs
git-lost+found
Rename .git/lost+found to .git/lost-found.
Documentation: asciidoc sources are utf-8
Ignore built git-lost+found.
Debian: build-depend on libexpat-dev.
Rename lost+found to lost-found.
Separate LDFLAGS and CFLAGS.
apply: fix binary patch detection.
Update topo-order test.
Kai Ruemmler:
Fix compilation warnings in pack-redundant.c
Linus Torvalds:
Fix git-rev-list "date order" with --topo-order
Lukas_Sandström:
Change 'cache' to 'index' in the docs
Add git-pack-intersect
Add documentation for git-pack-intersect
Add git-pack-intersect to .gitignore
Make git-repack use git-pack-intersect.
Rename git-pack-intersect to git-pack-redundant
Make git-pack-redundant consider alt-odbs
Martin Langhoff:
archimport: handle pika escaping
Matthias Urlichs:
debian packaging: git-cvs needs cvsps
Remove trailing slashes
Depend on asciidoc 7 (at least).
Nick Hengeveld:
Fix for multiple alternates requests in http-fetch
Fix fd leak in http-fetch
Nikolai Weibull:
Document the -n command-line option to git-unpack-objects
Document a couple of missing command-line options.
Documentation nitpicking
Pavel Roskin:
Add --no-commit-id option for git-diff-tree, use it in gitk
git-clone: quote destination directory name
Petr Baudis:
Fix confusing git-update-ref error message
Show URL in the "Getting <foo> list" http-fetch messages
Thomas Matysik:
Add expat and expat-devel dependencies (for http-push) to RPM spec.
Split gitk into seperate RPM package
^ permalink raw reply
* Re: [PATCH 1/1] git-cvsexportcommit.perl: Fix usage() output.
From: Martin Langhoff @ 2005-11-15 5:10 UTC (permalink / raw)
To: Junio C Hamano, git list; +Cc: Kevin Geiss
In-Reply-To: <7vsltyvnjf.fsf@assigned-by-dhcp.cox.net>
On 11/15/05, Junio C Hamano <junkio@cox.net> wrote:
> Given that you are far more familiar with that part of the code,
> and I suspect I'd be asking your help in archimport as well, a
> repo I can pull from would be more preferable (and sign-off by
> you is certainly an added bonus). If a public repo is too much
> hassle, however, e-mail forwarding is perfectly fine as well.
> Your choice.
It is _easy_. I've setup a server for git-related paraphernalia at
work already ;)
The URL is:
http://locke.catalyst.net.nz/git/git-martinlanghoff.git/#tojunio
gitweb at:
http://locke.catalyst.net.nz/gitweb?p=git-martinlanghoff.git;a=summary
That gitweb has per-branch RSS feeds, if you are an rss junkio ;-) you
can just subscribe to it...
A word of warning, though: those branches rewind/rebase often, and I
won't apologise about it. You should be able to just delete your
'martinlanghoff' head and refetch it. Anyone else reading this... just
_don't_ base your work on my branch as it's bound to break.
> BTW, there is no "mana" points involved in deciding if I
> directly pull from somewhere. Even if that were the case, you
> have accumulated enough of them already ;-).
:-)
/me is happy that you've forgotten about my brown-paper-bag patch with
a random character in the middle!
> Although some might find "${\function}" expansion too cute for
> their taste, Keven's code is fine as-is for me. I launched the
> baloon just wanting to see what others have to say ;-).
Fine w me -- TIMTOWDI. I do understand, however, your interest in
having full paths in the usage line to make debugging easier. Whatever
is consistent with the project in general.
cheers,
martin
^ permalink raw reply
* [PATCH] Disable USE_SYMLINK_HEAD by default
From: Pavel Roskin @ 2005-11-15 5:59 UTC (permalink / raw)
To: git
Disable USE_SYMLINK_HEAD by default. Recommend using it only for
compatibility with older software.
Treat USE_SYMLINK_HEAD like other optional defines - check whether it's
defined, not its value.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
Applying this patch before 1.0 may be controversial, but I think there
is a very good reason for that. There should be exactly one git 1.0
repository format. Now we have two that are present in the sources and
that have received testing from the git users.
Of those two formats, I prefer the one that is platform independent and
not very demanding with regard to filesystems and transfer protocols.
That format should be good enough so that we don't plan to change it as
soon as version 1.0 is released. Any third party software claiming to
support git 1.0 should need to support one repository format.
diff --git a/Makefile b/Makefile
index 63cb998..585552e 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,10 @@
#
# Define NO_STRCASESTR if you don't have strcasestr.
#
+# Define USE_SYMLINK_HEAD if you want .git/HEAD to be a symbolic link.
+# This feature is phased out, enable it only for compatibility with other
+# software. Don't enable it on Windows.
+#
# Define PPC_SHA1 environment variable when running make to make use of
# a bundled SHA1 routine optimized for PowerPC.
#
@@ -210,7 +214,6 @@ ifeq ($(uname_O),Cygwin)
NEEDS_LIBICONV = YesPlease
NO_IPV6 = YesPlease
X = .exe
- ALL_CFLAGS += -DUSE_SYMLINK_HEAD=0
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
diff --git a/refs.c b/refs.c
index a52b038..9b88742 100644
--- a/refs.c
+++ b/refs.c
@@ -6,10 +6,6 @@
/* We allow "recursive" symbolic refs. Only within reason, though */
#define MAXDEPTH 5
-#ifndef USE_SYMLINK_HEAD
-#define USE_SYMLINK_HEAD 1
-#endif
-
int validate_symref(const char *path)
{
struct stat st;
@@ -120,7 +116,7 @@ int create_symref(const char *git_HEAD,
char ref[1000];
int fd, len, written;
-#if USE_SYMLINK_HEAD
+#ifdef USE_SYMLINK_HEAD
unlink(git_HEAD);
if (!symlink(refs_heads_master, git_HEAD))
return 0;
--
Regards,
Pavel Roskin
^ permalink raw reply related
* [PATCH] git-core-foo -> git-foo, except the core package
From: H. Peter Anvin @ 2005-11-15 6:12 UTC (permalink / raw)
To: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 433 bytes --]
This patch renames the tarball "git" rather than "git-core", and changes
the names of various packages from git-core-foo to git-foo. git-core is
still the true core package; an empty RPM package named "git" pulls in
ALL the git packages -- this makes updates work correctly, and allows
"yum install git" to do the obvious thing.
It also renames the git-(core-)tk package to gitk.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
[-- Attachment #2: uncorify-git --]
[-- Type: text/plain, Size: 13811 bytes --]
diff --git a/Makefile b/Makefile
index 63cb998..b10a315 100644
--- a/Makefile
+++ b/Makefile
@@ -446,20 +446,20 @@ install-doc:
### Maintainer's dist rules
-git-core.spec: git-core.spec.in Makefile
+git.spec: git.spec.in Makefile
sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
-GIT_TARNAME=git-core-$(GIT_VERSION)
-dist: git-core.spec git-tar-tree
+GIT_TARNAME=git-$(GIT_VERSION)
+dist: git.spec git-tar-tree
./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
@mkdir -p $(GIT_TARNAME)
- @cp git-core.spec $(GIT_TARNAME)
- $(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec
+ @cp git.spec $(GIT_TARNAME)
+ $(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git.spec
@rm -rf $(GIT_TARNAME)
gzip -f -9 $(GIT_TARNAME).tar
rpm: dist
- $(RPMBUILD) -ta git-core-$(GIT_VERSION).tar.gz
+ $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
deb: dist
rm -rf $(GIT_TARNAME)
@@ -472,7 +472,7 @@ deb: dist
clean:
rm -f *.o mozilla-sha1/*.o ppc/*.o compat/*.o $(PROGRAMS) $(LIB_FILE)
rm -f $(filter-out gitk,$(SCRIPTS))
- rm -f git-core.spec *.pyc *.pyo
+ rm -f *.spec *.pyc *.pyo
rm -rf $(GIT_TARNAME)
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
rm -f git-core_$(GIT_VERSION)-*.dsc
diff --git a/git-core.spec.in b/git-core.spec.in
deleted file mode 100644
index 16c6269..0000000
--- a/git-core.spec.in
+++ /dev/null
@@ -1,164 +0,0 @@
-# Pass --without docs to rpmbuild if you don't want the documentation
-Name: git-core
-Version: @@VERSION@@
-Release: 1%{?dist}
-Summary: Git core and tools
-License: GPL
-Group: Development/Tools
-URL: http://kernel.org/pub/software/scm/git/
-Source: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
-BuildRequires: zlib-devel >= 1.2, openssl-devel, curl-devel, expat-devel %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: zlib >= 1.2, rsync, rcs, curl, less, openssh-clients, python >= 2.3, expat
-
-%description
-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. It is intended to be the base of an efficient,
-distributed source code management system. This package includes
-rudimentary tools that can be used as a SCM, but you should look
-elsewhere for tools for ordinary humans layered on top of this.
-
-%package svn
-Summary: Git tools for importing Subversion repositories
-Group: Development/Tools
-Requires: git-core = %{version}-%{release}, subversion
-%description svn
-Git tools for importing Subversion repositories.
-
-%package cvs
-Summary: Git tools for importing CVS repositories
-Group: Development/Tools
-Requires: git-core = %{version}-%{release}, cvs, cvsps
-%description cvs
-Git tools for importing CVS repositories.
-
-%package arch
-Summary: Git tools for importing Arch repositories
-Group: Development/Tools
-Requires: git-core = %{version}-%{release}, tla
-%description arch
-Git tools for importing Arch repositories.
-
-%package email
-Summary: Git tools for sending email
-Group: Development/Tools
-Requires: git-core = %{version}-%{release}
-%description email
-Git tools for sending email.
-
-%package tk
-Summary: Git revision tree visualiser ('gitk')
-Group: Development/Tools
-Requires: git-core = %{version}-%{release}, tk >= 8.4
-%description tk
-Git revision tree visualiser ('gitk')
-
-%prep
-%setup -q
-
-%build
-make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_OWN_SUBPROCESS_PY=YesPlease WITH_SEND_EMAIL=1 \
- prefix=%{_prefix} all %{!?_without_docs: doc}
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT WITH_OWN_SUBPROCESS_PY=YesPlease WITH_SEND_EMAIL=1 \
- prefix=%{_prefix} mandir=%{_mandir} \
- install %{!?_without_docs: install-doc}
-
-(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "arch|svn|cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files
-%if %{!?_without_docs:1}0
-(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "arch|svn|git-cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files svn
-%defattr(-,root,root)
-%{_bindir}/*svn*
-%doc Documentation/*svn*.txt
-%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
-%{!?_without_docs: %doc Documentation/*svn*.html }
-
-%files cvs
-%defattr(-,root,root)
-%doc Documentation/*git-cvs*.txt
-%{_bindir}/*cvs*
-%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
-%{!?_without_docs: %doc Documentation/*git-cvs*.html }
-
-%files arch
-%defattr(-,root,root)
-%doc Documentation/*arch*.txt
-%{_bindir}/*arch*
-%{!?_without_docs: %{_mandir}/man1/*arch*.1*}
-%{!?_without_docs: %doc Documentation/*arch*.html }
-
-%files email
-%defattr(-,root,root)
-%doc Documentation/*email*.txt
-%{_bindir}/*email*
-%{!?_without_docs: %{_mandir}/man1/*email*.1*}
-%{!?_without_docs: %doc Documentation/*email*.html }
-
-%files tk
-%defattr(-,root,root)
-%doc Documentation/*gitk*.txt
-%{_bindir}/*gitk*
-%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
-%{!?_without_docs: %doc Documentation/*gitk*.html }
-
-%files -f bin-man-doc-files
-%defattr(-,root,root)
-%{_datadir}/git-core/
-%doc README COPYING Documentation/*.txt
-%{!?_without_docs: %doc Documentation/*.html }
-
-%changelog
-* Thu Nov 10 2005 Chris Wright <chrisw@osdl.org> 0.99.9g-1
-- zlib dependency fix
-- Minor cleanups from split
-- Move arch import to separate package as well
-
-* Tue Sep 27 2005 Jim Radford <radford@blackbean.org>
-- Move programs with non-standard dependencies (svn, cvs, email)
- into separate packages
-
-* Tue Sep 27 2005 H. Peter Anvin <hpa@zytor.com>
-- parallelize build
-- COPTS -> CFLAGS
-
-* Fri Sep 16 2005 Chris Wright <chrisw@osdl.org> 0.99.6-1
-- update to 0.99.6
-
-* Fri Sep 16 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Linus noticed that less is required, added to the dependencies
-
-* Sun Sep 11 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Updated dependencies
-- Don't assume manpages are gzipped
-
-* Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> 0.99.4-4
-- drop sh_utils, sh-utils, diffutils, mktemp, and openssl Requires
-- use RPM_OPT_FLAGS in spec file, drop patch0
-
-* Wed Aug 17 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.99.4-3
-- use dist tag to differentiate between branches
-- use rpm optflags by default (patch0)
-- own %{_datadir}/git-core/
-
-* Mon Aug 15 2005 Chris Wright <chrisw@osdl.org>
-- update spec file to fix Buildroot, Requires, and drop Vendor
-
-* Sun Aug 07 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Redid the description
-- Cut overlong make line, loosened changelog a bit
-- I think Junio (or perhaps OSDL?) should be vendor...
-
-* Thu Jul 14 2005 Eric Biederman <ebiederm@xmission.com>
-- Add the man pages, and the --without docs build option
-
-* Wed Jul 7 2005 Chris Wright <chris@osdl.org>
-- initial git spec file
diff --git a/git.spec.in b/git.spec.in
new file mode 100644
index 0000000..96dfc1d
--- /dev/null
+++ b/git.spec.in
@@ -0,0 +1,188 @@
+# Pass --without docs to rpmbuild if you don't want the documentation
+Name: git
+Version: @@VERSION@@
+Release: 1%{?dist}
+Summary: Git core and tools
+License: GPL
+Group: Development/Tools
+URL: http://kernel.org/pub/software/scm/git/
+Source: http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
+BuildRequires: zlib-devel >= 1.2, openssl-devel, curl-devel, expat-devel %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: git-core, git-svn, git-cvs, git-arch, git-email, gitk
+
+%description
+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. It is intended to be the base of an efficient,
+distributed source code management system. This package includes
+rudimentary tools that can be used as a SCM, but you should look
+elsewhere for tools for ordinary humans layered on top of this.
+
+This is a dummy package which brings in all subpackages.
+
+%package core
+Summary: Core git tools
+Group: Development/Tools
+Requires: zlib >= 1.2, rsync, rcs, curl, less, openssh-clients, python >= 2.3, expat
+%description core
+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. It is intended to be the base of an efficient,
+distributed source code management system. This package includes
+rudimentary tools that can be used as a SCM, but you should look
+elsewhere for tools for ordinary humans layered on top of this.
+
+These are the core tools with minimal dependencies.
+
+%package svn
+Summary: Git tools for importing Subversion repositories
+Group: Development/Tools
+Requires: git-core = %{version}-%{release}, subversion
+%description svn
+Git tools for importing Subversion repositories.
+
+%package cvs
+Summary: Git tools for importing CVS repositories
+Group: Development/Tools
+Requires: git-core = %{version}-%{release}, cvs, cvsps
+%description cvs
+Git tools for importing CVS repositories.
+
+%package arch
+Summary: Git tools for importing Arch repositories
+Group: Development/Tools
+Requires: git-core = %{version}-%{release}, tla
+%description arch
+Git tools for importing Arch repositories.
+
+%package email
+Summary: Git tools for sending email
+Group: Development/Tools
+Requires: git-core = %{version}-%{release}
+%description email
+Git tools for sending email.
+
+%package -n gitk
+Summary: Git revision tree visualiser ('gitk')
+Group: Development/Tools
+Requires: git-core = %{version}-%{release}, tk >= 8.4
+%description -n gitk
+Git revision tree visualiser ('gitk')
+
+%prep
+%setup -q
+
+%build
+make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_OWN_SUBPROCESS_PY=YesPlease WITH_SEND_EMAIL=1 \
+ prefix=%{_prefix} all %{!?_without_docs: doc}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make %{_smp_mflags} DESTDIR=$RPM_BUILD_ROOT WITH_OWN_SUBPROCESS_PY=YesPlease WITH_SEND_EMAIL=1 \
+ prefix=%{_prefix} mandir=%{_mandir} \
+ install %{!?_without_docs: install-doc}
+
+(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "arch|svn|cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@) > bin-man-doc-files
+%if %{!?_without_docs:1}0
+(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "arch|svn|git-cvs|email|gitk" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+# These are no files in the root package
+
+%files svn
+%defattr(-,root,root)
+%{_bindir}/*svn*
+%doc Documentation/*svn*.txt
+%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
+%{!?_without_docs: %doc Documentation/*svn*.html }
+
+%files cvs
+%defattr(-,root,root)
+%doc Documentation/*git-cvs*.txt
+%{_bindir}/*cvs*
+%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
+%{!?_without_docs: %doc Documentation/*git-cvs*.html }
+
+%files arch
+%defattr(-,root,root)
+%doc Documentation/*arch*.txt
+%{_bindir}/*arch*
+%{!?_without_docs: %{_mandir}/man1/*arch*.1*}
+%{!?_without_docs: %doc Documentation/*arch*.html }
+
+%files email
+%defattr(-,root,root)
+%doc Documentation/*email*.txt
+%{_bindir}/*email*
+%{!?_without_docs: %{_mandir}/man1/*email*.1*}
+%{!?_without_docs: %doc Documentation/*email*.html }
+
+%files -n gitk
+%defattr(-,root,root)
+%doc Documentation/*gitk*.txt
+%{_bindir}/*gitk*
+%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
+%{!?_without_docs: %doc Documentation/*gitk*.html }
+
+%files core -f bin-man-doc-files
+%defattr(-,root,root)
+%{_datadir}/git-core/
+%doc README COPYING Documentation/*.txt
+%{!?_without_docs: %doc Documentation/*.html }
+
+%changelog
+* Mon Nov 14 2005 H. Peter Anvin <hpa@zytor.com> 0.99.9j-1
+- Change subpackage names to git-<name> instead of git-core-<name>
+- Create empty root package which brings in all subpackages
+- Rename git-tk -> gitk
+
+* Thu Nov 10 2005 Chris Wright <chrisw@osdl.org> 0.99.9g-1
+- zlib dependency fix
+- Minor cleanups from split
+- Move arch import to separate package as well
+
+* Tue Sep 27 2005 Jim Radford <radford@blackbean.org>
+- Move programs with non-standard dependencies (svn, cvs, email)
+ into separate packages
+
+* Tue Sep 27 2005 H. Peter Anvin <hpa@zytor.com>
+- parallelize build
+- COPTS -> CFLAGS
+
+* Fri Sep 16 2005 Chris Wright <chrisw@osdl.org> 0.99.6-1
+- update to 0.99.6
+
+* Fri Sep 16 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
+- Linus noticed that less is required, added to the dependencies
+
+* Sun Sep 11 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
+- Updated dependencies
+- Don't assume manpages are gzipped
+
+* Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> 0.99.4-4
+- drop sh_utils, sh-utils, diffutils, mktemp, and openssl Requires
+- use RPM_OPT_FLAGS in spec file, drop patch0
+
+* Wed Aug 17 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.99.4-3
+- use dist tag to differentiate between branches
+- use rpm optflags by default (patch0)
+- own %{_datadir}/git-core/
+
+* Mon Aug 15 2005 Chris Wright <chrisw@osdl.org>
+- update spec file to fix Buildroot, Requires, and drop Vendor
+
+* Sun Aug 07 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
+- Redid the description
+- Cut overlong make line, loosened changelog a bit
+- I think Junio (or perhaps OSDL?) should be vendor...
+
+* Thu Jul 14 2005 Eric Biederman <ebiederm@xmission.com>
+- Add the man pages, and the --without docs build option
+
+* Wed Jul 7 2005 Chris Wright <chris@osdl.org>
+- initial git spec file
^ permalink raw reply related
* Re: [PATCH] Disable USE_SYMLINK_HEAD by default
From: Junio C Hamano @ 2005-11-15 7:03 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1132034390.22207.18.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
> Applying this patch before 1.0 may be controversial,...
If I am not mistaken, I thought the last thread on the list
showed general consensus that symlinks were preferred when
available. So applying this patch anytime would be
controversial...
> but I think there is a very good reason for that.
Which is...? I do not think this paragraph justifies it:
> There should be exactly one git 1.0 repository format. Now we
> have two that are present in the sources and that have
> received testing from the git users.
The one format is that .git/HEAD can either be a symlink or
regular file text symref; both variants are tested -- wouldn't
that be good enough?
The only thing I can think of that might be inconvenient is if
you try doing "cp -a" off of a filesystem that supports symlinks
to another filesystem that does not -- probably that would fail
copying the symlinked .git/HEAD. But if that is the problem,
you could always git-clone, which should do the right thing, I
think.
^ permalink raw reply
* Re: Getting rid of symlinks in .git?
From: Alex Riesen @ 2005-11-15 7:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Simon Richter
In-Reply-To: <7vhdaevedu.fsf@assigned-by-dhcp.cox.net>
On 11/15/05, Junio C Hamano <junkio@cox.net> wrote:
> > But you shouldn't care if you have reasonably recent git everywhere:
> > symlinks and their absence already handled: .git/config created by
> > init-db contains the configuration parameter for filemode, which
> > decides whether it is safe to use the symlinks on the underlying
> > filesystem.
>
> No, no no nononononono....
>
> core.filemode is whether the executable bit is trustworthy and
> does not have anything to do with symlinked heads, although
> these two happen to become problematic on VFAT.
Of course! Silly me...
^ permalink raw reply
* Re: [PATCH 1/2] Add expat and expat-devel dependencies (for http-push) to RPM spec.
From: David Kågedal @ 2005-11-14 17:25 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.64.0511131248190.3263@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> On Sun, 13 Nov 2005, Andreas Ericsson wrote:
>>
>> I *think* the ssh transport should work nicely over rsh as well. I don't have
>> the slightest idea of where to find an rsh installation to test it with
>> though.
>
> You're right, it should be possible to just do a
>
> export GIT_SSH=rsh
>
> and things should just work.
>
> But I don't have any machines that allow rsh either ;)
I do it all the time with a kerberos rsh. It works fine.
--
David Kågedal
^ permalink raw reply
* Re: [PATCH] archimport improvements
From: Eric Wong @ 2005-11-15 8:03 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git list
In-Reply-To: <46a038f90511141438q1d85d429vedcf2a3b54d761e1@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> wrote:
> Eric,
>
> thanks for resending those so quickly. I think I'm going to sit on the
> 'overhaul of changeset application' patch a bit -- I'll test & ack
> your other patches for merge soonish but I want to review and test
> this one carefully.
>
> My main concern is that it seems to be calling tla get for each
> revision that it imports. For large trees, this is slow. I would be
> much happier with a fast Perl-based approach. Have you got a public
> repo with directory renames?
Please read my sync_to_ps() function very carefully. Next is a patch
that helps you track which Arch command (get/replay/apply-delta) is used
for each changeset.
tla replay is the most common for any halfway normal (changeset-based)
tree by far.
tla get is not called any more often than before.
apply-delta is hardly, if ever called. It may not even be reachable
unless somebody commits revisions to the same tree with clocks out of
order from patchlevel order. Heck, if it's ever called, it's most
likely faster just to rmtree and tla get again.
Unfortunately, my heavily used and abused trees are private.
> Additional comments follow...
>
> On 11/13/05, Eric Wong <normalperson@yhbt.net> wrote:
> > > > * Identify git branches as an Arch "archive,category<--branch>--version"
> > > > Anything less than that is ambiguous as far as history and patch
> > > > relationships go.
> > >
> > > These bug/sanity fixes are _good_. As you mention, I wasn't aware that
> > > patchnames could show up not having a --branch part. Tricky...
> >
> > Thanks. I got lazy one day and started ignoring --branch on some of my
> > personal projects to save my fingers :)
>
> Yup, makes sense. My concern now is that existing imports will change
> the name of branches and tags going forward. Can I ask you to resend
> that patch with the new branchname mangling as default, and the old
> one as optional?
Ok, good idea. My previous patch already automatically converted the
private tags, which we actually need to parse, and I see no reason to
change that, but branch names and public tags which affect
non-gitarchimport users can be preserved with the -o flag.
> I know it'll force us to go back to using shellquote, but I am not too
> worried by that dependency at the moment.
Actually, usage of shell_quote() in git-archimport was always
unnecessary. Passing arguments to external programs as an array,
using the 3-argument version of open() for files, and using -z in
git-commands with pipes are better ways to go.
> > > > Current weaknesses:
> > > >
> > > > * (Present in the original code as well).
> > > > The code still assumes that dates in commit logs can be trusted, which is
> > > > fine in most cases, but a wayward branch can screw up git-archimport and
> > > > cause parents to be missed.
> > >
> > > Fair enough. You mention an alternative strategy (tla ancestry) --
> > > have you tried it at all?
> >
> > No, not yet.
>
> Also interested in this if you get around to it.
It's not a high priority for me and I probably don't have time to do
this.
--
Eric Wong
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox