git.git
19 years agogit-cvsimport-script: typo head -> heads
Sven Verdoolaege [Sun, 3 Jul 2005 21:40:48 +0000 (23:40 +0200)]
git-cvsimport-script: typo head -> heads

19 years agocvsimport: Missing tests for verbosity flag.
Matthias Urlichs [Sun, 3 Jul 2005 17:03:30 +0000 (19:03 +0200)]
cvsimport: Missing tests for verbosity flag.

19 years agoSupport :ext: access method.
Sven Verdoolaege [Sun, 3 Jul 2005 11:02:06 +0000 (13:02 +0200)]
Support :ext: access method.

19 years agoHonour CVS_SERVER.
Sven Verdoolaege [Sun, 3 Jul 2005 10:26:51 +0000 (12:26 +0200)]
Honour CVS_SERVER.

19 years agogit-cvsimport-script: clean up documentation
Sven Verdoolaege [Sun, 3 Jul 2005 09:38:06 +0000 (11:38 +0200)]
git-cvsimport-script: clean up documentation

Remove documentation of irrelevant "type" option.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
19 years agoMake specification of CVS module to convert optional.
Sven Verdoolaege [Sun, 3 Jul 2005 09:34:59 +0000 (11:34 +0200)]
Make specification of CVS module to convert optional.

If we're inside a checked out CVS repository, there is
no need to explicitly specify the module as it is
available in CVS/Repository.
Also read CVS/Root if it's available and -d is not specified.
Finally, explicitly pass root to cvsps as CVS/Root takes
precedence over CVSROOT.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
19 years agoFixed a typo in Documentation/git-cvsimport-script.txt.
Sven Verdoolaege [Sun, 3 Jul 2005 07:43:00 +0000 (09:43 +0200)]
Fixed a typo in Documentation/git-cvsimport-script.txt.

19 years agocvsimport: add documentation.
Matthias Urlichs [Thu, 30 Jun 2005 20:54:33 +0000 (22:54 +0200)]
cvsimport: add documentation.

19 years agocvsimport: Added option '-p': pass options to cvsps
Matthias Urlichs [Thu, 30 Jun 2005 20:54:01 +0000 (22:54 +0200)]
cvsimport: Added option '-p': pass options to cvsps
           Added option '-x' to cvsps call

19 years agocvsimport: Exit if an existing repository doesn't have the right branch.
Matthias Urlichs [Thu, 30 Jun 2005 20:10:32 +0000 (22:10 +0200)]
cvsimport: Exit if an existing repository doesn't have the right branch.

19 years agocvs import: Strip whitespace at the end of the log entry
Matthias Urlichs [Thu, 30 Jun 2005 20:09:42 +0000 (22:09 +0200)]
cvs import: Strip whitespace at the end of the log entry
            for compatibility with old cvs2git.

19 years agocvsimport: perform string comparison on "HEAD"
Sven Verdoolaege [Thu, 30 Jun 2005 15:23:22 +0000 (17:23 +0200)]
cvsimport: perform string comparison on "HEAD"

19 years agogit-cvsimport-script: Removed redundant @old and @new clear.
Matthias Urlichs [Thu, 30 Jun 2005 10:28:31 +0000 (12:28 +0200)]
git-cvsimport-script: Removed redundant @old and @new clear.

19 years agogit-cvsimport-script: Remove setting Sticky; it may cause problems
Matthias Urlichs [Thu, 30 Jun 2005 10:19:48 +0000 (12:19 +0200)]
git-cvsimport-script: Remove setting Sticky; it may cause problems

19 years agocvs import: Call git-update-cache multiple times
Matthias Urlichs [Thu, 30 Jun 2005 09:55:57 +0000 (11:55 +0200)]
cvs import: Call git-update-cache multiple times
            instead of with a too-long argument list.

19 years agoMore doc
Matthias Urlichs [Tue, 28 Jun 2005 19:21:33 +0000 (21:21 +0200)]
More doc

19 years agoDocument the new migration tool
Matthias Urlichs [Tue, 28 Jun 2005 19:11:23 +0000 (21:11 +0200)]
Document the new migration tool

19 years agoRollbak to the original branch after importing
Matthias Urlichs [Tue, 28 Jun 2005 19:08:15 +0000 (21:08 +0200)]
Rollbak to the original branch after importing

19 years agoLocal cvsimport fixups
Matthias Urlichs [Tue, 28 Jun 2005 17:58:40 +0000 (19:58 +0200)]
Local cvsimport fixups

19 years agoFix remote CVS import.
Matthias Urlichs [Tue, 28 Jun 2005 17:49:19 +0000 (19:49 +0200)]
Fix remote CVS import.

