git.git
19 years agoRename the RPM from "git" to "git-core"
Linus Torvalds [Tue, 12 Jul 2005 17:07:18 +0000 (10:07 -0700)]
Rename the RPM from "git" to "git-core"

That way we avoid any confusion with "GNU Interactive Tools", and it's
more descriptive anyway (the rpm documentation talks about how git is
split into a "core" part and an "SCM" part, this makes it clear that
this is the core one).

19 years agoAdd "git branch" script
Linus Torvalds [Tue, 12 Jul 2005 04:30:23 +0000 (21:30 -0700)]
Add "git branch" script

You can use it as

git branch <branchname> [start-point]

and it creates a new branch of name <branchname>.  If a starting point
is specified, that will be where the branch is created, otherwise it
will be created at the current HEAD.

The sequence

git branch xyz abc
git checkout xyz

can also be written as

git checkout -b xyz abc

as per the previous commit.

19 years agoMake "git checkout" create new branches on demand
Linus Torvalds [Tue, 12 Jul 2005 03:44:20 +0000 (20:44 -0700)]
Make "git checkout" create new branches on demand

In particular, if we check out something that isn't an old branch, it
now requires a new branch-name to check the thing out into.

So, for example:

git checkout -b my-branch v2.6.12

will create the new branch "my-branch", and start it at v2.6.12, while

git checkout master

will just switch back to the master branch.

Of course, if you want to create a new branch "my-branch" and _not_
check it out, you could have done so with just

git-rev-parse v2.6.12^0 > .git/refs/heads/my-branch

which I think I will codify as "git branch".

19 years agoMake "git checkout" verify that the argument refers to a commit
Linus Torvalds [Tue, 12 Jul 2005 01:32:30 +0000 (18:32 -0700)]
Make "git checkout" verify that the argument refers to a commit

We still need to create a new branch if it didn't refer to an existing
branch, otherwise our HEAD will continue to point to something totally
different than what we just checked out.

I'll need to think about it.  Maybe only do it with "-f" and force it to
the "master" branch?

19 years agogit-rev-parse: Allow a "zeroth" parent of a commit - the commit itself.
Linus Torvalds [Tue, 12 Jul 2005 01:27:25 +0000 (18:27 -0700)]
git-rev-parse: Allow a "zeroth" parent of a commit - the commit itself.

This sounds nonsensical, but it's useful to make sure that the result is
a commit.

For example, "git-rev-parse v2.6.12" will return the _tag_ object for
v2.6.12, but "git-rev-parse v2.6.12^0" will return the _commit_ object
associated with that tag (and v2.6.12^1 will return the first parent).

Also, since the "parent" code will actually parse the commit, this,
together with the "--verify" flag, will verify not only that the result
is a single SHA1, but will also have verified that it's a proper commit
that we can see.

19 years agogit-send-pack: Fix duplicate refname match
Linus Torvalds [Tue, 12 Jul 2005 01:03:34 +0000 (18:03 -0700)]
git-send-pack: Fix duplicate refname match

Cut-and-paste dup noticed by Junio.  It's not even harmless, since a
match also causes that match to be invalidated, so this made it
impossible to update an existing branch by name.

I'd only tested the case of "ref doesn't exist at all on the other end",
which worked fine.

19 years ago[PATCH] Bootstrap "make dist"
Chris Wright [Mon, 11 Jul 2005 21:03:09 +0000 (14:03 -0700)]
[PATCH] Bootstrap "make dist"

Use git-tar-tree directly from git source during make dist.  This
handles bootstrap issue with git not being installed.

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-clone-script local optimization tweaks
Junio C Hamano [Mon, 11 Jul 2005 20:30:54 +0000 (13:30 -0700)]
[PATCH] git-clone-script local optimization tweaks

 - When local optimization is used, the variable repo has
   already been passed through get_repo_base so there is no need
   to check for .git subdirectory in there.

 - Use cpio -l instead of "cp -l".

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-cvsimport-script: add "import only" option
Sven Verdoolaege [Mon, 11 Jul 2005 14:57:49 +0000 (16:57 +0200)]
[PATCH] git-cvsimport-script: add "import only" option

git-cvsimport-script: add "import only" option which tells the script
not to perform a checkout after importing.

This ensures that the working directory and cache remain untouched and
will not create them if they do not exist.

Acked-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] add --missing-ok option to write-tree
Bryan Larsen [Mon, 11 Jul 2005 03:53:44 +0000 (20:53 -0700)]
[PATCH] add --missing-ok option to write-tree

This option allows a write-tree even if the referenced objects are not
in the database.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Check packs and then files.
Junio C Hamano [Mon, 11 Jul 2005 07:00:55 +0000 (00:00 -0700)]
[PATCH] Check packs and then files.

