* Re: I want to release a "git-1.0"
From: Linus Torvalds @ 2005-06-01 3:04 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: Git Mailing List
In-Reply-To: <m1psv7bjb6.fsf@ebiederm.dsl.xmission.com>
On Tue, 31 May 2005, Eric W. Biederman wrote:
>
> I way behind the power curve on learning git at this point but
> one piece of the puzzle that CVS has that I don't believe git does
> are multiple people committing to the same repository, especially
> remotely. I don't see that as a down side of git but it is a common
> way people CVS so it is worth documenting.
It's actually one thing git doesn't do per se.
You have to do a "git-pull-script" from the common repository side,
there's no "git-push-script". Ugly.
Anyway, I wrote just a _very_ introductory thing in
Documentation/tutorial.txt, I'll try to update and expand on it later. It
basically has a really stupid example of "how to set up a new project".
Linus
^ permalink raw reply
* cogito testsuite failure
From: Pavel Roskin @ 2005-06-01 3:47 UTC (permalink / raw)
To: Junio C Hamano, git
Hello!
"make test" fails for current cogito:
*** t4008-diff-break-rewrite.sh ***
* ok 1: setup
* ok 2: change file1 with copy-edit of file0 and remove file0
* ok 3: run diff with -B
* ok 4: validate result of -B (#1)
* ok 5: run diff with -B and -M
* ok 6: validate result of -B -M (#2)
* ok 7: swap file0 and file1
* ok 8: run diff with -B
* ok 9: validate result of -B (#3)
* ok 10: run diff with -B and -M
* ok 11: validate result of -B -M (#4)
* ok 12: make file0 into something completely different
* ok 13: run diff with -B
* FAIL 14: validate result of -B (#5) compare_diff_raw current expected
* ok 15: run diff with -B
* FAIL 16: validate result of -B -M (#6) compare_diff_raw current expected
* ok 17: run diff with -M
* FAIL 18: validate result of -M (#7) compare_diff_raw current expected
* ok 19: file1 edited to look like file0 and file0 rename-edited to file2
* ok 20: run diff with -B
* ok 21: validate result of -B (#8)
* ok 22: run diff with -B -M
* ok 23: validate result of -B -M (#9)
* failed 3 among 23 test(s)
The failures happens because the test uses file ../README, which was
changed recently (and therefore, its checksum changed as well). Also,
this and several other tests refer to ../COPYING, which is going to
change as well (it has an old mailing address of FSF).
I suggest that we use separate test files. It would be great if those
files included text in several languages to test support for non-ASCII
symbols (maybe HELLO from emacs sources).
Or maybe we could use short files embedded in the scripts. Or maybe we
could use sed to take significant portions of GPL that don't include
Linus' foreword, any mailing addresses or "19" when it's used as two
first digits of a year.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: [PATCH] ls-tree: handle trailing slashes in the pathspec properly.
From: Linus Torvalds @ 2005-06-01 3:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <7vy89uu9vc.fsf@assigned-by-dhcp.cox.net>
On Tue, 31 May 2005, Junio C Hamano wrote:
>
> BTW could you limit git-apply --stat output to 79 cols not 80?
Hmm, I thought I already did, but it turns out it could round up both
add/del, causing my 79 to be 80.
I think I fixed it.
Linus
^ permalink raw reply
* Re: I want to release a "git-1.0"
From: Junio C Hamano @ 2005-06-01 4:06 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0505312002160.1876@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> Anyway, I wrote just a _very_ introductory thing in
LT> Documentation/tutorial.txt, I'll try to update and expand on
LT> it later. It basically has a really stupid example of "how
LT> to set up a new project".
I've spotted a couple of typos which I will leave others to fix,
but there is one thing I am to blame.
(Btw, current versions of git will consider the change in question to be
so big that it's considered a whole new file, since the diff is actually
bigger than the file. So the helpful comments that git-commit-script
tells you for this example will say that you deleted and re-created the
file "a". For a less contrieved example, these things are usually more
obvious).
Do you want me to do something about this with -B (and possibly
-C/-M), like skipping the comparison altogether if the file size
is smaller than, say, 1k bytes or something silly like that? Or
not having special case for this kind of "contrived example"
preferrable?
^ permalink raw reply
* [PATCH] Unused pos[] in apply.c
From: Pavel Roskin @ 2005-06-01 4:20 UTC (permalink / raw)
To: git
Hello!
gcc 4.0 complains about current cogito (and current git from Linus):
apply.c: In function 'apply_patch':
apply.c:622: warning: 'pos[0]' is used uninitialized in this function
apply.c:624: warning: 'pos[1]' is used uninitialized in this function
Indeed, pos[] is never initialized and never used again.
My understanding of the code is that it's trying to figure out whether
the patch is adding or removing a file. If the first line for the chunk
or the line count for the old file is not 0, the old file existed, so
the patch is not adding the file. Conversely, non-zero position or line
count for the new file means we are not deleting it.
Following patch makes the code do what it was meant to do.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/apply.c b/apply.c
--- a/apply.c
+++ b/apply.c
@@ -611,7 +611,7 @@ static int parse_fragment(char *line, un
{
int added, deleted;
int len = linelen(line, size), offset;
- unsigned long pos[4], oldlines, newlines;
+ unsigned long oldlines, newlines;
offset = parse_fragment_header(line, len, fragment);
if (offset < 0)
@@ -619,9 +619,9 @@ static int parse_fragment(char *line, un
oldlines = fragment->oldlines;
newlines = fragment->newlines;
- if (patch->is_new < 0 && (pos[0] || oldlines))
+ if (patch->is_new < 0 && (fragment->oldpos || oldlines))
patch->is_new = 0;
- if (patch->is_delete < 0 && (pos[1] || newlines))
+ if (patch->is_delete < 0 && (fragment->newpos || newlines))
patch->is_delete = 0;
/* Parse the thing.. */
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: cogito testsuite failure
From: Junio C Hamano @ 2005-06-01 4:27 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1117597672.13776.17.camel@dv>
My intention was not to check the actual SHA1 in anything other
than t0000-basic.sh, but some test in t4000 series were buggy
and ended up comparing the SHA1.
I have since corrected them and I believe the test suite in the
current tip of Linus tree has the corrected compare_diff_raw and
friends in t/diff-lib.sh, which t4000 series use to avoid this
problem. I just hand munged COPYING and README and ran t4008 in
the Linus tree, and do not see the problem you are reporting.
Could you verify that your test failure is coming from the
version that was before t/diff-lib.sh was introduced? Otherwise
I have to investigate this further.
^ permalink raw reply
* Re: I want to release a "git-1.0"
From: Junio C Hamano @ 2005-06-01 4:53 UTC (permalink / raw)
To: David Lang; +Cc: Chris Wedgwood, Linus Torvalds, Git Mailing List
In-Reply-To: <Pine.LNX.4.62.0505311923240.19864@qynat.qvtvafvgr.pbz>
>>>>> "DL" == David Lang <david.lang@digitalinsight.com> writes:
DL> Hmm, thinking out loud. would it help to look at the deltify scripts
DL> and let them find the major chunks and then look in detail only when
DL> that fails?
It's unclear to me which part you are trying to help with
deltify algorithm [*1*].
Internally, git-diff-cache -B -C is used which does use the
deltify to locate complete rewrites, renames and copies (that's
why the script is so slow). For passing on and assigning blames
line by line, parsing "diff --unified=0" output was a lot easier
for this script and that was what I did in this quick-and-dirty
version.
[Footnotes]
*1* David says "deltify" and Nico calls it "deltafy". I am not
a native speaker so I cannot tell, but which one is correct?
^ permalink raw reply
* Re: cogito testsuite failure
From: Pavel Roskin @ 2005-06-01 5:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vzmuasnui.fsf@assigned-by-dhcp.cox.net>
Hi, Junio!
On Tue, 2005-05-31 at 21:27 -0700, Junio C Hamano wrote:
> My intention was not to check the actual SHA1 in anything other
> than t0000-basic.sh, but some test in t4000 series were buggy
> and ended up comparing the SHA1.
>
> I have since corrected them and I believe the test suite in the
> current tip of Linus tree has the corrected compare_diff_raw and
> friends in t/diff-lib.sh, which t4000 series use to avoid this
> problem. I just hand munged COPYING and README and ran t4008 in
> the Linus tree, and do not see the problem you are reporting.
>
> Could you verify that your test failure is coming from the
> version that was before t/diff-lib.sh was introduced? Otherwise
> I have to investigate this further.
The failure in on the "cogito" branch
(rsync://rsync.kernel.org/pub/scm/cogito/cogito.git), which doesn't have
t/diff-lib.sh.
The "git" branch (rsync://www.kernel.org/pub/scm/git/git.git) is fine.
Sorry for the noise. I should have checked that branch too.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: cogito testsuite failure
From: Junio C Hamano @ 2005-06-01 5:55 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1117604049.5755.3.camel@dv>
>>>>> "PR" == Pavel Roskin <proski@gnu.org> writes:
PR> The failure in on the "cogito" branch
PR> (rsync://rsync.kernel.org/pub/scm/cogito/cogito.git), which doesn't have
PR> t/diff-lib.sh.
PR> The "git" branch (rsync://www.kernel.org/pub/scm/git/git.git) is fine.
PR> Sorry for the noise. I should have checked that branch too.
No problem. Thanks.
^ permalink raw reply
* [PATCH] One Git To Rule Them All
From: Jason McMullan @ 2005-06-01 5:58 UTC (permalink / raw)
To: git
The following three patches (two prep and one 'real') fold all the
git-* commands into one 'git' command. This is useful for:
* Setting up git on a new machine - just one file to send
* Porcelain that customizes git (ie cogito) can have a
'cg-git' instead of trouncing on the default Plumbing git.
* Quick-ref help on all the Plumbing commands for free!
* git-<mumble> symlinks to git work as expected
* Documentation is now enforced for building
(bug? feature? you decide)
$ git help
GIT Commands:
local-pull Duplicates another GIT repository on a local system
http-pull Downloads a remote GIT repository via HTTP
rpull Pulls from a remote repository over ssh connection
rpush Helper "server-side" program used by git-rpull
rev-tree Provides the revision tree for one or more commits
rev-list Lists commit objects in reverse chronological order
export Exports each commit and a diff against each of its parents
read-tree Reads tree information into the directory cache
checkout-cache Copy files from the cache to the working directory
update-cache Modifies the index or directory cache
ls-tree Lists the contents of a tree object.
ls-files Information about files in the cache/working directory
cat-file Provide content or type information for repository objects
unpack-file Creates a temporary file with a blob's contents
diff-files Compares files in the working tree and the cache
diff-cache Compares content and mode of blobs between the cache and repository
diff-tree Compares the content and mode of blobs found via two tree objects
merge-base Finds as good a common ancestor as possible for a merge
merge-cache Runs a merge for files needing merging
apply Apply a patch against the current index cache/working directory
check-files Verify a list of files are up-to-date
write-tree Creates a tree from the current cache
commit-tree Creates a new commit object
mktag Creates a tag object
init-db Creates an empty git object database
fsck-cache Verifies the connectivity and validity of the objects in the database
convert-cache Converts old-style GIT repository
mkdelta Creates a delta object
tar-tree Creates a tar archive of the files in the named tree
get-tar-commit-id Show the commit ID embedded in a git-tar-tree file.
write-blob Creates a blob from a file
diff-helper Generates patch format output for git-diff-*
stripspace Strip space from stdin
--
Jason McMullan, Embedded Systems Engineer
412.481.5021 tel, 412.656.3519 cell, 208.694.9206 fax
jason@evillabs.net
^ permalink raw reply
* [PATCH] One Git To Rule Them All - Prep 1
From: Jason McMullan @ 2005-06-01 5:59 UTC (permalink / raw)
To: git
one-git prep patch 1/2
Add some missing documentation for git-* commands
Signed-off-by: Jason McMullan <jason.mcmullan@timesys.com>
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/git-apply.txt
@@ -0,0 +1,36 @@
+git-apply(1)
+============
+v0.1, May 2005
+
+NAME
+----
+git-apply - Apply a patch against the current index cache/working directory
+
+
+SYNOPSIS
+--------
+'git-apply' [--check] [--stat] [--show-file] <patch>
+
+DESCRIPTION
+-----------
+This applies patches on top of some (arbitrary) version of the SCM.
+
+NOTE! It does all its work in the index file, and only cares about
+the files in the working directory if you tell it to "merge" the
+patch apply.
+
+Even when merging it always takes the source from the index, and
+uses the working tree as a "branch" for a 3-way merge.
+
+Author
+------
+Written by Linus Torvalds <torvalds@osdl.org>
+
+Documentation
+--------------
+Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the link:git.html[git] suite
+
diff --git a/Documentation/git-get-tar-commit-id.txt b/Documentation/git-get-tar-commit-id.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/git-get-tar-commit-id.txt
@@ -0,0 +1,29 @@
+git-get-tar-commit-id(1)
+========================
+v0.1, May 2005
+
+NAME
+----
+git-get-tar-commit-id - Show the commit ID embedded in a git-tar-tree file.
+
+
+SYNOPSIS
+--------
+'git-get-tar-commit-id' <tar-file.tar>
+
+DESCRIPTION
+-----------
+This shows the commit ID embedded in a git-tar-tree generated file.
+
+Author
+------
+Written by Linus Torvalds <torvalds@osdl.org>
+
+Documentation
+--------------
+Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the link:git.html[git] suite
+
diff --git a/Documentation/git-stripspace.txt b/Documentation/git-stripspace.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/git-stripspace.txt
@@ -0,0 +1,31 @@
+git-stripspace(1)
+=================
+v0.1, May 2005
+
+NAME
+----
+git-stripspace - Strip space from stdin
+
+
+SYNOPSIS
+--------
+'git-stripspace' <stream
+
+DESCRIPTION
+-----------
+Remove empty lines from the beginning and end.
+
+Turn multiple consecutive empty lines into just one empty line.
+
+Author
+------
+Written by Linus Torvalds <torvalds@osdl.org>
+
+Documentation
+--------------
+Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the link:git.html[git] suite
+
^ permalink raw reply
* [PATCH] One Git To Rule Them All - Prep 2
From: Jason McMullan @ 2005-06-01 5:59 UTC (permalink / raw)
To: git
one-git prep patch 2/2
Make pull.c usable in one-git by making 'fetch' an overridable function pointer,
instead of an external function.
Signed-off-by: Jason McMullan <jason.mcmullan@timesys.com>
diff --git a/http-pull.c b/http-pull.c
--- a/http-pull.c
+++ b/http-pull.c
@@ -39,7 +39,7 @@ static size_t fwrite_sha1_file(void *ptr
return size;
}
-int fetch(unsigned char *sha1)
+static int my_fetch(unsigned char *sha1)
{
char *hex = sha1_to_hex(sha1);
char *filename = sha1_file_name(sha1);
@@ -98,6 +98,8 @@ int main(int argc, char **argv)
char *url;
int arg = 1;
+ fetch = my_fetch;
+
while (arg < argc && argv[arg][0] == '-') {
if (argv[arg][1] == 't') {
get_tree = 1;
diff --git a/local-pull.c b/local-pull.c
--- a/local-pull.c
+++ b/local-pull.c
@@ -11,7 +11,7 @@ static int use_filecopy = 1;
static char *path;
-int fetch(unsigned char *sha1)
+static int my_fetch(unsigned char *sha1)
{
static int object_name_start = -1;
static char filename[PATH_MAX];
@@ -87,6 +87,8 @@ int main(int argc, char **argv)
char *commit_id;
int arg = 1;
+ fetch = my_fetch;
+
while (arg < argc && argv[arg][0] == '-') {
if (argv[arg][1] == 't')
get_tree = 1;
diff --git a/pull.c b/pull.c
--- a/pull.c
+++ b/pull.c
@@ -14,6 +14,14 @@ static const char commitS[] = "commit";
static const char treeS[] = "tree";
static const char blobS[] = "blob";
+int null_fetch(unsigned char *sha1)
+{
+ fprintf(stderr,"fetch() routine not implemented.\n");
+ return -1;
+}
+
+int (*fetch)(unsigned char *sha1) = null_fetch;
+
void pull_say(const char *fmt, const char *hex) {
if (get_verbosely)
fprintf(stderr, fmt, hex);
diff --git a/pull.h b/pull.h
--- a/pull.h
+++ b/pull.h
@@ -2,7 +2,7 @@
#define PULL_H
/** To be provided by the particular implementation. **/
-extern int fetch(unsigned char *sha1);
+extern int (*fetch)(unsigned char *sha1);
/** Set to fetch the target tree. */
extern int get_tree;
diff --git a/rpull.c b/rpull.c
--- a/rpull.c
+++ b/rpull.c
@@ -6,7 +6,7 @@
static int fd_in;
static int fd_out;
-int fetch(unsigned char *sha1)
+static int my_fetch(unsigned char *sha1)
{
int ret;
write(fd_out, sha1, 20);
@@ -22,6 +22,8 @@ int main(int argc, char **argv)
char *url;
int arg = 1;
+ fetch = my_fetch;
+
while (arg < argc && argv[arg][0] == '-') {
if (argv[arg][1] == 't') {
get_tree = 1;
^ permalink raw reply
* [PATCH] One Git To Rule Them All - Final
From: Jason McMullan @ 2005-06-01 6:00 UTC (permalink / raw)
To: git
one-git
One git to rule them all...
This patch make a 'git' binary that has all of the git-* commands linked in,
instead of a zillion little git-* commands. As an interesting side effect,
documentation for each command is required in Documention/git-<mumble>.txt
for compilation to succeed. ;^)
The install still creates git-<mumble> commands in $HOME/bin, so there should
be no compatability issues.
This patch saves 2.4M on my Athlon 64 system - a 7x size reduction. Whee!
REQURIES one-git pre patches 1 and 2
Signed-off-by: Jason McMullan <jason.mcmullan@timesys.com>
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -24,19 +24,48 @@ SCRIPTS=git-apply-patch-script git-merge
git-pull-script git-tag-script git-resolve-script git-whatchanged \
git-deltafy-script git-fetch-script git-status-script git-commit-script
-PROG= git-update-cache git-diff-files git-init-db git-write-tree \
- git-read-tree git-commit-tree git-cat-file git-fsck-cache \
- git-checkout-cache git-diff-tree git-rev-tree git-ls-files \
- git-check-files git-ls-tree git-merge-base git-merge-cache \
- git-unpack-file git-export git-diff-cache git-convert-cache \
- git-http-pull git-rpush git-rpull git-rev-list git-mktag \
- git-diff-helper git-tar-tree git-local-pull git-write-blob \
- git-get-tar-commit-id git-mkdelta git-apply git-stripspace
-
-all: $(PROG)
-
-install: $(PROG) $(SCRIPTS)
- $(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
+# The following order determines 'git help' command order.
+# The general idea is 'pull, push, inspect, commit, db, misc'
+PROG= \
+ git-local-pull \
+ git-http-pull \
+ git-rpull \
+ git-rpush \
+ git-rev-tree \
+ git-rev-list \
+ git-export \
+ git-read-tree \
+ git-checkout-cache \
+ git-update-cache \
+ git-ls-tree \
+ git-ls-files \
+ git-cat-file \
+ git-unpack-file \
+ git-diff-files \
+ git-diff-cache \
+ git-diff-tree \
+ git-merge-base \
+ git-merge-cache \
+ git-apply \
+ git-check-files \
+ git-write-tree \
+ git-commit-tree \
+ git-mktag \
+ git-init-db \
+ git-fsck-cache \
+ git-convert-cache \
+ git-mkdelta \
+ git-tar-tree \
+ git-get-tar-commit-id \
+ git-write-blob \
+ git-diff-helper \
+ git-stripspace
+
+all: git $(PROG)
+
+install: git $(PROG) $(SCRIPTS)
+ $(INSTALL) git $(SCRIPTS) $(dest)$(bin)
+ for prog in $(PROG); do ln -sf git $(dest)$(bin)/$$prog; done
LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
tag.o delta.o date.o index.o diff-delta.o patch-delta.o
@@ -52,9 +81,16 @@ LIB_OBJS += diff.o diffcore-rename.o dif
LIB_OBJS += gitenv.o
+LIB_OBJS += pull.o
+
+LIB_OBJS += rsh.o
+
LIBS = $(LIB_FILE)
LIBS += -lz
+# For git-http-pull
+LIBS += -lcurl
+
ifdef MOZILLA_SHA1
SHA1_HEADER="mozilla-sha1/sha1.h"
LIB_OBJS += mozilla-sha1/sha1.o
@@ -79,42 +115,39 @@ test-date: test-date.c date.o
test-delta: test-delta.c diff-delta.o patch-delta.o
$(CC) $(CFLAGS) -o $@ $^
-git-%: %.c $(LIB_FILE)
- $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
+git-%.o: %.c #Makefile
+ $(CC) $(CFLAGS) -c -o $@ $*.c -Dmain=git_$(subst -,_,$*) -Ddesc=git_$(subst -,_,$*)_desc
+
+$(PROG):
+ ln -s git $@
+
+git.o: git-commands.h
-git-update-cache: update-cache.c
-git-diff-files: diff-files.c
-git-init-db: init-db.c
-git-write-tree: write-tree.c
-git-read-tree: read-tree.c
-git-commit-tree: commit-tree.c
-git-cat-file: cat-file.c
-git-fsck-cache: fsck-cache.c
-git-checkout-cache: checkout-cache.c
-git-diff-tree: diff-tree.c
-git-rev-tree: rev-tree.c
-git-ls-files: ls-files.c
-git-check-files: check-files.c
-git-ls-tree: ls-tree.c
-git-merge-base: merge-base.c
-git-merge-cache: merge-cache.c
-git-unpack-file: unpack-file.c
-git-export: export.c
-git-diff-cache: diff-cache.c
-git-convert-cache: convert-cache.c
-git-http-pull: http-pull.c pull.c
-git-local-pull: local-pull.c pull.c
-git-rpush: rsh.c
-git-rpull: rsh.c pull.c
-git-rev-list: rev-list.c
-git-mktag: mktag.c
-git-diff-helper: diff-helper.c
-git-tar-tree: tar-tree.c
-git-write-blob: write-blob.c
-git-mkdelta: mkdelta.c
-git-stripspace: stripspace.c
+git: git.o $(patsubst %,%.o,$(PROG)) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+
+git-commands.h: Makefile $(patsubst %,Documentation/%.txt,$(PROG))
+ echo -n >git-commands.h
+ for prog in $(subst -,_,$(PROG)); do \
+ echo "extern int $${prog}(int argc, char **argv);" >>git-commands.h ; \
+ echo "extern const char *$${prog}_desc;" >>git-commands.h ; \
+ done
+ echo "struct git_command { ">>git-commands.h
+ echo " const char *command;" >>git-commands.h
+ echo " int (*main)(int argc,char **argv);" >>git-commands.h
+ echo " const char *desc; } commands[]={" >>git-commands.h
+ for cmd in $(patsubst git-%,%,$(PROG)); do \
+ prog=`echo $$cmd | sed -e 's/-/_/g'` ; \
+ desc=`grep "^git-$$cmd - " Documentation/git-$$cmd.txt | cut -d' ' -f3-` ; \
+ desc=`echo "$$desc" | sed -e 's/"/\\\\"/g'` ; \
+ echo -n " { " >>git-commands.h ; \
+ echo -n ".command = \"$${cmd}\", " >>git-commands.h ; \
+ echo -n ".main = git_$${prog}, " >>git-commands.h ; \
+ echo -n ".desc = \"$$desc\", " >>git-commands.h ; \
+ echo "}," >>git-commands.h ; \
+ done
+ echo "};" >>git-commands.h
-git-http-pull: LIBS += -lcurl
# Library objects..
blob.o: $(LIB_H)
@@ -138,7 +171,7 @@ test: all
$(MAKE) -C t/ all
clean:
- rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
+ rm -f *.o mozilla-sha1/*.o ppc/*.o git $(PROG) $(LIB_FILE)
$(MAKE) -C Documentation/ clean
backup: clean
diff --git a/git.c b/git.c
new file mode 100644
--- /dev/null
+++ b/git.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "git-commands.h"
+
+#define COMMAND_LEN (sizeof(commands)/sizeof(commands[0]))
+
+typedef int (*func)(int argc, char **argv);
+
+func lookup_basename(const char *program)
+{
+ const char *cp;
+ int i;
+
+ cp=strrchr(program,'/');
+ if (cp==NULL)
+ cp=program;
+ else
+ cp++;
+
+ if (strncmp(cp,"git-",4)==0)
+ cp+=4;
+
+ for (i = 0; i < COMMAND_LEN; i++)
+ if (!strcmp(cp,commands[i].command))
+ return commands[i].main;
+
+ return NULL;
+}
+
+int main(int argc, char **argv)
+{
+ int (*do_main)(int argc, char **argv);
+ int i;
+
+ do_main = lookup_basename(argv[0]);
+
+ if (!do_main && argc > 1 ) {
+ do_main = lookup_basename(argv[1]);
+ if (do_main) {
+ argc--;
+ argv++;
+ }
+ }
+
+ if (do_main) {
+ return do_main(argc, argv);
+ }
+
+ fprintf(stderr,"GIT Commands:\n\n");
+ for (i = 0; i < COMMAND_LEN; i++)
+ fprintf(stderr,"\t%-24s%s\n",commands[i].command,commands[i].desc);
+ fprintf(stderr,"\n");
+
+ return 1;
+}
^ permalink raw reply
* Re: [PATCH] One Git To Rule Them All
From: Junio C Hamano @ 2005-06-01 6:21 UTC (permalink / raw)
To: Jason McMullan; +Cc: git
In-Reply-To: <20050601055833.GA14231@port.evillabs.net>
In my opinion, this is going backwards.
I think we had this discussion long time ago on the list, and
instead of using cvs/svn style of "cmd subcmd" syntax, the
consensus back then was that using "cmd-" prefix without spaces
is easier for making TAB completion to work (you do not have to
muck with command specific rules in the readline configuration),
and this is especially helpful for people who ends up using the
bare Plumbing. IIUC, the same reason is behind cg-* command set.
Having said that, for many people who do not wish to use the
bare Plumbing interactively, installing git-* commands in, say,
$(libexec)/git/ might be a more appropriate option. But we have
to remember there are people who uses the bare Plumbing
interatively. I think Jeff Garzik said he does not use Cogito,
and I suspect Linus does not either.
^ permalink raw reply
* Re: I want to release a "git-1.0"
From: Junio C Hamano @ 2005-06-01 6:28 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0505312002160.1876@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> Anyway, I wrote just a _very_ introductory thing in
LT> Documentation/tutorial.txt, I'll try to update and expand on it later. It
LT> basically has a really stupid example of "how to set up a new project".
Linus,
I was following your "tutorial" and saw the last step
(git-whatchanged) showing the HEAD commit and diff _twice_.
You got me _WORRIED_!!!
I knew it uses your faviorite diff-tree command and I was the
most likely suspect who broke it. And I remember you were
understandably unhappy last time I broke it (the "diff-tree -s"
problem).
It turns out that the example in the tutorial was bad. Here is
a fix. It is so obvious that I do not think it deserves a
sign-off nor credit. Please just fold it into your edit next
time you update the tutorial.
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
jit-diff : Documentation
# - linus: git-apply --stat: limit lines to 79 characters
# + (working tree)
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -401,7 +401,7 @@ activity.
To see the whole history of our pitiful little git-tutorial project, we
can do
- git-whatchanged -p --root HEAD
+ git-whatchanged -p --root
(the "--root" flag is a flag to git-diff-tree to tell it to show the
initial aka "root" commit as a diff too), and you will see exactly what
Compilation finished at Tue May 31 23:12:32
^ permalink raw reply
* Re: [PATCH] One Git To Rule Them All
From: Sebastian Kuzminsky @ 2005-06-01 6:35 UTC (permalink / raw)
To: git
In-Reply-To: <7vis0yr41f.fsf@assigned-by-dhcp.cox.net>
Calling it 'git' would conflict with the git binary from GNU Interactive
Tools. That other git seems to not be maintained, the last release was
on 2000-03-12. But still...
I think it should have been called 'lit' from the start, for Linus'
Information Tracker.
--
Sebastian Kuzminsky
^ permalink raw reply
* Re: I want to release a "git-1.0"
From: Junio C Hamano @ 2005-06-01 6:52 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Linus Torvalds, Git Mailing List
In-Reply-To: <Pine.LNX.4.62.0505301644430.5330@localhost.localdomain>
I just remembered that I mentioned potential problems with non
rsync pulls with delta objects, especially when the git-*-pull
commands are used in "things only close to the tip" mode,
i.e. without "-a" option. Do you think we should do something
about it before GIT 1.0 happens?
It may be enough if we just tell people not to deltify their
public non-rsync repositories in the documentation.
^ permalink raw reply
* Re: [SCRIPT] cg-rpush & locking
From: Thomas Glanzmann @ 2005-06-01 6:51 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Tony Lindgren, git, Matthias Urlichs
In-Reply-To: <Pine.LNX.4.63.0505311914550.6500@localhost.localdomain>
Hello,
> Why do you need a lock at all?
> Just update your HEAD reference last when you push and get it first when
> you pull.
consider the following scenario: Two people push at the same time. One
HEAD gets actually written, but both think that their changes got
upstream. Of course the 'upstream' tree is consitent, but incomplete.
That is why we need a lock. And the lock should be obtained before the
remote HEAD is retrieved, I think the following scenario is how to
handle it:
1. acquire remote lock
2. get remote HEAD
3. if remote HEAD is ahead (not included in our history) abort
and free lock.
4. push objects
5. update remote HEAD with local
6. free remote lock.
Thomas
^ permalink raw reply
* [PATCH] Add -d flag to git-pull-* family.
From: Junio C Hamano @ 2005-06-01 8:24 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Linus Torvalds, Git Mailing List
In-Reply-To: <7vacmapo18.fsf@assigned-by-dhcp.cox.net>
When a remote repository is deltified, we need to get the
objects that a deltified object we want to obtain is based upon.
Since checking representation type of all objects we retreive
from remote side may be costly, this is made into a separate
option -d; -a implies it for convenience and safety.
Rsync transport does not have this problem since it fetches
everything the remote side has.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
Documentation/git-http-pull.txt | 4 +++-
Documentation/git-local-pull.txt | 4 +++-
Documentation/git-rpull.txt | 4 +++-
http-pull.c | 5 ++++-
local-pull.c | 5 ++++-
pull.c | 15 +++++++++++++++
pull.h | 3 +++
rpull.c | 5 ++++-
8 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-http-pull.txt b/Documentation/git-http-pull.txt
--- a/Documentation/git-http-pull.txt
+++ b/Documentation/git-http-pull.txt
@@ -9,7 +9,7 @@ git-http-pull - Downloads a remote GIT r
SYNOPSIS
--------
-'git-http-pull' [-c] [-t] [-a] [-v] commit-id url
+'git-http-pull' [-c] [-t] [-a] [-v] [-d] commit-id url
DESCRIPTION
-----------
@@ -17,6 +17,8 @@ Downloads a remote GIT repository via HT
-c::
Get the commit objects.
+-d::
+ Get objects that deltified objects are based upon.
-t::
Get trees associated with the commit objects.
-a::
diff --git a/Documentation/git-local-pull.txt b/Documentation/git-local-pull.txt
--- a/Documentation/git-local-pull.txt
+++ b/Documentation/git-local-pull.txt
@@ -9,7 +9,7 @@ git-local-pull - Duplicates another GIT
SYNOPSIS
--------
-'git-local-pull' [-c] [-t] [-a] [-l] [-s] [-n] [-v] commit-id path
+'git-local-pull' [-c] [-t] [-a] [-l] [-s] [-n] [-v] [-d] commit-id path
DESCRIPTION
-----------
@@ -19,6 +19,8 @@ OPTIONS
-------
-c::
Get the commit objects.
+-d::
+ Get objects that deltified objects are based upon.
-t::
Get trees associated with the commit objects.
-a::
diff --git a/Documentation/git-rpull.txt b/Documentation/git-rpull.txt
--- a/Documentation/git-rpull.txt
+++ b/Documentation/git-rpull.txt
@@ -10,7 +10,7 @@ git-rpull - Pulls from a remote reposito
SYNOPSIS
--------
-'git-rpull' [-c] [-t] [-a] [-v] commit-id url
+'git-rpull' [-c] [-t] [-a] [-v] [-d] commit-id url
DESCRIPTION
-----------
@@ -21,6 +21,8 @@ OPTIONS
-------
-c::
Get the commit objects.
+-d::
+ Get objects that deltified objects are based upon.
-t::
Get trees associated with the commit objects.
-a::
diff --git a/http-pull.c b/http-pull.c
--- a/http-pull.c
+++ b/http-pull.c
@@ -103,17 +103,20 @@ int main(int argc, char **argv)
get_tree = 1;
} else if (argv[arg][1] == 'c') {
get_history = 1;
+ } else if (argv[arg][1] == 'd') {
+ get_delta = 1;
} else if (argv[arg][1] == 'a') {
get_all = 1;
get_tree = 1;
get_history = 1;
+ get_delta = 1;
} else if (argv[arg][1] == 'v') {
get_verbosely = 1;
}
arg++;
}
if (argc < arg + 2) {
- usage("git-http-pull [-c] [-t] [-a] [-v] commit-id url");
+ usage("git-http-pull [-c] [-t] [-a] [-d] [-v] commit-id url");
return 1;
}
commit_id = argv[arg];
diff --git a/local-pull.c b/local-pull.c
--- a/local-pull.c
+++ b/local-pull.c
@@ -74,7 +74,7 @@ int fetch(unsigned char *sha1)
}
static const char *local_pull_usage =
-"git-local-pull [-c] [-t] [-a] [-l] [-s] [-n] [-v] commit-id path";
+"git-local-pull [-c] [-t] [-a] [-l] [-s] [-n] [-v] [-d] commit-id path";
/*
* By default we only use file copy.
@@ -92,10 +92,13 @@ int main(int argc, char **argv)
get_tree = 1;
else if (argv[arg][1] == 'c')
get_history = 1;
+ else if (argv[arg][1] == 'd')
+ get_delta = 1;
else if (argv[arg][1] == 'a') {
get_all = 1;
get_tree = 1;
get_history = 1;
+ get_delta = 1;
}
else if (argv[arg][1] == 'l')
use_link = 1;
diff --git a/pull.c b/pull.c
--- a/pull.c
+++ b/pull.c
@@ -6,6 +6,7 @@
int get_tree = 0;
int get_history = 0;
+int get_delta = 0;
int get_all = 0;
int get_verbosely = 0;
static unsigned char current_commit_sha1[20];
@@ -37,6 +38,20 @@ static int make_sure_we_have_it(const ch
status = fetch(sha1);
if (status && what)
report_missing(what, sha1);
+ if (get_delta) {
+ unsigned long mapsize, size;
+ void *map, *buf;
+ char type[20];
+
+ map = map_sha1_file(sha1, &mapsize);
+ if (map) {
+ buf = unpack_sha1_file(map, mapsize, type, &size);
+ munmap(map, mapsize);
+ if (buf && !strcmp(type, "delta"))
+ status = make_sure_we_have_it(what, buf);
+ free(buf);
+ }
+ }
return status;
}
diff --git a/pull.h b/pull.h
--- a/pull.h
+++ b/pull.h
@@ -13,6 +13,9 @@ extern int get_history;
/** Set to fetch the trees in the commit history. **/
extern int get_all;
+/* Set to fetch the base of delta objects.*/
+extern int get_delta;
+
/* Set to be verbose */
extern int get_verbosely;
diff --git a/rpull.c b/rpull.c
--- a/rpull.c
+++ b/rpull.c
@@ -27,17 +27,20 @@ int main(int argc, char **argv)
get_tree = 1;
} else if (argv[arg][1] == 'c') {
get_history = 1;
+ } else if (argv[arg][1] == 'd') {
+ get_delta = 1;
} else if (argv[arg][1] == 'a') {
get_all = 1;
get_tree = 1;
get_history = 1;
+ get_delta = 1;
} else if (argv[arg][1] == 'v') {
get_verbosely = 1;
}
arg++;
}
if (argc < arg + 2) {
- usage("git-rpull [-c] [-t] [-a] [-v] commit-id url");
+ usage("git-rpull [-c] [-t] [-a] [-v] [-d] commit-id url");
return 1;
}
commit_id = argv[arg];
------------------------------------------------
^ permalink raw reply
* gitk-1.1 out
From: Paul Mackerras @ 2005-06-01 10:09 UTC (permalink / raw)
To: git
The latest version of gitk is at:
http://ozlabs.org/~paulus/gitk/gitk-1.1.tar.gz
(yes, a real tarball this time, with a README even. :)
New features in this version include:
* Commits that are pointed to by a tag in .git/refs/tags are now
marked with a little yellow "luggage label" shape attached to the
circle representing the commit. The tag name is written on the
label.
* Gitk now uses git-rev-list instead of git-rev-tree. This means it
should be faster when looking at just a small range of commits.
Instead of using "gitk HEAD ^ORIG_HEAD" though, you need to use
"gitk HEAD ORIG_HEAD"; the arguments are passed to git-rev-list,
which takes slightly different arguments from git-rev-tree.
Unfortunately gitk still needs to see the whole git-rev-list output
before it can start to draw the graph; I plan to address this.
* You can now type a tag name or a SHA1 id in the SHA1 field, and
press return or the "Goto" button to jump to that commit.
Paul.
^ permalink raw reply
* [COGITO PATCH] fetch_local -d behaves different from other fetch_*
From: Santi Béjar @ 2005-06-01 10:55 UTC (permalink / raw)
To: Git Mailing List
In-Reply-To: <87is0zginw.fsf@ifae.es>
"fetch_local -d src dst" does not respect the dst directory name
if both have different names. So
fetch_local -d /path/to/some/src /path/to/dst
copies to /path/to/src.
In fact this way it's never used in the current cogito so it's not
really affected but it's needed in the case where the heads and tags
are in directories.
Signed-off-by: "Santi Béjar" <sbejar@gmail.com>
cg-pull | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cg-pull b/cg-pull
--- a/cg-pull
+++ b/cg-pull
@@ -223,15 +223,15 @@ fetch_local () {
shift
fi
- cut_last=
+ dirs=
if [ "$1" = "-d" ]; then
- cut_last=1
+ dirs=1
shift
fi
src="$1"
dest="$2"
- [ "$cut_last" ] && dest=${dest%/*}
+ [ "$dirs" ] && src="${src%/}/."
cp $cp_flags_l "$src" "$dest"
}
^ permalink raw reply
* qgit-0.3
From: Marco Costalba @ 2005-06-01 11:19 UTC (permalink / raw)
To: git; +Cc: berkus
New version of qgit, the QT/C++ git viewer.
Download at:
http://prdownloads.sourceforge.net/qgit/qgit-0.3.tar.gz?download
This time we use scons instead of qmake as build system (many thanks to Stanislav Karchebny), I
hope people have less problems compiling it.
As before just run make and copy the bin in the path.
New feature is async loading of diff and file blobs, should be much faster navigate the logs with
secondary windows (double click on logs or file names to show) opened.
Have fun
Marco
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
^ permalink raw reply
* Re: gitk-1.1 out
From: Ingo Molnar @ 2005-06-01 11:19 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
In-Reply-To: <17053.35147.52729.794561@cargo.ozlabs.ibm.com>
* Paul Mackerras <paulus@samba.org> wrote:
> The latest version of gitk is at:
>
> http://ozlabs.org/~paulus/gitk/gitk-1.1.tar.gz
works very well for me, and all the bugs of the previous version that i
could trigger are fixed now.
Ingo
^ permalink raw reply
* [PATCH] Make cvs2git create tags
From: Sven Verdoolaege @ 2005-06-01 11:27 UTC (permalink / raw)
To: git
The current version of cvs2git doesn't propagate tags.
Trivial patch below.
skimo
--
cvs2git: create tags
cvsps seems to put a space after the tag name, so we remove it first.
---
commit 713a66bd98e65237cff37e0dfa68573973a60468
tree 07c5104ebeb6f189dc11eee3263966735307cfac
parent 324a7234776aafdc594942f1e5ef8e0f6358c0a5
author Sven Verdoolaege <skimo@liacs.nl> Wed, 01 Jun 2005 13:15:06 +0200
committer Sven Verdoolaege <skimo@liacs.nl> Wed, 01 Jun 2005 13:15:06 +0200
cvs2git.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cvs2git.c b/cvs2git.c
--- a/cvs2git.c
+++ b/cvs2git.c
@@ -115,6 +115,7 @@ static void commit(void)
{
const char *cmit_parent = initial_commit ? "" : "-p HEAD";
const char *dst_branch;
+ char *space;
int i;
printf("tree=$(git-write-tree)\n");
@@ -147,6 +148,12 @@ static void commit(void)
printf("echo $commit > .git/refs/heads/'%s'\n", dst_branch);
+ space = strchr(tag, ' ');
+ if (space)
+ *space = 0;
+ if (strcmp(tag, "(none)"))
+ printf("echo $commit > .git/refs/tags/'%s'\n", tag);
+
printf("echo 'Committed (to %s):' ; cat .cmitmsg; echo\n", dst_branch);
*date = 0;
^ permalink raw reply
* Re: [PATCH] One Git To Rule Them All
From: McMullan, Jason @ 2005-06-01 12:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vis0yr41f.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
On Tue, 2005-05-31 at 23:21 -0700, Junio C Hamano wrote:
> I think we had this discussion long time ago on the list, and
> instead of using cvs/svn style of "cmd subcmd" syntax, the
> consensus back then was that using "cmd-" prefix without spaces
> is easier for making TAB completion to work (you do not have to
> muck with command specific rules in the readline configuration),
> and this is especially helpful for people who ends up using the
> bare Plumbing. IIUC, the same reason is behind cg-* command set.
But all the git-<mumble> commands are still there, as symlinks to
git. ie 'git-update-cache' and 'git update-cache' both work.
git-<TAB> still works.
Am I missing something here?
--
Jason McMullan <jason.mcmullan@timesys.com>
TimeSys Corporation
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ 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