19 years agoAdded Perl git-cvsimport-script
Matthias Urlichs [Tue, 28 Jun 2005 14:48:40 +0000 (16:48 +0200)]
Added Perl git-cvsimport-script

19 years agoTeach git-pull-script about pulling tags
Linus Torvalds [Tue, 28 Jun 2005 03:10:32 +0000 (20:10 -0700)]
Teach git-pull-script about pulling tags

19 years agoFix another test that broke with the recent git-init-db update
Linus Torvalds [Tue, 28 Jun 2005 02:48:02 +0000 (19:48 -0700)]
Fix another test that broke with the recent git-init-db update

t5300-pack-object.sh test 8 expected to have to create the "pack"
directory itself, and was unhappy when it already existed.

19 years ago[PATCH] Skip writing out sha1 files for objects in packed git.
Junio C Hamano [Tue, 28 Jun 2005 02:03:13 +0000 (19:03 -0700)]
[PATCH] Skip writing out sha1 files for objects in packed git.

Now, there's still a misfeature there, which is that when you
create a new object, it doesn't check whether that object
already exists in the pack-file, so you'll end up with a few
recent objects that you really don't need (notably tree
objects), and this patch fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] replace sha1sum with sum in t/t1002
Mark Allen [Tue, 28 Jun 2005 01:40:31 +0000 (18:40 -0700)]
[PATCH] replace sha1sum with sum in t/t1002

This replaces sha1sum(1) with sum(1) in t/t1002.  GNU sum(1) runs in
"BSD compatibility" mode by default, and not all systems have GNU
coreutils.  On any system without GNU coreutils (or sha1sum) t1002 will
fail.  This patch should make t1002 complete successfully everywhere
that sum(1) runs.

I've tested this on Darwin and Linux; it works on both platforms.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
Acked-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoFix up test that counted subdirectories in ".git/objects"
Linus Torvalds [Tue, 28 Jun 2005 02:10:01 +0000 (19:10 -0700)]
Fix up test that counted subdirectories in ".git/objects"

Now there are 257 of them (256 numeric ones, and the new "pack" directory)

19 years agogit-init-db: create "pack" subdirectory under objects
Linus Torvalds [Tue, 28 Jun 2005 01:26:11 +0000 (18:26 -0700)]
git-init-db: create "pack" subdirectory under objects

Don't make the user have to mkdir it just because he's excited about the
new object pack functionality, do it for him.

19 years agoMerge rsync://rsync.kernel.org/pub/scm/gitk/gitk
Linus Torvalds [Tue, 28 Jun 2005 01:15:47 +0000 (18:15 -0700)]
Merge rsync://rsync.kernel.org/pub/scm/gitk/gitk

19 years agocsum-file: fix missing buf pointer update
Linus Torvalds [Tue, 28 Jun 2005 00:02:56 +0000 (17:02 -0700)]
csum-file: fix missing buf pointer update

This would create broken pack archives for anything nontrivial.

19 years ago[PATCH] Teach read_sha1_file() and friends about packed git object store.
Junio C Hamano [Mon, 27 Jun 2005 10:35:33 +0000 (03:35 -0700)]
[PATCH] Teach read_sha1_file() and friends about packed git object store.

GIT_OBJECT_DIRECTORY and GIT_ALTERNATE_OBJECT_DIRECTORIES can
have the "pack" subdirectory that houses "packed GIT" files
produced by git-pack-objects (e.g. .git/objects/pack/foo.pack
and .git/objects/pack/foo.idx; always store them as pairs).  The
following functions in sha1_file.c can then read object contents
from such packed file:

 - sha1_object_info()
 - has_sha1_file()
 - read_sha1_file()

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Enhance sha1_file_size() into sha1_object_info()
Junio C Hamano [Mon, 27 Jun 2005 10:34:06 +0000 (03:34 -0700)]
[PATCH] Enhance sha1_file_size() into sha1_object_info()

This lets us eliminate one use of map_sha1_file() outside
sha1_file.c, to bring us one step closer to the packed GIT.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Remove "delta" object representation.
Junio C Hamano [Mon, 27 Jun 2005 10:33:33 +0000 (03:33 -0700)]
[PATCH] Remove "delta" object representation.

Packed delta files created by git-pack-objects seems to be the
way to go, and existing "delta" object handling code has exposed
the object representation details to too many places.  Remove it
while we refactor code to come up with a proper interface in
sha1_file.c.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-ssh-pull: commit-id consistency
Sven Verdoolaege [Mon, 27 Jun 2005 19:03:07 +0000 (21:03 +0200)]
[PATCH] git-ssh-pull: commit-id consistency