This reverses the order of object lookup, to check pack index first and
then go to the filesystem to find .git/objects/??/ hierarchy.

When most of the objects are packed, this saves quite many stat() calls
and negative dcache entries; while the price this approach has to pay is
negligible, even when most of the objects are outside pack, because
checking pack index file is quite cheap.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Dereference tag repeatedly until we get a non-tag.
Junio C Hamano [Mon, 11 Jul 2005 06:55:56 +0000 (23:55 -0700)]
[PATCH] Dereference tag repeatedly until we get a non-tag.

When we allow a tag object in place of a commit object, we only
dereferenced the given tag once, which causes a tag that points at a tag
that points at a commit to be rejected.  Instead, dereference tag
repeatedly until we get a non-tag.

This patch makes change to two functions:

 - commit.c::lookup_commit_reference() is used by merge-base,
   rev-tree and rev-parse to convert user supplied SHA1 to that of
   a commit.
 - rev-list uses its own get_commit_reference() to do the same.

Dereferencing tags this way helps both of these uses.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] alternate object store and fsck v0.99
Junio C Hamano [Sun, 10 Jul 2005 22:40:43 +0000 (15:40 -0700)]
[PATCH] alternate object store and fsck

The location alt_odb[j].name[0..] is filled with ??/?{38} to form a sha1
filename to try, but I was too lazy to allocate a copy, so while
fsck_object_dir() is running for the directory, the filenames ??/?{38}
are filled after NUL (usually and always the location should have '/'),
making them "not found".

This should fix it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoFix up progress report for off-by-one error
Linus Torvalds [Sun, 10 Jul 2005 23:14:22 +0000 (16:14 -0700)]
Fix up progress report for off-by-one error

We used to print the index of the object we unpacked, not how many we
had unpacked.  Which caused slightly confusing progress reports like

100% (2/3) done

rather than the more obvious "3/3" for 100% ;)

19 years agoMake "git log" exit properly if not in a git archive
Linus Torvalds [Sun, 10 Jul 2005 23:10:21 +0000 (16:10 -0700)]
Make "git log" exit properly if not in a git archive

Instead of getting an incomprehensible error message from git-rev-list.

19 years agoAvoid signedness warnings in sha1_file.c
Linus Torvalds [Sun, 10 Jul 2005 22:43:54 +0000 (15:43 -0700)]
Avoid signedness warnings in sha1_file.c

Very irritating.  But "snprintf()" wants "char *", and zlib wants
"unsigned char *".

19 years ago[PATCH] Remove map_sha1_file
Daniel Barkalow [Sun, 10 Jul 2005 22:27:02 +0000 (18:27 -0400)]
[PATCH] Remove map_sha1_file

Remove map_sha1_file(), now unused.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] write_sha1_to_fd()
Daniel Barkalow [Sun, 10 Jul 2005 22:25:38 +0000 (18:25 -0400)]
[PATCH] write_sha1_to_fd()

Add write_sha1_to_fd(), which writes an object to a file descriptor. This
includes support for unpacking it and recompressing it.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-rev-list: allow missing objects when the parent is marked UNINTERESTING
Linus Torvalds [Sun, 10 Jul 2005 22:09:46 +0000 (15:09 -0700)]
git-rev-list: allow missing objects when the parent is marked UNINTERESTING

We still want the "top-most" uninteresting object to exist, so that we
know that we have reached it.

19 years agoAdd "-q" flag to "git commit"
Linus Torvalds [Sat, 9 Jul 2005 17:52:35 +0000 (10:52 -0700)]
Add "-q" flag to "git commit"

Maybe you don't want the progress report.

19 years agogit-unpack-objects: show progress report by default
Linus Torvalds [Sat, 9 Jul 2005 17:43:02 +0000 (10:43 -0700)]
git-unpack-objects: show progress report by default

This ends up being very calming for big "git clone"s, since otherwise
you just get very frustrated with a long silence, wondering whether it's
working at all.

Use "-q" to quiet it down.

Now if we could just do the same for the initial "figure out what to
pack" phase, which can also be quite slow if the other end is busy (or
not packed and not in cache)...

19 years ago[PATCH] format-patch: fix skipping of blank-lines
Junio C Hamano [Sat, 9 Jul 2005 02:27:15 +0000 (19:27 -0700)]
[PATCH] format-patch: fix skipping of blank-lines

If it is fed a commit with more than one leading blank lines,
the sed scripts git-format-patch-script used looped forever.
Using git-stripspace upfront makes the sed script somewhat
simpler to work around this problem.

Also use git-rev-parse so that we can say

    $ git-format-patch-script HEAD^^^^

