* What's in git.git
From: Junio C Hamano @ 2006-03-06 7:13 UTC (permalink / raw)
To: git
The "deathmatch" between Ryan's annotate and Fredrik's blame is
officially on. Currently the last test in all three branches
fail. Please do not get alarmed.
I'd like asciidoc tweaks in "next" by Francis Daly tested by
people who have access to different vintages of docbook-xsl by
trying to build manpages. Look for displayed examples, such as
the one in git-branch documentation. I've tried it with v1.68
and getting far better results than before, and Francis says
v1.69 works fine with or without the change. IOW this is a
workaround for a problem in v1.68.
I've been tweaking on-and-off the similarity estimator in the
"next" branch. It has become independent from the xdelta code
used for pack generation. It may detect more renames that it
missed before, and it may miss some other renames and copies.
In general, it seems that the algorithm tends to detect slightly
more breaks than before. I'd appreciate feedback from people
interested in this area.
Another thing I have started in "pu" branch is to stop placing
an object we decided to delta that is already max-depth deep
back in the delta-base window, because such a thing only wastes
the delta base slot. The changed pack-objects does pick up more
delta, but the resulting pack seems bigger and I am puzzled why.
This may suggest that our criteria to delta should be tightened
a bit (the value of max_size in try_delta should be decreased).
We are better off storing a plain deflated representation instad
of generating a bad, bigger delta. Insights?
-- -- --
* The 'master' branch has these since the last announcement.
- Documentation fixes (Dmitry V. Levin, Mark Wooding, Martin
Langhoff, Jeff Muizelaar)
git/Documentation: fix SYNOPSIS style bugs
Documentation/Makefile: Some `git-*.txt' files aren't manpages.
cvsserver: updated documentation
cosmetics: change from 'See-Also' to 'See Also'
documentation: add 'see also' sections to git-rm and git-add
- The deathmatch between annotate/blame (Ryan Anderson, Fredrik
Kuivinen, me cheerleading)
annotate: Support annotation of files on other revisions.
git-blame: Make the output human readable
git-blame: Use the same tests for git-blame as for git-annotate
blame: avoid -lm by not using log().
blame and annotate: show localtime with timezone.
blame: avoid "diff -u0".
annotate/blame tests updates.
annotate-blame test: don't "source", but say "."
annotate-blame test: add evil merge.
- Tweak rev-list (Linus Torvalds)
get_revision(): do not dig deeper when we know we are at the end.
- Fix git-commit --amend (me)
git-commit --amend: allow empty commit.
- Misc fixes and cleanups (Mark Wooding and me)
gitignore: Ignore some more boring things.
contrib/emacs/Makefile: Provide tool for byte-compiling files.
Const tightening.
* The 'next' branch, in addition, has these.
- Fix manpage formatting (Francis Daly)
Tweak asciidoc output to work with broken docbook-xsl
- Tweak break/rename/copy similarity estimator tweaks (me)
diffcore-rename: similarity estimator fix.
count-delta: no need for this anymore.
diffcore-break: similarity estimator fix.
diffcore-delta: make change counter to byte oriented again.
- Help pack generation tweaks (me)
verify-pack -v: show delta-chain histogram.
- checkout-index --temp (Shawn Pearce)
Add --temp and --stage=all options to checkout-index.
* The 'pu' branch, in addition, has these.
- WIP: pack generation tweak (me)
[WIP] do not waste delta window with objects with already at max-depth.
^ permalink raw reply
* Re: Looking for SCM that lets me publish part of a repository
From: Alan Chandler @ 2006-03-06 6:54 UTC (permalink / raw)
To: git
In-Reply-To: <1141608679.16980.12.camel@mattlaptop>
On Monday 06 March 2006 01:31, Matt McCutchen wrote:
> Dear GIT people,
>
> For the last week or so, I have been looking for a SCM system to hold
> many of my projects, some of which are available to the public and
> others of which are not. It would be nice if I could use a single large
> private repository on my computer with each project in a separate
> folder.
Not sure why you would want to do this against having lots of smaller
repositories - (I have lots of small repositories - its mostly java, and my
shared library files have their own repository which is automatically
exported to where my projects can access it when I commit to it via a post
commit hook - you can see the public version of them on my web site) but ...
Create each project on a separate branch of the common repository and ensure
only the files you want in each project remains on each branch (and any
shared files can exist in all branches).
In your "remotes" files you list the branches that you want to push to your
public repository.
--
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Shawn Pearce @ 2006-03-06 6:32 UTC (permalink / raw)
To: git
In-Reply-To: <7vpsl0ayij.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
> > git-diff Makefile
> > git-diff HEAD Makefile
> >
> > ? (Which is rather ugly as what if you have a tracked file actually
> > called HEAD and you want the first form when the commit-ish is
> > omitted.) So accepting an optional commit-ish before the filename
> > would be in line with what git-diff accepts today.
>
> The use of "start of filelist" marker "--" is optional when
> unambiguous, and that is why "git-diff Makefile" works. To view
> the change you still haven't update-index'ed to the path called
> "HEAD", you would naturally say "git-diff -- HEAD"
Naturally. :-)
After getting along fine with `git-diff foo` for months I would
natually not be surprised when `git-diff foo` didn't work because
I performed a `git-checkout -b foo pu` one day.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] Add git-annotate(1) and git-blame(1)
From: Ryan Anderson @ 2006-03-06 6:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jonas Fonseca, git
In-Reply-To: <7v3bhwcezy.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
Junio C Hamano wrote:
>Jonas Fonseca <fonseca@diku.dk> writes:
>
>
>
>>Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
>>
>>
>
>Wonderful, but I was hoping the "deathmatch" would leave only
>one that needs to be documented and we could wait documenting
>until then ;-).
>
>
heh. If I'm not mistaken, blame is still lacking rename following (at
least, in master), and annotate is still misrepresenting things on
merges, so we've got a bit of a ways to go still.
--
Ryan Anderson
sometimes Pug Majere
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Junio C Hamano @ 2006-03-06 6:28 UTC (permalink / raw)
To: gitzilla; +Cc: git
In-Reply-To: <440BD4F4.3060906@gmail.com>
> Is there any reason that git-{annotate,blame} can't take more than one
> filename, ever?
I do not see it would be much useful -- the output does not
have a sign to show file boundary.
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: A Large Angry SCM @ 2006-03-06 6:21 UTC (permalink / raw)
To: Shawn Pearce
Cc: Ryan Anderson, Martin Langhoff, Fredrik Kuivinen, git, junkio
In-Reply-To: <20060306055036.GB26820@spearce.org>
Shawn Pearce wrote:
> Ryan Anderson <ryan@michonline.com> wrote:
>>A Large Angry SCM wrote:
>>
>>>Ryan Anderson wrote:
>>>...
>>>
>>>>For annotate, the syntax I was using was:
>>>> git annotate Makefile headname
>>>>
>>>>I'm not married to it, so please, send a patch to change it if you want
>>>>(Please fix up the test case I'm sending in this patch, as well.)
>>>>
>>>Wouldn't
>>> git annotate <headname> <filename(s?)>
>>>be more consistent with other git commands?
>>>
>>Yes, but <headname> (really, a commitish) needs to be optional.
>>
>>I should probably switch to:
>> git annotate [-c|--commit <committish>] <filename>
>>but that's partly why I'm asking for feedback.
That works.
Or maybe:
git-annotate [<committish> --] <filename(s?)>
or:
git-annotate [<committish>] -- <filename(s?)>
>
> Yes but doesn't git-diff accept:
>
> git-diff Makefile
> git-diff HEAD Makefile
>
> ? (Which is rather ugly as what if you have a tracked file actually
> called HEAD and you want the first form when the commit-ish is
> omitted.) So accepting an optional commit-ish before the filename
> would be in line with what git-diff accepts today.
>
> But maybe breaking convention from git-diff now is a good thing,
> with a future change to cleanup git-diff.
>
Looking at the documentation, it looks like all of the commands that
take paths do so as the last arguments. With any commit/tree arguments
being, either, required or flagged.
Is there any reason that git-{annotate,blame} can't take more than one
filename, ever?
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Junio C Hamano @ 2006-03-06 6:16 UTC (permalink / raw)
To: git
In-Reply-To: <20060306055036.GB26820@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
> git-diff Makefile
> git-diff HEAD Makefile
>
> ? (Which is rather ugly as what if you have a tracked file actually
> called HEAD and you want the first form when the commit-ish is
> omitted.) So accepting an optional commit-ish before the filename
> would be in line with what git-diff accepts today.
The use of "start of filelist" marker "--" is optional when
unambiguous, and that is why "git-diff Makefile" works. To view
the change you still haven't update-index'ed to the path called
"HEAD", you would naturally say "git-diff -- HEAD"
^ permalink raw reply
* [PATCH] annotate/blame tests updates.
From: Junio C Hamano @ 2006-03-06 6:12 UTC (permalink / raw)
To: Ryan Anderson; +Cc: Fredrik Kuivinen, git, junkio
In-Reply-To: <440BA4DA.9060101@michonline.com>
Ryan Anderson <ryan@michonline.com> writes:
>>+test_expect_success \
>>+ 'check all lines blamed on A' \
>>+ '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
>>
>>
> This should be $PROG as well, I suspect.
True. Also I am suspecting this awk being a but unsafe. The
default author is "A U Thor <author@example.com>", and without
FS specified awk would split at whitespaces.
I haven't pushed out the test-case sharing by Fredrik yet, but I
have already taken it. This patch is on top of it.
-- >8 --
This rewrites the result check code a bit. The earlier one
using awk was splitting columns at any whitespace, which
confused lines attributed incorrectly to the merge made by the
default author "A U Thor <author@example.com>" with lines
attributed to author "A".
The latest test by Ryan to add the "starting from older commit"
test is also included, with another older commit test.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
t/annotate-tests.sh | 81 ++++++++++++++++++++++++++++-----------------------
1 files changed, 44 insertions(+), 37 deletions(-)
92a903acfd0904e6dd6d18112428429938783d19
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 54a4dfb..d25a7a1 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -1,6 +1,37 @@
# This file isn't used as a test script directly, instead it is
# sourced from t8001-annotate.sh and t8001-blame.sh.
+check_count () {
+ head=
+ case "$1" in -h) head="$2"; shift; shift ;; esac
+ $PROG file $head | perl -e '
+ my %expect = (@ARGV);
+ my %count = ();
+ while (<STDIN>) {
+ if (/^[0-9a-f]+\t\(([^\t]+)\t/) {
+ my $author = $1;
+ for ($author) { s/^\s*//; s/\s*$//; }
+ if (exists $expect{$author}) {
+ $count{$author}++;
+ }
+ }
+ }
+ my $bad = 0;
+ while (my ($author, $count) = each %count) {
+ my $ok;
+ if ($expect{$author} != $count) {
+ $bad = 1;
+ $ok = "bad";
+ }
+ else {
+ $ok = "good";
+ }
+ print STDERR "Author $author (expected $expect{$author}, attributed $count) $ok\n";
+ }
+ exit($bad);
+ ' "$@"
+}
+
test_expect_success \
'prepare reference tree' \
'echo "1A quick brown fox jumps over the" >file &&
@@ -10,7 +41,7 @@ test_expect_success \
test_expect_success \
'check all lines blamed on A' \
- '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
+ 'check_count A 2'
test_expect_success \
'Setup new lines blamed on B' \
@@ -19,12 +50,8 @@ test_expect_success \
GIT_AUTHOR_NAME="B" git commit -a -m "Second."'
test_expect_success \
- 'Two lines blamed on A' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "A") == 2 ]'
-
-test_expect_success \
- 'Two lines blamed on B' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "B") == 2 ]'
+ 'Two lines blamed on A, two on B' \
+ 'check_count A 2 B 2'
test_expect_success \
'merge-setup part 1' \
@@ -34,16 +61,8 @@ test_expect_success \
GIT_AUTHOR_NAME="B1" git commit -a -m "Branch1-1"'
test_expect_success \
- 'Two lines blamed on A' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
-
-test_expect_success \
- 'Two lines blamed on B' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 2 ]'
-
-test_expect_success \
- 'Two lines blamed on B1' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
+ 'Two lines blamed on A, two on B, two on B1' \
+ 'check_count A 2 B 2 B1 2'
test_expect_success \
'merge-setup part 2' \
@@ -53,34 +72,22 @@ test_expect_success \
GIT_AUTHOR_NAME="B2" git commit -a -m "Branch2-1"'
test_expect_success \
- 'Two lines blamed on A' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
-
-test_expect_success \
- 'One line blamed on B' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
-
-test_expect_success \
- 'One line blamed on B2' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'
-
+ 'Two lines blamed on A, one on B, one on B2' \
+ 'check_count A 2 B 1 B2 1'
test_expect_success \
'merge-setup part 3' \
'git pull . branch1'
test_expect_success \
- 'Two lines blamed on A' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
+ 'Two lines blamed on A, one on B, two on B1, one on B2' \
+ 'check_count A 2 B 1 B1 2 B2 1'
test_expect_success \
- 'One line blamed on B' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
+ 'Annotating an old revision works' \
+ 'check_count -h master A 2 B 2'
test_expect_success \
- 'Two lines blamed on B1' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
+ 'Annotating an old revision works' \
+ 'check_count -h master^ A 2'
-test_expect_success \
- 'One line blamed on B2' \
- '[ $($PROG file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'
--
1.2.4.g4668
^ permalink raw reply related
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Shawn Pearce @ 2006-03-06 5:50 UTC (permalink / raw)
To: Ryan Anderson; +Cc: gitzilla, Martin Langhoff, Fredrik Kuivinen, git, junkio
In-Reply-To: <440BCB67.4070406@michonline.com>
Ryan Anderson <ryan@michonline.com> wrote:
> A Large Angry SCM wrote:
>
> > Ryan Anderson wrote:
> > ...
> >
> >>
> >> For annotate, the syntax I was using was:
> >> git annotate Makefile headname
> >>
> >> I'm not married to it, so please, send a patch to change it if you want
> >> (Please fix up the test case I'm sending in this patch, as well.)
> >>
> >
> > Wouldn't
> > git annotate <headname> <filename(s?)>
> > be more consistent with other git commands?
> >
> Yes, but <headname> (really, a commitish) needs to be optional.
>
> I should probably switch to:
> git annotate [-c|--commit <committish>] <filename>
> but that's partly why I'm asking for feedback.
Yes but doesn't git-diff accept:
git-diff Makefile
git-diff HEAD Makefile
? (Which is rather ugly as what if you have a tracked file actually
called HEAD and you want the first form when the commit-ish is
omitted.) So accepting an optional commit-ish before the filename
would be in line with what git-diff accepts today.
But maybe breaking convention from git-diff now is a good thing,
with a future change to cleanup git-diff.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Ryan Anderson @ 2006-03-06 5:40 UTC (permalink / raw)
To: gitzilla; +Cc: Martin Langhoff, Fredrik Kuivinen, git, junkio
In-Reply-To: <440BC92E.4060306@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
A Large Angry SCM wrote:
> Ryan Anderson wrote:
> ...
>
>>
>> For annotate, the syntax I was using was:
>> git annotate Makefile headname
>>
>> I'm not married to it, so please, send a patch to change it if you want
>> (Please fix up the test case I'm sending in this patch, as well.)
>>
>
> Wouldn't
> git annotate <headname> <filename(s?)>
> be more consistent with other git commands?
>
Yes, but <headname> (really, a commitish) needs to be optional.
I should probably switch to:
git annotate [-c|--commit <committish>] <filename>
but that's partly why I'm asking for feedback.
--
Ryan Anderson
sometimes Pug Majere
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply
* Re: [PATCH] Add git-annotate(1) and git-blame(1)
From: Junio C Hamano @ 2006-03-06 5:35 UTC (permalink / raw)
To: Jonas Fonseca; +Cc: git
In-Reply-To: <20060306052444.GC6487@diku.dk>
Jonas Fonseca <fonseca@diku.dk> writes:
> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Wonderful, but I was hoping the "deathmatch" would leave only
one that needs to be documented and we could wait documenting
until then ;-).
^ permalink raw reply
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: A Large Angry SCM @ 2006-03-06 5:31 UTC (permalink / raw)
To: Ryan Anderson; +Cc: Martin Langhoff, Fredrik Kuivinen, git, junkio
In-Reply-To: <20060306024353.GA23001@mythryan2.michonline.com>
Ryan Anderson wrote:
...
>
> For annotate, the syntax I was using was:
> git annotate Makefile headname
>
> I'm not married to it, so please, send a patch to change it if you want
> (Please fix up the test case I'm sending in this patch, as well.)
>
Wouldn't
git annotate <headname> <filename(s?)>
be more consistent with other git commands?
^ permalink raw reply
* [PATCH] Add git-annotate(1) and git-blame(1)
From: Jonas Fonseca @ 2006-03-06 5:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-annotate.txt | 44 ++++++++++++++++++++++++++++++++++++++++
Documentation/git-blame.txt | 31 ++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-annotate.txt
create mode 100644 Documentation/git-blame.txt
c280414507b072689afd3061a2d43527ebab292e
diff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt
new file mode 100644
index 0000000..1cfc3e3
--- /dev/null
+++ b/Documentation/git-annotate.txt
@@ -0,0 +1,44 @@
+git-annotate(1)
+===============
+
+NAME
+----
+git-annotate - annotate file lines with commit info
+
+SYNOPSIS
+--------
+git-annotate [options] file [revision]
+
+DESCRIPTION
+-----------
+Annotates each line in the given file with information from the commit
+which introduced the line. Optionally annotate from a given revision.
+
+OPTIONS
+-------
+-l, --long::
+ Show long rev (Defaults off).
+
+-t, --time::
+ Show raw timestamp (Defaults off).
+
+-r, --rename::
+ Follow renames (Defaults on).
+
+-S, --rev-file <revs-file>::
+ Use revs from revs-file instead of calling git-rev-list.
+
+-h, --help::
+ Show help message.
+
+SEE ALSO
+--------
+gitlink:git-blame[1]
+
+AUTHOR
+------
+Written by Ryan Anderson <ryan@michonline.com>.
+
+GIT
+---
+Part of the gitlink:git[7] suite
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
new file mode 100644
index 0000000..bdf28d9
--- /dev/null
+++ b/Documentation/git-blame.txt
@@ -0,0 +1,31 @@
+git-blame(1)
+============
+
+NAME
+----
+git-blame - blame file lines on commits
+
+SYNOPSIS
+--------
+git-blame revision file
+
+DESCRIPTION
+-----------
+Annotates each line in the given file with information from the commit
+which introduced the line. Start annotation from the given revision.
+
+OPTIONS
+-------
+No options.
+
+SEE ALSO
+--------
+gitlink:git-annotate[1]
+
+AUTHOR
+------
+Written by Fredrik Kuivinen <freku045@student.liu.se>.
+
+GIT
+---
+Part of the gitlink:git[7] suite
--
1.2.4.g9201
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH] repo-config: give value_ a sane default so regexec won't segfault
From: Jonas Fonseca @ 2006-03-06 5:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
repo-config.c | 5 ++++-
t/t1300-repo-config.sh | 8 ++++++++
2 files changed, 12 insertions(+), 1 deletions(-)
7fcdb6b9c8c75a0c84076b4a0ebc46b4c7383906
diff --git a/repo-config.c b/repo-config.c
index 9cf6519..c5ebb76 100644
--- a/repo-config.c
+++ b/repo-config.c
@@ -14,6 +14,9 @@ static enum { T_RAW, T_INT, T_BOOL } typ
static int show_config(const char* key_, const char* value_)
{
+ if (value_ == NULL)
+ value_ = "";
+
if (!strcmp(key_, key) &&
(regexp == NULL ||
(do_not_match ^
@@ -35,7 +38,7 @@ static int show_config(const char* key_,
sprintf(value, "%s", git_config_bool(key_, value_)
? "true" : "false");
} else {
- value = strdup(value_ ? value_ : "");
+ value = strdup(value_);
}
seen++;
}
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 207dd3d..ab4dd5c 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -247,5 +247,13 @@ EOF
test_expect_success 'hierarchical section value' 'cmp .git/config expect'
+cat > .git/config << EOF
+[novalue]
+ variable
+EOF
+
+test_expect_success 'get variable with no value' \
+ 'git-repo-config --get novalue.variable ^$'
+
test_done
--
1.2.4.g9201
--
Jonas Fonseca
^ permalink raw reply related
* Re: [PATCH] annotate: Support annotation of files on other revisions.
From: Martin Langhoff @ 2006-03-06 4:18 UTC (permalink / raw)
To: Ryan Anderson; +Cc: Fredrik Kuivinen, git, junkio
In-Reply-To: <20060306024353.GA23001@mythryan2.michonline.com>
On 3/6/06, Ryan Anderson <ryan@michonline.com> wrote:
> annotate was *trying* to handle that cleanly, but failed due to a silly
Great stuff, thanks! I'll let it hit master and then I'll drop the
messy part of req_annotate() in cvsserver.
> For annotate, the syntax I was using was:
> git annotate Makefile headname
>
> I'm not married to it, so please, send a patch to change it if you want
> (Please fix up the test case I'm sending in this patch, as well.)
That's _perfect_. I was just making the syntax up.
cheers,
martin
^ permalink raw reply
* Re: git clone downloads objects that are in GIT_OBJECT_DIRECTORY
From: sean @ 2006-03-06 3:31 UTC (permalink / raw)
To: Shawn Pearce; +Cc: junkio, git
In-Reply-To: <20060306025702.GH25790@spearce.org>
On Sun, 5 Mar 2006 21:57:02 -0500
Shawn Pearce <spearce@spearce.org> wrote:
> It might be nicer if the user could place a list of locally (here
> locally being possibly remote but closer network-wise) available
> repositories which should be considered as sources for faster
> cloning. When cloning a remote repository git-clone would try to
> examine each of the designated repositories to see if any of them
> have commits in common with the remote; if so clone off that and
> then pull from the remote, but designating the remote as `origin'.
It is already easy to start from a similar repo (eg. locally cloned)
if you wish to conserve bandwidth.
However, it might be nice to have a command that allows you to
change origin information for a repo without needing to know git
internals; maybe something like:
$ git set-origin <URL>
Or maybe better:
$ git set-remote --pull master:origin origin <URL>
Sean
^ permalink raw reply
* Re: git clone downloads objects that are in GIT_OBJECT_DIRECTORY
From: Shawn Pearce @ 2006-03-06 2:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vfylwcncn.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
> > Benjamin LaHaise <bcrl@kvack.org> wrote:
> >> Hi folks,
> >>
> >> Doing a fresh git clone git://some.git.url/ foo seems to download the
> >> entire remote repository even if all the objects are already stored in
> >> GIT_OBJECT_DIRECTORY=/home/bcrl/.git/object . Is this a known bug?
> >> At 100MB for a kernel, this takes a *long* time.
> >
> > I believe it is a known missing feature. :-) git-clone doesn't
> > prep HEAD to have some sort of starting point so the pull it uses
> > to download everything literally downloads everything as nothing
> > is in common.
>
> You would first 'clone -l -s' from your local repository and
> then clone into that from whatever remote, perhaps.
Yea but that's about as much fun as creating a bare repository
by hand. (Which I've been doing up until this thread prompted me
to read git-clone.sh and learn the existance of --bare.)
It might be nicer if the user could place a list of locally (here
locally being possibly remote but closer network-wise) available
repositories which should be considered as sources for faster
cloning. When cloning a remote repository git-clone would try to
examine each of the designated repositories to see if any of them
have commits in common with the remote; if so clone off that and
then pull from the remote, but designating the remote as `origin'.
This could be ugly if you have a large number of locally available
candidates or if the candidates are many (e.g. 1000s) commits
behind the remote being cloned. But it would save the user from
pulling down 100+MB of objects they already have while making it
very convient to establish a new repository+working directory based
on someone else's publically available repository.
Or we could just tell the user to create their own clone script,
e.g. kernel-clone:
#!/bin/sh
git-clone -l -n -s ~/kernel-base "$2" &&
cd "$2" &&
echo "URL: $1" >.git/remotes/origin &&
echo "Pull: master:origin" >>.git/remotes/origin &&
git-pull
But it would be better if it was more integrated, and somehow
slightly more automatic...
--
Shawn.
^ permalink raw reply
* Re: [PATCH] git-blame: Use the same tests for git-blame as for git-annotate
From: Ryan Anderson @ 2006-03-06 2:56 UTC (permalink / raw)
To: Fredrik Kuivinen; +Cc: git, junkio
In-Reply-To: <20060305111334.GB23448@c165.ib.student.liu.se>
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Fredrik Kuivinen wrote:
>Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
>
>
>---
>
> t/annotate-tests.sh | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++
> t/t8001-annotate.sh | 85 +-------------------------------------------------
> t/t8002-blame.sh | 9 +++++
> 3 files changed, 97 insertions(+), 83 deletions(-)
> create mode 100644 t/annotate-tests.sh
> create mode 100755 t/t8002-blame.sh
>
>06b0e500a5202899dcfd037cf78ee4a982da46b4
>diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
>new file mode 100644
>index 0000000..54a4dfb
>--- /dev/null
>+++ b/t/annotate-tests.sh
>@@ -0,0 +1,86 @@
>+# This file isn't used as a test script directly, instead it is
>+# sourced from t8001-annotate.sh and t8001-blame.sh.
>+
>+test_expect_success \
>+ 'prepare reference tree' \
>+ 'echo "1A quick brown fox jumps over the" >file &&
>+ echo "lazy dog" >>file &&
>+ git add file
>+ GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
>+
>+test_expect_success \
>+ 'check all lines blamed on A' \
>+ '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
>
>
This should be $PROG as well, I suspect.
Also, we need to agree on a syntax for working on non-HEAD revisions.
"git annotate $file $commitish" is what I had been using, but it's
really not something I feel strongly about.
--
Ryan Anderson
sometimes Pug Majere
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
^ permalink raw reply
* [PATCH] annotate: Support annotation of files on other revisions.
From: Ryan Anderson @ 2006-03-06 2:43 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Fredrik Kuivinen, git, junkio
In-Reply-To: <46a038f90603051629ke34a0a6u89dad995bbd777b0@mail.gmail.com>
This is a bug fix, and cleans up one or two other things spotted during the
course of tracking down the main bug here.
Also, the test-suite is updated to reflect this case.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
---
git-annotate.perl | 7 +++++--
t/t8001-annotate.sh | 6 ++++++
2 files changed, 11 insertions(+), 2 deletions(-)
On Mon, Mar 06, 2006 at 01:29:32PM +1300, Martin Langhoff wrote:
> On 3/6/06, Ryan Anderson <ryan@michonline.com> wrote:
> > Along these lines, if anyone can pin down the complicated cases that
> > annotate and blame get differently, adding them as a test would be
> > *exceedingly* appreciated, even if it makes annotate (or blame) fail for
> > a bit, it gives us something to work against.
>
> It would be great if they both worked properly with paths that existed
> in the past. Right now, I can't git-annotate or git-blame a file I
> know was there in a past revision. I think I had taught Johannes'
> annotate to deal with this, or at least intended to. As things stand,
> git-annotate/git-blame need a checkout, which is really silly.
annotate was *trying* to handle that cleanly, but failed due to a silly
bug. This is the same bug that Junio pointed out:
cd t
./t8001-annotate.sh
cd trash
../../git-annotate file master
This is fixed by the patch at the end of this email.
> Tools like gitweb and cvsserver should be able to do:
>
> GIT_DIR=/somebarerepo/git.git git-(annotate|blame) -h headname Makefile
>
> and not worry about creating a temporary index *and* checking out
> Makefile so that things work. That's what cvsserver does now, anyway.
> Ugly :-(
For annotate, the syntax I was using was:
git annotate Makefile headname
I'm not married to it, so please, send a patch to change it if you want
(Please fix up the test case I'm sending in this patch, as well.)
cdd80fd28d300dd2400bf75ff64ae2bf1a8b92aa
diff --git a/git-annotate.perl b/git-annotate.perl
index d93ee19..5953ac6 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -10,6 +10,7 @@ use warnings;
use strict;
use Getopt::Long;
use POSIX qw(strftime gmtime);
+use Data::Dumper;
sub usage() {
print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
@@ -99,7 +100,7 @@ while (my $bound = pop @stack) {
}
}
push @revqueue, $head;
-init_claim( defined $starting_rev ? $starting_rev : 'dirty');
+init_claim( defined $starting_rev ? $head : 'dirty');
unless (defined $starting_rev) {
my $diff = open_pipe("git","diff","-R", "HEAD", "--",$filename)
or die "Failed to call git diff to check for dirty state: $!";
@@ -345,6 +346,7 @@ sub git_cat_file {
return () unless defined $rev && defined $filename;
my $blob = git_ls_tree($rev, $filename);
+ die "Failed to find a blob for $filename in rev $rev\n" if !defined $blob;
my $catfile = open_pipe("git","cat-file", "blob", $blob)
or die "Failed to git-cat-file blob $blob (rev $rev, file $filename): " . $!;
@@ -367,12 +369,13 @@ sub git_ls_tree {
my ($mode, $type, $blob, $tfilename);
while(<$lstree>) {
+ chomp;
($mode, $type, $blob, $tfilename) = split(/\s+/, $_, 4);
last if ($tfilename eq $filename);
}
close($lstree);
- return $blob if $filename eq $filename;
+ return $blob if ($tfilename eq $filename);
die "git-ls-tree failed to find blob for $filename";
}
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index 172908a..761d0bc 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -87,4 +87,10 @@ test_expect_success \
'One line blamed on B2' \
'[ $(git annotate file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'
+test_expect_success \
+ 'Annotating an old revision works' \
+ '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") == 2 ] && \
+ [ $(git annotate file master | awk "{print \$3}" | grep -c "^B$") == 2 ]'
+
+
test_done
--
1.2.4.g9201-dirty
--
Ryan Anderson
sometimes Pug Majere
^ permalink raw reply related
* Re: git clone downloads objects that are in GIT_OBJECT_DIRECTORY
From: Junio C Hamano @ 2006-03-06 2:34 UTC (permalink / raw)
To: Shawn Pearce; +Cc: git
In-Reply-To: <20060306014253.GD25790@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
> Benjamin LaHaise <bcrl@kvack.org> wrote:
>> Hi folks,
>>
>> Doing a fresh git clone git://some.git.url/ foo seems to download the
>> entire remote repository even if all the objects are already stored in
>> GIT_OBJECT_DIRECTORY=/home/bcrl/.git/object . Is this a known bug?
>> At 100MB for a kernel, this takes a *long* time.
>
> I believe it is a known missing feature. :-) git-clone doesn't
> prep HEAD to have some sort of starting point so the pull it uses
> to download everything literally downloads everything as nothing
> is in common.
You would first 'clone -l -s' from your local repository and
then clone into that from whatever remote, perhaps.
^ permalink raw reply
* Re: Looking for SCM that lets me publish part of a repository
From: Shawn Pearce @ 2006-03-06 1:48 UTC (permalink / raw)
To: Matt McCutchen; +Cc: git
In-Reply-To: <1141608679.16980.12.camel@mattlaptop>
Matt McCutchen <hashproduct@verizon.net> wrote:
> For the last week or so, I have been looking for a SCM system to hold
> many of my projects, some of which are available to the public and
> others of which are not. It would be nice if I could use a single large
> private repository on my computer with each project in a separate
> folder. Then I would like to pull some of the projects (but not all)
> into a world-readable repository on my Web site. I have looked at
> several SCMs and have not found a way to make any of them do this, but I
> like GIT best on other grounds. Is there a way I can coerce GIT to
> clone and pull one folder out of a repository but ignore the rest?
No. And actually this is probably not the best way to use GIT.
If you want to segment your work into ``public'' and ``non-public''
then you should at least segment your work into two repositories:
``public'' and ``non-public''. But you really should segment your
repository to a project-by-project basis. That is each project
should have its own repository.
That said if there are many files which will have identical content
across many projects you may be able to save disk space by placing
all objects into a single object directory; but that's entirely
independent of project organization.
Unlike CVS, Subversions, etc. GIT repositories are dirt-cheap to
create. Don't think twice about creating a different repository
for a new project. I think I'm up on about 50 repositories at
this point; however each one is typically less than a megabyte in
total size.
--
Shawn.
^ permalink raw reply
* Re: git clone does not work with GIT_OBJECT_DIRECTORY set
From: Benjamin LaHaise @ 2006-03-06 1:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vmzg4cq6y.fsf@assigned-by-dhcp.cox.net>
On Sun, Mar 05, 2006 at 05:33:25PM -0800, Junio C Hamano wrote:
> Please try it without GIT_OBJECT_DIRECTORY and see it works
> correctly (I think it should). If that is the case, maybe
> git-clone should explicitly unset GIT_OBJECT_DIRECTORY.
Nope. There is no .git/objects directory, so how would it be able to
find the objects?
-ben
--
"Time is of no importance, Mr. President, only life is important."
Don't Email: <dont@kvack.org>.
^ permalink raw reply
* Re: git clone downloads objects that are in GIT_OBJECT_DIRECTORY
From: Shawn Pearce @ 2006-03-06 1:42 UTC (permalink / raw)
To: git
In-Reply-To: <20060306010825.GF20768@kvack.org>
Benjamin LaHaise <bcrl@kvack.org> wrote:
> Hi folks,
>
> Doing a fresh git clone git://some.git.url/ foo seems to download the
> entire remote repository even if all the objects are already stored in
> GIT_OBJECT_DIRECTORY=/home/bcrl/.git/object . Is this a known bug?
> At 100MB for a kernel, this takes a *long* time.
I believe it is a known missing feature. :-) git-clone doesn't
prep HEAD to have some sort of starting point so the pull it uses
to download everything literally downloads everything as nothing
is in common.
One could work around it by running git-init-db to create the new
clone locally, git-update-ref HEAD to some commit which you have in
common with the remote, create a origin file, then perform a git-pull.
This would only download the objects between the commit you put into
HEAD and the current master of the remote... But that is actually
some work.
I think Cogito's clone is capable of restarting a failed clone; I
wonder if that logic would benefit you here?
Is using a common GIT_OBJECT_DIRECTORY across many clones actually
pretty common? Maybe its time that git-clone gets some more smarts
with regards to what it yanks from the origin.
--
Shawn.
^ permalink raw reply
* Re: git clone does not work with GIT_OBJECT_DIRECTORY set
From: Junio C Hamano @ 2006-03-06 1:33 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: git
In-Reply-To: <20060306012115.GG20768@kvack.org>
Benjamin LaHaise <bcrl@kvack.org> writes:
> And another bug (linux-2.6.git was created with a clone of git://.../
> while GIT_OBJECT_DIRECTORY was set):
>
> $ git clone linux-2.6.git bootcache.git
> fatal: '/home/bcrl/linux-2.6.git/.git': unable to chdir or not a git archive
> fatal: unexpected EOF
> clone-pack from '/home/bcrl/linux-2.6.git/.git' failed.
> $
Please try it without GIT_OBJECT_DIRECTORY and see it works
correctly (I think it should). If that is the case, maybe
git-clone should explicitly unset GIT_OBJECT_DIRECTORY.
^ permalink raw reply
* Looking for SCM that lets me publish part of a repository
From: Matt McCutchen @ 2006-03-06 1:31 UTC (permalink / raw)
To: git
Dear GIT people,
For the last week or so, I have been looking for a SCM system to hold
many of my projects, some of which are available to the public and
others of which are not. It would be nice if I could use a single large
private repository on my computer with each project in a separate
folder. Then I would like to pull some of the projects (but not all)
into a world-readable repository on my Web site. I have looked at
several SCMs and have not found a way to make any of them do this, but I
like GIT best on other grounds. Is there a way I can coerce GIT to
clone and pull one folder out of a repository but ignore the rest?
--
Matt McCutchen
hashproduct@verizon.net
http://hashproduct.metaesthetics.net/
^ 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