In contrast to other plumbing tools, git-ssh-push only
allow a very restrictive form of commit-id filenames.
This patch removes this restriction.

Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-checkout-script: use "--verify --revs-only" to parse revs
Linus Torvalds [Mon, 27 Jun 2005 19:12:18 +0000 (12:12 -0700)]
git-checkout-script: use "--verify --revs-only" to parse revs

Sven Verdoolaege points out that I added the --verify option to
git-rev-parse exactly for things like this, but didn't update the
users.

19 years agoAdd a menu item for creating tags.
Paul Mackerras [Mon, 27 Jun 2005 12:56:40 +0000 (22:56 +1000)]
Add a menu item for creating tags.

19 years agoFix a bug where we would corrupt the stuff read from git-rev-list.
Paul Mackerras [Mon, 27 Jun 2005 10:04:26 +0000 (20:04 +1000)]
Fix a bug where we would corrupt the stuff read from git-rev-list.

If we have a very long commit message, and we end up getting a
bufferfull of data from git-rev-list that all belongs to one commit,
we ended up throwing away the data from a previous read that should
have been included.  The result was a error message about not being
able to parse the output of git-rev-list.

Also, if the git-rev-list output that we can't parse is long, only put
the first 80 chars in the error message.  Otherwise we end up with an
enormous error window.

19 years agoAdd a menu entry for generating a patch between any two commits.
Paul Mackerras [Mon, 27 Jun 2005 09:27:32 +0000 (19:27 +1000)]
Add a menu entry for generating a patch between any two commits.

19 years agocsum-file interface updates: return resulting SHA1
Linus Torvalds [Mon, 27 Jun 2005 05:01:46 +0000 (22:01 -0700)]
csum-file interface updates: return resulting SHA1