to prepare the latest four patches for e-mail submission.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoUpdate the tutorial a bit
Linus Torvalds [Sat, 9 Jul 2005 01:26:19 +0000 (18:26 -0700)]
Update the tutorial a bit

Add notes on branches, merging, tagging, and update some of the usage to
the friendlier "git cmd" syntax.

It's still ridiculously lacking, but perhaps it's a _bit_ more useful.

19 years agoMake "git tag" more user-friendly
Linus Torvalds [Sat, 9 Jul 2005 01:23:06 +0000 (18:23 -0700)]
Make "git tag" more user-friendly

Instead of having to cut-and-paste the result, write it to the tag
directory directly.  Also, start an editor for the tag message, rather
than just reading it from stdin.

19 years agoMake "git resolve" take the merge message in $3
Linus Torvalds [Sat, 9 Jul 2005 00:38:44 +0000 (17:38 -0700)]
Make "git resolve" take the merge message in $3

It used to do "Merge $3" as the message, but that ends up being
inconvenient, and much more easily done inside git-pull-script instead.

This makes the third argument to "git resolve" much easier to explain.

19 years ago[PATCH] Use SHA1 for git-update-cache --refresh
Bryan Larsen [Fri, 8 Jul 2005 23:52:28 +0000 (16:52 -0700)]
[PATCH] Use SHA1 for git-update-cache --refresh

Change git-update-cache --refresh behaviour to use sha1's rather than
comparing byte by byte.