Also, make the writing of the SHA1 as a end-header be conditional: not
every user will necessarily want to write the SHA1 to the file itself,
even though current users do (but we migh end up using the same helper
functions for the object files themselves, that don't do this).

This also makes the packed index file contain the SHA1 of the packed
data file at the end (just before its own SHA1).  That way you can
validate the pairing of the two if you want to.

19 years agoFix behaviour in the case where we have no commits to display.
Paul Mackerras [Mon, 27 Jun 2005 03:38:29 +0000 (13:38 +1000)]
Fix behaviour in the case where we have no commits to display.

I had code in there to put "No commits selected" on the canvas
but it needed some globals.

19 years agogit-pack-objects: write the pack files with a SHA1 csum
Linus Torvalds [Mon, 27 Jun 2005 03:27:56 +0000 (20:27 -0700)]
git-pack-objects: write the pack files with a SHA1 csum

We want to be able to check their integrity later, and putting the
sha1-sum of the contents at the end is a good thing.  The writing
routines are generic, so we could try to re-use them for the index file,
instead of having the same logic duplicated.

Update unpack-objects to know about the extra 20 bytes at the end
of the index.

19 years agoAdd "--pretty=full" format that also shows committer.
Linus Torvalds [Mon, 27 Jun 2005 00:50:46 +0000 (17:50 -0700)]
Add "--pretty=full" format that also shows committer.

Also move the common implementation of parsing the --pretty argument
format into commit.c rather than having duplicates in diff-tree.c and
rev-list.c.

19 years agoAdd git-verify-tag script
Jan Harkes [Mon, 27 Jun 2005 00:38:47 +0000 (17:38 -0700)]
Add git-verify-tag script

Here is a script to simplify validating the gpg signature created by
git-tag-script. Might be useful to add to the git tree so that people
don't have to search for the right post in the git mailinglist archives

19 years agoCheck for the existence of the git directory on startup.
Paul Mackerras [Mon, 27 Jun 2005 00:37:11 +0000 (10:37 +1000)]
Check for the existence of the git directory on startup.

Check that $GIT_DIR (or .git, if GIT_DIR is not set) is a directory.
This means we can give a more informative error message if the user
runs gitk somewhere that isn't a git repository.

19 years agogit-pack-objects: use name information (if any) to sort objects for packing.
Linus Torvalds [Sun, 26 Jun 2005 22:27:28 +0000 (15:27 -0700)]
git-pack-objects: use name information (if any) to sort objects for packing.

This is incredibly cheezy. But it's cheap, and it works pretty well.

19 years agoOoh. Make git-rev-list --object associate a name with objects.
Linus Torvalds [Sun, 26 Jun 2005 22:26:05 +0000 (15:26 -0700)]
Ooh. Make git-rev-list --object associate a name with objects.

The name isn't unique, it's just the first name that object is reached
through, so it's really nothing more than a hint.

19 years agogit-pack-objects: do the delta search in reverse size order
Linus Torvalds [Sun, 26 Jun 2005 20:43:41 +0000 (13:43 -0700)]
git-pack-objects: do the delta search in reverse size order

Starting from big objects and going backwards means that we end up
picking a delta that goes from a bigger object to a smaller one.  That's
advantageous for two reasons: the bigger object is likely the newer one
(since things tend to grow, rather than shrink), and doing a delete
tends to be smaller than doing an add.

So the deltas don't tend to be top-of-tree, and the packed end result is
just slightly smaller.

19 years ago[PATCH] Add git-relink-script to fix up missing hardlinks
Ryan Anderson [Sun, 26 Jun 2005 18:15:16 +0000 (14:15 -0400)]
[PATCH] Add git-relink-script to fix up missing hardlinks

This will scan 2 or more object repositories and look for common objects, check
if they are hardlinked, and replace one with a hardlink to the other if not.

This version warns when skipping files because of size differences, and
handle more than 2 repositories automatically.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Cheered-on-by: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-rev-parse: add "--not" flag to mark subsequent heads negative
Linus Torvalds [Sun, 26 Jun 2005 18:34:30 +0000 (11:34 -0700)]
git-rev-parse: add "--not" flag to mark subsequent heads negative

If you have two lists of heads, and you want to see ones reachable from
list $a but not from list $b, just do

git-rev-list $(git-rev-parse $a --not $b)

which is useful for both bisecting (where "b" would be the list of known
good revisions, and "a" would be the latest found bad head) and for just
seeing what the difference between two sets of heads are if you want to
generate a pack-file for the difference.

19 years agogit-unpack-objects: start removing debug output
Linus Torvalds [Sun, 26 Jun 2005 15:49:48 +0000 (08:49 -0700)]
git-unpack-objects: start removing debug output

At least the least interesting one.

19 years agoFix object packing/unpacking.
Linus Torvalds [Sun, 26 Jun 2005 15:40:08 +0000 (08:40 -0700)]
Fix object packing/unpacking.

This actually successfully packed and unpacked a git archive down to
1.3MB (17MB unpacked).

Right now unpacking is way too noisy, lots of debug messages left.

19 years ago[PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.
Junio C Hamano [Sun, 26 Jun 2005 11:29:18 +0000 (04:29 -0700)]
[PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.

This finishes the initial round of git-pack-object /
git-unpack-object pair.  They are now good enough to be used as
a transport medium:

 - Fix delta direction in pack-objects; the original was
   computing delta to create the base object from the object to
   be squashed, which was quite unfriendly for unpacker ;-).

 - Add a script to test the very basics.

 - Implement unpacker for both regular and deltified objects.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "--depth=N" parameter to git-pack-objects to limit maximum delta depth
Linus Torvalds [Sun, 26 Jun 2005 03:17:59 +0000 (20:17 -0700)]
Add "--depth=N" parameter to git-pack-objects to limit maximum delta depth

It too defaults to 10. A nice round random number.

19 years agogit-pack-objects: make "--window=x" semantics more logical.
Linus Torvalds [Sun, 26 Jun 2005 02:35:47 +0000 (19:35 -0700)]
git-pack-objects: make "--window=x" semantics more logical.

A zero disables delta generation (like before), but we make the window
be one bigger than specified, since we use one entry for the one to be
tested (it used to be that "--window=1" was meaningless, since we'd have
used up the single-entry window with the entry to be tested, and had no
chance of actually ever finding a delta).

The default window remains at 10, but now it really means "test the 10
closest objects", not "test the 9 closest objects".

19 years agoAdd a "max_size" parameter to diff_delta()
Linus Torvalds [Sun, 26 Jun 2005 02:30:20 +0000 (19:30 -0700)]
Add a "max_size" parameter to diff_delta()

Anything that generates a delta to see if two objects are close usually
isn't interested in the delta ends up being bigger than some specified
size, and this allows us to stop delta generation early when that
happens.

19 years agoFix delta "sliding window" code
Linus Torvalds [Sun, 26 Jun 2005 01:29:23 +0000 (18:29 -0700)]
Fix delta "sliding window" code

When Junio fixed the lack of a successful error code from try_delta(),
that uncovered an off-by-one error in the caller.

Also, some testing made it clear that we now find a lot more deltas,
because we used to (incorrectly) break early on bogus "failure"
cases.

19 years ago[PATCH] (patchlet) pack-objects.c: try_delta()
Junio C Hamano [Sun, 26 Jun 2005 00:36:26 +0000 (17:36 -0700)]
[PATCH] (patchlet) pack-objects.c: try_delta()

Return value of try_delta is checked for negativeness, but the
success path does not return anything, letting compiler warn and
presumably return garbage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add a bit of developer documentation to pull.h
Junio C Hamano [Sat, 25 Jun 2005 09:26:29 +0000 (02:26 -0700)]
[PATCH] Add a bit of developer documentation to pull.h

Describe what to implement in fetch() and fetch_ref() for
pull backend writers a bit better.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] http-pull: documentation updates.
Junio C Hamano [Sat, 25 Jun 2005 09:25:57 +0000 (02:25 -0700)]
[PATCH] http-pull: documentation updates.

Describe -w option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix oversimplified optimization for add_cache_entry().
Junio C Hamano [Sat, 25 Jun 2005 09:25:29 +0000 (02:25 -0700)]
[PATCH] Fix oversimplified optimization for add_cache_entry().

An earlier change to optimize directory-file conflict check
broke what "read-tree --emu23" expects.  This is fixed by this
commit.

(1) Introduces an explicit flag to tell add_cache_entry() not to
    check for conflicts and use it when reading an existing tree
    into an empty stage --- by definition this case can never
    introduce such conflicts.

(2) Makes read-cache.c:has_file_name() and read-cache.c:has_dir_name()
    aware of the cache stages, and flag conflict only with paths
    in the same stage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-merge-one-file-script: do not misinterpret rm failure.
Junio C Hamano [Sat, 25 Jun 2005 09:24:50 +0000 (02:24 -0700)]
[PATCH] git-merge-one-file-script: do not misinterpret rm failure.

When a merge adds a file DF and removes a directory there by
deleting a path DF/DF, git-merge-one-file-script can be called
for the removal of DF/DF when the path DF is already created by
"git-read-tree -m -u".  When this happens, we get confused by a
failure return from 'rm -f -- "$4"' (where $4 is DF/DF); finding
file DF there the "rm -f" command complains that DF is not a
directory.

What we want to ensure is that there is no file DF/DF in this
case. Avoid getting ourselves confused by first checking if
there is a file, and only then try to remove it (and check for
failure from the "rm" command).

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add more tests for read-tree --emu23.
Junio C Hamano [Sat, 25 Jun 2005 09:24:16 +0000 (02:24 -0700)]
[PATCH] Add more tests for read-tree --emu23.

This adds more tests for --emu23.  One is to show how it can
carry forward more local changes than the straightforward
two-way fast forward, and another is to show the recent
overeager optimization of directory/file conflict check broke
things, which will be fixed in the next commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-rebase-script: rebase local commits to new upstream head.
Junio C Hamano [Sat, 25 Jun 2005 09:23:43 +0000 (02:23 -0700)]
[PATCH] git-rebase-script: rebase local commits to new upstream head.

Using git-cherry, forward port local commits missing from the
new upstream head.  This also depends on "-m" flag support in
git-commit-script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-cherry: find commits not merged upstream.
Junio C Hamano [Sat, 25 Jun 2005 09:22:59 +0000 (02:22 -0700)]
[PATCH] git-cherry: find commits not merged upstream.

The git-cherry command helps the git-rebase script by finding
commits that have not been merged upstream.  Commits already
included in upstream are prefixed with '-' (meaning "drop from
my local pull"), while commits missing from upstream are
prefixed with '+' (meaning "add to the updated upstream").

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-commit-script: get commit message from an existing one.
Junio C Hamano [Sat, 25 Jun 2005 09:22:05 +0000 (02:22 -0700)]
[PATCH] git-commit-script: get commit message from an existing one.

With -m flag specified, git-commit-script takes the commit
message along with author information from an existing commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] fix date parsing for GIT raw commit timestamp format.
Junio C Hamano [Sat, 25 Jun 2005 09:21:16 +0000 (02:21 -0700)]
[PATCH] fix date parsing for GIT raw commit timestamp format.

Usually all of the match_xxx routines in date.c fill tm
structure assuming that the parsed string talks about local
time, and parse_date routine compensates for it by adjusting the
value with tz offset parsed out separately.  However, this logic
does not work well when we feed GIT raw commit timestamp to it,
because what match_digits gets is already in GMT.

A good testcase is:

    $ make test-date
    $ ./test-date 'Fri Jun 24 16:55:27 2005 -0700' '1119657327 -0700'

These two timestamps represent the same time, but the second one
without the fix this commit introduces gives you 7 hours off.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-unpack-objects: start parsing the actual packed data
Linus Torvalds [Sat, 25 Jun 2005 22:59:31 +0000 (15:59 -0700)]
git-unpack-objects: start parsing the actual packed data

So far we just print out the type and size.

19 years agogit-pack-objects: mark the delta packing with a 'D'.
Linus Torvalds [Sat, 25 Jun 2005 22:58:42 +0000 (15:58 -0700)]
git-pack-objects: mark the delta packing with a 'D'.

When writing a delta, we take the real type from the object we're
doing the delta against, and just write a 'D' as the type of the
current object.

19 years agoFirst cut at git-unpack-objects
Linus Torvalds [Sat, 25 Jun 2005 22:27:14 +0000 (15:27 -0700)]
First cut at git-unpack-objects

So far it just reads the header and generates the list of objects.

It also sorts them by the order they are written in the pack file,
since that ends up being the same order we got them originally, and
is thus "most recent first".

19 years agogit-pack-objects: fix typo
Linus Torvalds [Sat, 25 Jun 2005 22:24:30 +0000 (15:24 -0700)]
git-pack-objects: fix typo

("<" should be "=")

19 years agogit-pack-objects: create a packed object representation.
Linus Torvalds [Sat, 25 Jun 2005 21:42:43 +0000 (14:42 -0700)]
git-pack-objects: create a packed object representation.

This is kind of like a tar-ball for a set of objects, ready to be
shipped off to another end.  Alternatively, you could use is as a packed
representation of the object database directly, if you changed
"read_sha1_file()" to read these kinds of packs.

The latter is partiularly useful to generate a "packed history", ie you
could pack up your old history efficiently, but still have it available
(at a performance hit, of course).

I haven't actually written an unpacker yet, so the end result has not
been verified in any way yet.  I obviously always write bug-free code,
so it just has to work, no?

19 years ago[PATCH] git-write-tree doesn't check alternate directories
Jan Harkes [Sat, 25 Jun 2005 18:23:36 +0000 (14:23 -0400)]
[PATCH] git-write-tree doesn't check alternate directories

git-write-tree failed when referenced objects only exist in the
GIT_ALTERNATE_OBJECT_DIRECTORIES path.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Acked-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoClear the SHA1 entry field when we go to paste something into it
Paul Mackerras [Sat, 25 Jun 2005 06:37:13 +0000 (16:37 +1000)]
Clear the SHA1 entry field when we go to paste something into it

If the user pastes in the selection (with the middle mouse button) and
it already has 40 characters in it, clear it before pasting.

19 years agogit-rev-list: add option to list all objects (not just commits)
Linus Torvalds [Sat, 25 Jun 2005 05:56:58 +0000 (22:56 -0700)]
git-rev-list: add option to list all objects (not just commits)

When you do

git-rev-list --objects $(git-rev-parse HEAD^..HEAD)

it now lists not only the "commit difference" between the parent of HEAD
and HEAD itself (which is normally just the parent, but in the case of a
merge will be all the newly merged commits), but also all the new tree
and blob objects that weren't in the original.

NOTE! It doesn't walk all the way to the root, so it doesn't do a full
object search in the full old history.  Instead, it will only look as
far back in the history as it needs to resolve the commits.  Thus, if
the commit reverts a blob (or tree) back to a state much further back in
history, we may end up listing some blobs (or trees) as "new" even
though they exist further back.

Regardless, the list of objects will be a superset (usually exact) list
of objects needed to go from the beginning commit to ending commit.

As a particularly obvious special case,

git-rev-list --objects HEAD

will end up listing every single object that is reachable from the HEAD
commit.

Side note: the objects are sorted by "recency", with commits first.

19 years agoAdd commit row context menu and handle left-click on graph lines
Paul Mackerras [Sat, 25 Jun 2005 05:39:21 +0000 (15:39 +1000)]
Add commit row context menu and handle left-click on graph lines

Right-click on a context row now brings up a menu allowing the user to
generate a diff between that row and the selected row.  Left-click on
a graph line shows the parent and children connected by the line in
the details pane.  Left-click on a circle in the graph selects that
commit.  Left-click elsewhere in the graph does nothing.

When displaying a diff, the bottom-right file list box behaves
slightly differently now; instead of eliding all other files' diffs,
it now just scrolls the details pane so that the selected file's diff
starts at the top of the pane.

Since the diffs can be rather large, arrange for an update to be done
every 100ms while reading diffs.

Also removed the CVS revision keywords and bumped the version number
to 1.2.

19 years agogit-rev-parse: re-organize and be more careful
Linus Torvalds [Fri, 24 Jun 2005 17:12:55 +0000 (10:12 -0700)]
git-rev-parse: re-organize and be more careful

Output default revisions as their hex SHA1 names to be consistent.

Add "--verify" flag that verifies that we output a single ref and not
more (and disables ref arguments).

19 years agoAdd "git-patch-id" program to generate patch ID's.
Linus Torvalds [Thu, 23 Jun 2005 22:06:04 +0000 (15:06 -0700)]
Add "git-patch-id" program to generate patch ID's.

A "patch ID" is nothing but a SHA1 of the diff associated with a patch,
with whitespace and line numbers ignored.  As such, it's "reasonably
stable", but at the same time also reasonably unique, ie two patches
that have the same "patch ID" are almost guaranteed to be the same
thing.

IOW, you can use this thing to look for likely duplicate commits.

19 years agoClean up git-diff-tree 'header' generation
Linus Torvalds [Thu, 23 Jun 2005 20:56:55 +0000 (13:56 -0700)]
Clean up git-diff-tree 'header' generation

19 years agogit-apply: take "--apply" flag to force an apply even if we also ask for a diffstat
Linus Torvalds [Thu, 23 Jun 2005 16:00:01 +0000 (09:00 -0700)]
git-apply: take "--apply" flag to force an apply even if we also ask for a diffstat

Also, remove debugging statement about applying a fragment at an offset.

19 years agoMake "git fetch" able to fetch a named tag
Linus Torvalds [Thu, 23 Jun 2005 15:59:00 +0000 (08:59 -0700)]
Make "git fetch" able to fetch a named tag

Use "git fetch <repo> tag <tagname>" to get the named tag and everything
it points to.

19 years ago[PATCH] Fix to how --merge-order handles multiple roots
Jon Seymour [Thu, 23 Jun 2005 02:01:12 +0000 (12:01 +1000)]
[PATCH] Fix to how --merge-order handles multiple roots

This patch addresses the problem reported by Paul Mackerras such that --merge-order
did not report the last root of a graph with merge of two independent roots.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] A test case that demonstrates a problem with merges with two roots.
Jon Seymour [Thu, 23 Jun 2005 02:01:09 +0000 (12:01 +1000)]
[PATCH] A test case that demonstrates a problem with merges with two roots.

git-rev-list --merge-order is omitting one of the roots when
displaying a merge containing two distinct roots.

A subsequent patch will fix the problem.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoDon't ignore reachability of tag objects in fsck
Linus Torvalds [Thu, 23 Jun 2005 02:06:34 +0000 (19:06 -0700)]
Don't ignore reachability of tag objects in fsck

We used to ignore unreachable tags, which just causes problems: it makes
"git prune" leave them around, but since we'll have prune everything
that tag points to, the tag object really should be removed too.

So remove the code that made us think tags were always reachable.

19 years agoAdd "git-clone-script" thingy
Linus Torvalds [Thu, 23 Jun 2005 01:49:43 +0000 (18:49 -0700)]
Add "git-clone-script" thingy

It's just a trivial wrapper, but it should make Jeff's kernel developer
guide to git look a bit less intimidating.

19 years ago[PATCH] Fix --merge-order unit test breaks introduced by 6c88be169881c9223532796bd225...
Jon Seymour [Tue, 21 Jun 2005 15:58:46 +0000 (01:58 +1000)]
[PATCH] Fix --merge-order unit test breaks introduced by 6c88be169881c9223532796bd225e79afaa115e1

The sensible cleanup of the in-memory storage order of commit parents broke the --merge-order
code which was dependent on the previous behaviour of parse_commit().