[JC demangled whitespace from the posted patch himself because he
 liked it so much.  Also adjusted to the index_fd() interface
 slightly done differently from the original one.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add --info-only option to git-update-cache.
Bryan Larsen [Fri, 8 Jul 2005 23:52:12 +0000 (16:52 -0700)]
[PATCH] Add --info-only option to git-update-cache.

Add --info-only option to git-update-cache.

[JC demangled whitespace from the posted patch himself because he
 liked it so much.  Also adjusted to the index_fd() interface
 slightly done differently from the original one.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Expose object ID computation functions.
Bryan Larsen [Fri, 8 Jul 2005 23:51:55 +0000 (16:51 -0700)]
[PATCH] Expose object ID computation functions.

This patch makes the first half of write_sha1_file() and
index_fd() externally visible, to allow callers to compute the
object ID without actually storing it in the object database.

[JC demangled the whitespaces himself because he liked the patch
 so much, and reworked the interface to index_fd() slightly,
 taking suggestion from Linus and of his own.]

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoTeach "git clone" about rsync sources
Linus Torvalds [Sat, 9 Jul 2005 00:07:12 +0000 (17:07 -0700)]
Teach "git clone" about rsync sources

That will be the normal way of cloning anonymously for a while, so let's
make sure it's easy to use.

19 years agoMake "upload-pack" match git-fetch-pack usage
Linus Torvalds [Fri, 8 Jul 2005 23:22:22 +0000 (16:22 -0700)]
Make "upload-pack" match git-fetch-pack usage

Do the default "try xyz.git xyz fails" thing for the directory we get
passed in.

19 years agoAdd "mkpath()" helper function
Linus Torvalds [Fri, 8 Jul 2005 23:20:59 +0000 (16:20 -0700)]
Add "mkpath()" helper function

I'm bored with doing it by hand all the time.

19 years agoMark git-relink-script and git-repack-script executable
Linus Torvalds [Fri, 8 Jul 2005 22:59:29 +0000 (15:59 -0700)]
Mark git-relink-script and git-repack-script executable

Sure, "install" will default to installing it executable anyway, but
this is the right thing to do.

19 years agoMake "git clone" a lot more user-friendly
Linus Torvalds [Fri, 8 Jul 2005 22:46:33 +0000 (15:46 -0700)]
Make "git clone" a lot more user-friendly

This silently adds the ".git" directory component if needed, so you
don't need to state it explicitly for the source.  Also, it turns the
source into an absolute pathname when local, so that you can use
relative pathnames without losing sight of the source when we cd into
the destination.

19 years agoAdd "git-push-script" to make a more regular interface
Linus Torvalds [Fri, 8 Jul 2005 21:24:25 +0000 (14:24 -0700)]
Add "git-push-script" to make a more regular interface

It only does local and ssh pushes, because it's really just a wrapper
for git-send-pack.  We might make it do an rsync mirror or something, of
course.

19 years agoTeach 'git-send-pack' to send new branches and tags.
Linus Torvalds [Fri, 8 Jul 2005 20:58:40 +0000 (13:58 -0700)]
Teach 'git-send-pack' to send new branches and tags.

The protocol always supported it, but send-pack didn't actually know how
to tell the other side about a new branch/tag.

NOTE! You'll have to name it explicitly on the command line: if you
don't name any branches, git-send-pack will default to the branches that
already exist.

19 years agoMake "for_each_ref()" always use the "canonical" refname.
Linus Torvalds [Fri, 8 Jul 2005 20:56:05 +0000 (13:56 -0700)]
Make "for_each_ref()" always use the "canonical" refname.

It always uses a git-relative pathname, ie "refs/heads/master" instead of
".git/refs/heads/master" or whatever your GIT_DIR might be.

This way when we send refs back-and-forth between repositories, there's
never any question about GIT_DIR on either side.

19 years ago[PATCH] Use sq_quote() to properly quote the parameter to call shell.
Junio C Hamano [Fri, 8 Jul 2005 07:02:52 +0000 (00:02 -0700)]
[PATCH] Use sq_quote() to properly quote the parameter to call shell.

This tries to be more lenient to the users and stricter to the
attackers by quoting the input properly for shell safety,
instead of forbidding certain characters from the input.

Things to note:

 - We do not quote "prog" parameter (which comes from --exec).
   The user should know what he is doing.  --exec='echo foo'
   will supply the first two parameters to the resulting
   command, while --exec="'echo foo'" will give the first
   parameter, a single string with a space inside.

 - We do not care too much about leaking the sq_quote() output
   just before running exec().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Make sq_expand() available as sq_quote().
Junio C Hamano [Fri, 8 Jul 2005 06:58:32 +0000 (23:58 -0700)]
[PATCH] Make sq_expand() available as sq_quote().

A useful shell safety helper sq_expand() was hidden as a static
function in diff.c.  Extract it out and make it available as
sq_quote().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "git-sh-setup-script" for common git shell script setup
Linus Torvalds [Fri, 8 Jul 2005 17:57:21 +0000 (10:57 -0700)]
Add "git-sh-setup-script" for common git shell script setup

It sets up the normal git environment variables and a few helper
functions (currently just "die()"), and returns ok if it all looks like
a git archive.  So use it something like

. git-sh-setup-script || die "Not a git archive"

to make the rest of the git scripts more careful and readable.

19 years agogit-diff-*: support "-u" as a synonym for "-p"
Linus Torvalds [Fri, 8 Jul 2005 17:45:07 +0000 (10:45 -0700)]
git-diff-*: support "-u" as a synonym for "-p"

I'm probably not the only one whose fingers have gotten hard-wired to
use "-u" for "unified diff".

19 years ago[PATCH] git-format-patch: Prepare patches for e-mail submission.
Junio C Hamano [Tue, 5 Jul 2005 20:19:05 +0000 (13:19 -0700)]
[PATCH] git-format-patch: Prepare patches for e-mail submission.

This is the script I use to prepare patches for e-mail submission.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMark more characters shell-safe.
Linus Torvalds [Fri, 8 Jul 2005 00:59:23 +0000 (17:59 -0700)]
Mark more characters shell-safe.

I still worry about just quoting things when passing it off to "ssh" or
"sh -c", so I'm being anal.  But _, ^ and , are certainly ok and while
both ~ and @ can have speacial meaning to shell/ssh they are benign.

19 years agogit-fsck-cache: don't complain about lacking references when they are all in packs.
Linus Torvalds [Fri, 8 Jul 2005 00:05:41 +0000 (17:05 -0700)]
git-fsck-cache: don't complain about lacking references when they are all in packs.

We used to not count them at all, which then made us complain that there
were no refs.

19 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/chrisw/git
Linus Torvalds [Thu, 7 Jul 2005 22:56:49 +0000 (15:56 -0700)]
Merge /pub/scm/linux/kernel/git/chrisw/git

19 years ago[PATCH] Typofix an error message in pack-check.c
Junio C Hamano [Thu, 7 Jul 2005 22:12:20 +0000 (15:12 -0700)]
[PATCH] Typofix an error message in pack-check.c

The current error message does not make any sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Prevent t6000 series from dropping useless sed.script in t/
Junio C Hamano [Thu, 7 Jul 2005 18:39:10 +0000 (11:39 -0700)]
[PATCH] Prevent t6000 series from dropping useless sed.script in t/

The Makefile in the test suite directory considers any file
matching t[0-9][0-9][0-9][0-9]-*.sh as the top-level test script
to be executed.  Unfortunately this was not documented, and the
common test library, t6000-lib.sh was named to match that
pattern.  This caused t6000-lib.sh to be called from Makefile as
the top-level program, causing it to leave t/sed.script file
behind.  Rename it to t6000lib.sh to prevent this, and document
the naming convention a bit more clearly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Short-circuit git-clone-pack while cloning locally (take 2).
Junio C Hamano [Wed, 6 Jul 2005 20:04:21 +0000 (13:04 -0700)]
[PATCH] Short-circuit git-clone-pack while cloning locally (take 2).

When we are cloning a repository on a local filesystem, it is
faster to just create a hard linkfarm of .git/object hierarchy
and copy the .git/refs files.  By default, the script uses the
clone-pack method, but it can be told with the -l flag to do the
hard linkfarm (falling back on recursive file copy) to replicate
the .git/object hierarchy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoInfrastructure for git rpm builds. Adds GIT_VERSION to Makefile and new make
Chris Wright [Thu, 7 Jul 2005 20:09:50 +0000 (13:09 -0700)]
Infrastructure for git rpm builds.  Adds GIT_VERSION to Makefile and new make
targets: git.spec, dist, and rpm.  A simple 'make rpm' will build the rpm.
Also adds git.spec.in which is used to generate git.spec.

Signed-off-by: Chris Wright <chrisw@osdl.org>
19 years agogit-clone-pack: fix sparse warning
Linus Torvalds [Thu, 7 Jul 2005 01:51:56 +0000 (18:51 -0700)]
git-clone-pack: fix sparse warning

Local function that wasn't marked static

19 years ago[PATCH] Tidy up - remove use of (*f)() idiom from epoch.c
Jon Seymour [Thu, 7 Jul 2005 01:26:43 +0000 (11:26 +1000)]
[PATCH] Tidy up - remove use of (*f)() idiom from epoch.c

Replace (*f)() with f() where the former idiom was used in epoch.c

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Ensure list insertion method does not depend on position of --merge-order...
Jon Seymour [Thu, 7 Jul 2005 00:59:13 +0000 (10:59 +1000)]
[PATCH] Ensure list insertion method does not depend on position of --merge-order argument

This change ensures that git-rev-list --merge-order produces the same result
irrespective of what position the --merge-order argument appears in the argument
list.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Write sed script directly into temp file, rather than a variable
Jon Seymour [Thu, 7 Jul 2005 00:50:07 +0000 (10:50 +1000)]
[PATCH] Write sed script directly into temp file, rather than a variable

When sed uses \n rather than ; as a separator (for BSD sed(1) compat),
it is cleaner to use a file directly, rather than an environment
variable containing \n characters.

This change changes t/t6000 write to sed.script directly and changes
the other tests to remove knowledge of sed.script.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add t/t6003 with some --topo-order tests
Jon Seymour [Thu, 7 Jul 2005 00:50:04 +0000 (10:50 +1000)]
[PATCH] Add t/t6003 with some --topo-order tests

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMake gitk use --topo-order instead of --merge-order
Linus Torvalds [Wed, 6 Jul 2005 23:55:53 +0000 (16:55 -0700)]
Make gitk use --topo-order instead of --merge-order

It's cheaper to calculate, and doesn't give different results depending
on the order of the arguments passed in (and is thus more appropriate
for something like gitk that can validly take the unordered "--all" flag
to show all branches).

The previous dup fix seems to have fixed --topo-order.  Holler if you
still see problems.

19 years agogit-rev-list: remove the DUPCHECK logic, use SEEN instead
Linus Torvalds [Wed, 6 Jul 2005 23:52:49 +0000 (16:52 -0700)]
git-rev-list: remove the DUPCHECK logic, use SEEN instead

That's what we should have done in the first place, since it not only
avoids another unnecessary flag, it also protects the commits from
showing up as duplicates later when they show up as parents of another
commit (in the pop_most_recent_commit() path).

This will hopefully also fix --topo-sort.

19 years agoMake sure we generate the whole commit list before trying to sort it topologically
Linus Torvalds [Wed, 6 Jul 2005 17:51:43 +0000 (10:51 -0700)]
Make sure we generate the whole commit list before trying to sort it topologically

This was my cherry-pickng merge bug.  But topo-order still shows strange
behaviour with multiple heads, so keep gitk using --merge-order for now.

19 years ago[PATCH] Let umask do its work upon filesystem object creation.
Junio C Hamano [Wed, 6 Jul 2005 08:21:46 +0000 (01:21 -0700)]
[PATCH] Let umask do its work upon filesystem object creation.

IIRC our strategy was to let the users' umask take care of the
final mode bits.  This patch fixes places that deviate from it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] clone-pack.c:write_one_ref() - Create leading directories.
Junio C Hamano [Wed, 6 Jul 2005 08:11:52 +0000 (01:11 -0700)]
[PATCH] clone-pack.c:write_one_ref() - Create leading directories.

The function write_one_ref() is passed the list of refs received
from the other end, which was obtained by directory traversal
under $GIT_DIR/refs; this can contain paths other than what
git-init-db prepares and would fail to clone when there is
such.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fixes a problem with --merge-order A B (A is linear descendent of a merge B)
Jon Seymour [Wed, 6 Jul 2005 16:39:35 +0000 (02:39 +1000)]
[PATCH] Fixes a problem with --merge-order A B (A is linear descendent of a merge B)

This patch passes the test case introduced by the previous patch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add a t/t6001 test case for a --merge-order bug
Jon Seymour [Wed, 6 Jul 2005 16:39:35 +0000 (02:39 +1000)]
[PATCH] Add a t/t6001 test case for a --merge-order bug

This test case demonstrates a problem with --merge-order.

A
|
B
|\
C D
|/
E
|
F

git-rev-list --merge-order A B doesn't produce the expected output of

A
B
D
C
E
F

The problem is fixed by a subsequent patch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Tidy up - slight simplification of rev-list.c
Jon Seymour [Wed, 6 Jul 2005 16:39:34 +0000 (02:39 +1000)]
[PATCH] Tidy up - slight simplification of rev-list.c

This patch implements a small tidy up of rev-list.c to reduce
(but not eliminate) the amount of ugliness associated
with the merge_order flag.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "--topo-order" flag to use new topological sort
Linus Torvalds [Wed, 6 Jul 2005 17:25:04 +0000 (10:25 -0700)]
Add "--topo-order" flag to use new topological sort

19 years ago[PATCH] Add a topological sort procedure to commit.c
Jon Seymour [Wed, 6 Jul 2005 16:39:34 +0000 (02:39 +1000)]
[PATCH] Add a topological sort procedure to commit.c

This introduces an in-place topological sort procedure to commit.c.

Given a list of commits, sort_in_topological_order() will perform an in-place
topological sort of that list.

The invariant that applies to the resulting list is:

       a reachable from b => ord(b) < ord(a)

This invariant is weaker than the --merge-order invariant, but is cheaper
to calculate (assuming the list has been identified) and will serve any
purpose where only a minimal topological order guarantee is required.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoUse the new git-rev-parse "--[no-]flags" in "git diff".
Linus Torvalds [Wed, 6 Jul 2005 17:09:58 +0000 (10:09 -0700)]
Use the new git-rev-parse "--[no-]flags" in "git diff".

This allows you to do

git diff v2.6.12..v2.6.13-rc1 drivers/pcmcia

to see the diff between v2.6.12 and v2.6.13-rc1 as limited by the
filename argument.

19 years agoAdd "--flags" and "--no-flags" arguments to git-rev-parse
Linus Torvalds [Wed, 6 Jul 2005 17:08:08 +0000 (10:08 -0700)]
Add "--flags" and "--no-flags" arguments to git-rev-parse

The scripts that use this (notably "git diff") will want to split up
flags and file arguments.

19 years agoRemove insane overlapping bit ranges from epoch.c
Linus Torvalds [Wed, 6 Jul 2005 16:56:16 +0000 (09:56 -0700)]
Remove insane overlapping bit ranges from epoch.c

..and move the DUPCHECK to rev-list.c since both the merge-order and the
upcoming topo-sort get confused by dups.

19 years agoClean up commit insertion in git-rev-list
Linus Torvalds [Wed, 6 Jul 2005 16:38:06 +0000 (09:38 -0700)]
Clean up commit insertion in git-rev-list

Jon wants the commits in a different order for merge-order.

19 years agoMake "insert_by_date()" match "commit_list_insert()"
Linus Torvalds [Wed, 6 Jul 2005 16:31:17 +0000 (09:31 -0700)]
Make "insert_by_date()" match "commit_list_insert()"

Same argument order, same return type.  This allows us to use a function
pointer to choose one over the other.

19 years ago[PATCH] Change the sed seperator in t/t6000-lib.sh.
Jon Seymour [Wed, 6 Jul 2005 10:11:29 +0000 (20:11 +1000)]
[PATCH] Change the sed seperator in t/t6000-lib.sh.

This trivial patch removes the semicolon as the sed seperator in the t/t6000-lib.sh test script
and replaces it with white space.  This makes BSD sed(1) much happier.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Introduce unit tests for git-rev-list --bisect
Jon Seymour [Wed, 6 Jul 2005 10:11:27 +0000 (20:11 +1000)]
[PATCH] Introduce unit tests for git-rev-list --bisect

This patch introduces some unit tests for the git-rev-list --bisect functionality.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Factor out useful test case infrastructure from t/t6001... into t/t6000-lib.sh
Jon Seymour [Wed, 6 Jul 2005 10:11:24 +0000 (20:11 +1000)]
[PATCH] Factor out useful test case infrastructure from t/t6001... into t/t6000-lib.sh

Functions that are useful to other t6xxx testcases are moved into t6000-lib.sh

To use these functions in a test case, use a test-case pre-amble like:

. ./test-lib.sh
. ../t6000-lib.sh # t6xxx specific functions

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix fd leak in git-cvsimport-script
Sven Verdoolaege [Wed, 6 Jul 2005 06:37:12 +0000 (08:37 +0200)]
[PATCH] Fix fd leak in git-cvsimport-script

Remember to close temporary file

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] sha1_file.c;prepare_packed_git_one() - fix DIR leak
Junio C Hamano [Wed, 6 Jul 2005 06:52:17 +0000 (23:52 -0700)]
[PATCH] sha1_file.c;prepare_packed_git_one() - fix DIR leak