This patch restores the correctness --merge-order behaviour by taking account of the
new behaviour of parse_commit.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "gitk" to the list of scripts to be installed automatically.
Linus Torvalds [Wed, 22 Jun 2005 21:07:41 +0000 (14:07 -0700)]
Add "gitk" to the list of scripts to be installed automatically.

Btw, it's fun just looking at the merged git repository itself with
gitk, now that it has two "roots".

19 years agoDo a cross-project merge of Paul Mackerras' gitk visualizer
Linus Torvalds [Wed, 22 Jun 2005 21:05:02 +0000 (14:05 -0700)]
Do a cross-project merge of Paul Mackerras' gitk visualizer

gitk is really quite incredibly cool, and is great for visualizing what
is going on in a git repository.  It's especially useful when you are
looking at what has changed since a particular version, since it
gracefully handles partial trees (and this also avoids the expense of
looking at _all_ changes in a big project).

For example, to see what changed in a merge after a "git pull", do

gitk ORIG_HEAD..

to see only the new things.  Or you can simply do "gitk v2.6.12.." to
see what has changed since the v2.6.12 tag etc.

This merge itself is pretty interesting too, since it shows off a
feature of git itself that is incredibly cool: you can merge a
_separate_ git project into another git project.  Not only does this
keep all the history of the original project, it also makes it possible
to continue to merge with the original project and the union of the two
projects.