The function calls opendir() without a matching closedir().

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMerge master.kernel.org:/pub/scm/gitk/gitk
Linus Torvalds [Wed, 6 Jul 2005 02:00:26 +0000 (19:00 -0700)]
Merge master.kernel.org:/pub/scm/gitk/gitk

19 years agoFix up path-cleanup in git_path() properly
Linus Torvalds [Wed, 6 Jul 2005 01:10:59 +0000 (18:10 -0700)]
Fix up path-cleanup in git_path() properly

GIT_DIR=.  ends up being what some of the pack senders use, and we
sometimes messed up when cleaning up the path, ie a ".//HEAD" was
cleaned up into "/HEAD", not "HEAD" like it should be.

We should do some other cleanup, and probably also verify that symlinks
don't point to outside the git area.

19 years agoIncrease the number of possible heads requested from git-upload-pack
Linus Torvalds [Wed, 6 Jul 2005 00:19:20 +0000 (17:19 -0700)]
Increase the number of possible heads requested from git-upload-pack

Now that git-clone-pack exists, we actually have somebody requesting
more than just a single head in a pack.  So allow the Jeff's of this
world to clone things with tens of heads.

19 years agoAdd a "git-show-index" helper that shows the contents of a pack index
Linus Torvalds [Wed, 6 Jul 2005 00:08:02 +0000 (17:08 -0700)]
Add a "git-show-index" helper that shows the contents of a pack index

This was invaluable for debugging the zero-sized compression issue, and
might be useful for scripting too, if people want to see the contents of
a pack.

19 years agoDon't special-case a zero-sized compression.
Linus Torvalds [Wed, 6 Jul 2005 00:06:09 +0000 (17:06 -0700)]
Don't special-case a zero-sized compression.

zlib actually writes a header for that case, and while ignoring that
header will get us the right data, it will also end up messing up our
stream position.  So we actually want zlib to "uncompress" even an empty
object.

19 years agoMake "git clone" use the new git-clone-pack
Linus Torvalds [Tue, 5 Jul 2005 22:47:34 +0000 (15:47 -0700)]
Make "git clone" use the new git-clone-pack

19 years agoAdd "git-clone-pack" program to help with "git clone"
Linus Torvalds [Tue, 5 Jul 2005 22:45:37 +0000 (15:45 -0700)]
Add "git-clone-pack" program to help with "git clone"

19 years agoFix silly thinko in "head_ref()"
Linus Torvalds [Tue, 5 Jul 2005 22:45:00 +0000 (15:45 -0700)]
Fix silly thinko in "head_ref()"

It did a "for_each_ref()" in addition to the HEAD case, which was a
left-over from an early broken test.

19 years agoMove "get_ack()" to common git_connect functions
Linus Torvalds [Tue, 5 Jul 2005 22:44:09 +0000 (15:44 -0700)]
Move "get_ack()" to common git_connect functions