I don't think anybody else can do that.

19 years ago[PATCH] git-apply: tests for --stat and --summary.
Junio C Hamano [Wed, 22 Jun 2005 09:30:47 +0000 (02:30 -0700)]
[PATCH] git-apply: tests for --stat and --summary.

This adds tests (which also serves demonstration) for the --stat
and --summary flags to the git-apply command.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-apply: documentation.
Junio C Hamano [Wed, 22 Jun 2005 09:30:17 +0000 (02:30 -0700)]
[PATCH] git-apply: documentation.

Add missing documentation for git-apply.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-apply: implement --summary option.
Junio C Hamano [Wed, 22 Jun 2005 09:29:46 +0000 (02:29 -0700)]
[PATCH] git-apply: implement --summary option.

Typical expected usage is "git-apply --stat --summary" to show
diffstat plus dense description of information available in git
extended headers, such as creations, renames, and mode changes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-apply --stat: show new filename for rename/copy patch.
Junio C Hamano [Wed, 22 Jun 2005 09:29:16 +0000 (02:29 -0700)]
[PATCH] git-apply --stat: show new filename for rename/copy patch.

When a patch is a git extended rename/copy patch, "git-apply
--stat" showed the old filename.  Change it to show the new
filename, because most of the time we are interested in looking
at the resulting tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] local-pull: implement fetch_ref()
Junio C Hamano [Wed, 22 Jun 2005 08:52:06 +0000 (01:52 -0700)]
[PATCH] local-pull: implement fetch_ref()