git-clone-pack will want it too. Soon.

19 years agoRemove multi-head support from fetch-pack
Linus Torvalds [Tue, 5 Jul 2005 21:39:30 +0000 (14:39 -0700)]
Remove multi-head support from fetch-pack

It was a misguided attempt to mix fetching and cloning. I'll make
a separate clone thing.

19 years agoRemove unnecessary usage of strncmp() in git-rev-list arg parsing.
Linus Torvalds [Tue, 5 Jul 2005 19:12:50 +0000 (12:12 -0700)]
Remove unnecessary usage of strncmp() in git-rev-list arg parsing.

Not only is it unnecessary, it incorrectly allows extraneous characters
at the end of the argument.

Junio noticed the --merge-order thing, and Jon points out that if we fix
that one, we should fix --show-breaks too.

19 years agoMerge head 'cvs2git' of http://netz.smurf.noris.de/git/git
Linus Torvalds [Tue, 5 Jul 2005 19:03:14 +0000 (12:03 -0700)]
Merge head 'cvs2git' of netz.smurf.noris.de/git/git

19 years agoWork around git-http-pull breakage in git-fetch-script
Linus Torvalds [Tue, 5 Jul 2005 19:02:10 +0000 (12:02 -0700)]
Work around git-http-pull breakage in git-fetch-script

Need to add a final slash.  And make it verbose by default, since it's
so slow that otherwise people will think it's died.

19 years agogit-fetch-script: use git-fetch-pack for local and ssh fetches.
Linus Torvalds [Tue, 5 Jul 2005 18:38:37 +0000 (11:38 -0700)]
git-fetch-script: use git-fetch-pack for local and ssh fetches.

Also, clean it up a lot.

19 years agoAdd "git_path()" and "head_ref()" helper functions.
Linus Torvalds [Tue, 5 Jul 2005 18:31:32 +0000 (11:31 -0700)]
Add "git_path()" and "head_ref()" helper functions.

"git_path()" returns a static pathname pointer into the git directory
using a printf-like format specifier.

"head_ref()" works like "for_each_ref()", except for just the HEAD.

19 years agoMerge with Linus' current tree
Matthias Urlichs [Tue, 5 Jul 2005 13:32:29 +0000 (15:32 +0200)]
Merge with Linus' current tree

19 years agoMerge with http://www.liacs.nl/~sverdool/git.git#cvs2git
Matthias Urlichs [Tue, 5 Jul 2005 12:23:36 +0000 (14:23 +0200)]
Merge ... www.liacs.nl/~sverdool/git.git#cvs2git

19 years agocvsimport: getopt accepted a -q option (undocumented and unused).
Matthias Urlichs [Tue, 5 Jul 2005 12:22:53 +0000 (14:22 +0200)]
cvsimport: getopt accepted a -q option (undocumented and unused).
           Removed.

19 years agogit-cvsimport-script: move working directory forward
Sven Verdoolaege [Tue, 5 Jul 2005 11:19:59 +0000 (13:19 +0200)]
git-cvsimport-script: move working directory forward

If HEAD happened to point to a cvs branch, move the
working directory forward to the tip of the branch.
Additionally, if master and "origin" are equal,
move master forward to new origin first.

19 years agogit-rev-list: make sure the output is sorted by recency
Linus Torvalds [Mon, 4 Jul 2005 23:49:37 +0000 (16:49 -0700)]
git-rev-list: make sure the output is sorted by recency

We didn't sort the refs by date, so if you had multiple refs, the end
result would not be properly sorted.

19 years agoMake rev-list flush the stdio buffers after each rev.
Linus Torvalds [Mon, 4 Jul 2005 23:36:48 +0000 (16:36 -0700)]
Make rev-list flush the stdio buffers after each rev.

We'd rather get the revisions in a slow but timely manner than
have to wait for them.

19 years agoMake git-fetch-pack actually do all the unpacking etc.
Linus Torvalds [Mon, 4 Jul 2005 23:35:13 +0000 (16:35 -0700)]
Make git-fetch-pack actually do all the unpacking etc.

It returns the result SHA1 on stdout, so you can do

remote=$(git-fetch-pack host:dir branchname)

and it will unpack the objects and "remote" will be the SHA1 name of the
branch on the other side.  You can then save that off, or merge it, or
whatever.

19 years agoMake git-fetch-pack and git-upload-pack negotiate needs/haves fully
Linus Torvalds [Mon, 4 Jul 2005 22:29:17 +0000 (15:29 -0700)]
Make git-fetch-pack and git-upload-pack negotiate needs/haves fully

Now the only piece missing is actually generating the pack-file.

19 years agoClean up output of "for_each_ref()" when GIT_DIR is "."
Linus Torvalds [Mon, 4 Jul 2005 22:28:19 +0000 (15:28 -0700)]
Clean up output of "for_each_ref()" when GIT_DIR is "."

Remove the "./" at the head, it just looks much nicer.

19 years agogit-cvsimport-script: remove unused variable
Sven Verdoolaege [Mon, 4 Jul 2005 21:18:35 +0000 (23:18 +0200)]
git-cvsimport-script: remove unused variable

19 years agoCommit first cut at "git-fetch-pack"
Linus Torvalds [Mon, 4 Jul 2005 20:26:53 +0000 (13:26 -0700)]
Commit first cut at "git-fetch-pack"

It's meant to be used by "git fetch" for the local and ssh case.

It doesn't actually do the fetching now, but it does discover the common
commit point.

19 years agoMove ref path matching to connect.c library
Linus Torvalds [Mon, 4 Jul 2005 20:24:30 +0000 (13:24 -0700)]
Move ref path matching to connect.c library

It's a generic thing for matching refs from the other side.