This makes "-w ref" usable for git-local-pull.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoTry to assign colors so crossing lines have different colors
Paul Mackerras [Wed, 22 Jun 2005 09:53:32 +0000 (19:53 +1000)]
Try to assign colors so crossing lines have different colors

In particular try hard to give different colors to lines that cross
at a corner in one of the lines.

19 years agoAccount for indentation of the checkin comments by git-rev-list
Paul Mackerras [Wed, 22 Jun 2005 08:15:15 +0000 (18:15 +1000)]
Account for indentation of the checkin comments by git-rev-list

This involves adding indentation when we read a commit with
git-cat-file and trimming the whitespace from the headline.

19 years agogit-apply: create subdirectories leading up to a new file
Linus Torvalds [Wed, 22 Jun 2005 02:10:21 +0000 (19:10 -0700)]
git-apply: create subdirectories leading up to a new file

Applying Andrew's latest patch-bomb showed us failing miserably if a new
subdirectory needed to be created..  That said, it's uncommon enough
that it's worth optimistically assuming it won't be needed, and then
creating the subdirectories only on failure.

19 years ago[PATCH] Pull refs by HTTP
Daniel Barkalow [Wed, 22 Jun 2005 00:45:49 +0000 (20:45 -0400)]
[PATCH] Pull refs by HTTP

This adds support for refs to http-pull, both the -w option and reading
the target from a served file.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Pull misc objects
Daniel Barkalow [Wed, 22 Jun 2005 00:35:53 +0000 (20:35 -0400)]
[PATCH] Pull misc objects

Make pull fetch whatever is specified, parse it to figure out what it is, and
then process it appropriately. This also supports getting tag objects, and
getting whatever they tag.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Parse tags for absent objects
Daniel Barkalow [Wed, 22 Jun 2005 00:35:10 +0000 (20:35 -0400)]
[PATCH] Parse tags for absent objects

Handle parsing a tag for a non-present object. This adds a function to lookup
an object with lookup_* for * in a string, so that it can get the right storage
based on the "type" line in the tag.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoUse git-rev-list --header.
Paul Mackerras [Wed, 22 Jun 2005 00:25:38 +0000 (10:25 +1000)]
Use git-rev-list --header.

With --header, git-rev-list gives us the contents of the commit
in-line, so we don't need to exec a git-cat-file to get it, and we
don't need the readobj command either.
Also fixed a residual problem with handling the commit that
has a parent listed twice.

19 years agoFix typo in git-checkout-script.
Linus Torvalds [Wed, 22 Jun 2005 00:12:38 +0000 (17:12 -0700)]
Fix typo in git-checkout-script.

The confusion between "revs" vs "refs" caused us to not find the branch
name, which in turn meant that we never switched the HEAD over to it.

19 years agoRemove MERGE_HEAD in "git checkout/reset"
Linus Torvalds [Tue, 21 Jun 2005 22:40:00 +0000 (15:40 -0700)]
Remove MERGE_HEAD in "git checkout/reset"

Both of these scripts will end up resetting the index to some specific
head, and any unresolved merge will be forgotten.