Code

git.git
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 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 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.

19 years agoClean up different special *HEAD handling
Linus Torvalds [Tue, 21 Jun 2005 21:04:13 +0000 (14:04 -0700)]
Clean up different special *HEAD handling

We codify the following different heads (in addition to the main "HEAD",
which points to the current branch, of course):

 - FETCH_HEAD

   Populated by "git fetch"

 - ORIG_HEAD

   The old HEAD before a "git pull/resolve" (successful or not)

 - LAST_MERGE

   The HEAD we're currently merging in "git pull/resolve"

 - MERGE_HEAD

   The previous head of a unresolved "git pull", which gets committed by
   a "git commit" after manually resolving the result

We used to have "MERGE_HEAD" be populated directly by the fetch, and we
removed ORIG_HEAD and LAST_MERGE too aggressively.

19 years ago[PATCH] Fix several gcc4 signedness warnings
Mika Kukkonen [Tue, 21 Jun 2005 20:04:33 +0000 (23:04 +0300)]
[PATCH] Fix several gcc4 signedness warnings

Here is a patch that fixes several gcc4 warnings about different signedness,
all between char and unsigned char. I tried to keep the patch minimal
so resertod to casts in three places.

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit checkout: fix default head case
Linus Torvalds [Tue, 21 Jun 2005 18:14:47 +0000 (11:14 -0700)]
git checkout: fix default head case

The "${new=$old}" syntax only works for an undefined 'new', not for an
empty one. I knew that. Really. I'm not stupid.

19 years agoMake "git checkout" know about different branches
Linus Torvalds [Tue, 21 Jun 2005 18:03:11 +0000 (11:03 -0700)]
Make "git checkout" know about different branches

Now "git checkout xyzzy" will check out branch "xyzzy" and
switch the HEAD to it.

19 years ago"git checkout": add "-u" flag to update HEAD conditionally
Linus Torvalds [Tue, 21 Jun 2005 16:59:26 +0000 (09:59 -0700)]
"git checkout": add "-u" flag to update HEAD conditionally

And fix braino on testing "-f".

19 years agoAdd "git checkout" that does what the name suggests
Linus Torvalds [Tue, 21 Jun 2005 16:47:37 +0000 (09:47 -0700)]
Add "git checkout" that does what the name suggests

It is careful by default and refuses to overwrite old info, but if you
want to force everything to be re-read, use the "-f" flag.

Some day I'll make it take individual filenames too. Right now
it's all-or-nothing.

19 years ago[PATCH] fix scalability problems with git-deltafy-script
Nicolas Pitre [Tue, 21 Jun 2005 14:18:00 +0000 (10:18 -0400)]
[PATCH] fix scalability problems with git-deltafy-script

Current version would spin forever and exhaust memory while attempting
to sort all files from all revisions at once, until it dies before even
doing any real work.  This is especially noticeable when used on a big
repository like the imported bkcvs repo for the Linux kernel.

This patch allows for batching the sort to put a bound on needed
resources and making progress early, as well as including some small
cleanups.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] git-apply: Don't barf when --stat'ing a diff with no line changes.
Sven Verdoolaege [Tue, 21 Jun 2005 15:14:30 +0000 (17:14 +0200)]
[PATCH] git-apply: Don't barf when --stat'ing a diff with no line changes.

Diffs with only mode changes didn't pass through git-apply --stat.

[ Linus' note: they did for me, on my ppc64, where division by zero just
  silently returns zero.  Duh.  ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoLet "git commit" take arguments for files to commit.
Linus Torvalds [Tue, 21 Jun 2005 04:20:41 +0000 (21:20 -0700)]
Let "git commit" take arguments for files to commit.

It does a "git-update-cache" on the arguments, meaning that you can
commit files without doing a separate "git-update-cache".  This commit
was done with

git commit git-commit-script

for example.

19 years agoAdd "-q" flag to git-update-cache
Linus Torvalds [Tue, 21 Jun 2005 04:18:54 +0000 (21:18 -0700)]
Add "-q" flag to git-update-cache

It suppresses the "needs update" message for subsequent "--refresh"
cases (but not other errors).

Will be useful for "git commit". Stay tuned.

19 years agoChange parent syntax to "xyz^" instead of "xyz.p"
Linus Torvalds [Tue, 21 Jun 2005 04:06:47 +0000 (21:06 -0700)]
Change parent syntax to "xyz^" instead of "xyz.p"

The ".pN" thing might be a common ending of a tag, and in
contrast, ^ already is a special character for revisions
so use that instead.

19 years agoMake rev-parse understand "extended sha1" syntax
Linus Torvalds [Tue, 21 Jun 2005 03:28:09 +0000 (20:28 -0700)]
Make rev-parse understand "extended sha1" syntax

You can say "HEAD.p" for the "parent of HEAD". It nests, so

HEAD.p2.p

means parent of second parent of HEAD (which obviously depends
on HEAD being a merge).

19 years agoKeep the parents in order when parsing commits
Linus Torvalds [Tue, 21 Jun 2005 03:26:03 +0000 (20:26 -0700)]
Keep the parents in order when parsing commits

We used to keep the parents in reverse order in the commit_list.  Most
users don't care, but it's wrong, and the next commit does care.

19 years agoPass arguments through git-rev-parse.
Paul Mackerras [Tue, 21 Jun 2005 00:20:04 +0000 (10:20 +1000)]
Pass arguments through git-rev-parse.

This allows the user to specify ranges more flexibly; for instance
the user can now do "gitk v2.6.12.." and see all the changes since
2.6.12.

19 years agoHandle the case of a parent being listed twice in a merge.
Paul Mackerras [Tue, 21 Jun 2005 00:01:38 +0000 (10:01 +1000)]
Handle the case of a parent being listed twice in a merge.

This happens in the linux-2.6 tree.  We draw the graph line
double-thick to show that this happened.

Also fix a bug where we got a bogus "No commit information available"
line at the end on simple repositories like this one.

19 years agogit-rev-parse: flush "default" head when encountering something unexpected
Linus Torvalds [Mon, 20 Jun 2005 23:14:13 +0000 (16:14 -0700)]
git-rev-parse: flush "default" head when encountering something unexpected

The unexpected thing is likely a pathname, we need the default for that
too.

19 years ago[PATCH] git-resolve-script: Add LAST_MERGE and use git-rev-parse
Dan Holmsand [Mon, 20 Jun 2005 18:52:38 +0000 (20:52 +0200)]
[PATCH] git-resolve-script: Add LAST_MERGE and use git-rev-parse

Make git-resolve-script only write MERGE_HEAD if a merge actually
occurred. All merge failures leave ORIG_HEAD and LAST_MERGE
behind (instead of ORIG_HEAD and MERGE_HEAD).

Use git-rev-parse to expand arguments (and check for bad ones).

Signed-off-by: Dan Holmsand <holmsand@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-rev-parse: parse ".." before simple SHA1's
Linus Torvalds [Mon, 20 Jun 2005 15:29:13 +0000 (08:29 -0700)]
git-rev-parse: parse ".." before simple SHA1's

This fixes "<hexsha1>..*", since get_sha1() will happily ignore any
garbage at the end and thus we never got to the ".." check before.

19 years agoAvoid gcc warning in diff-stages.c
Linus Torvalds [Mon, 20 Jun 2005 03:15:22 +0000 (20:15 -0700)]
Avoid gcc warning in diff-stages.c

Put explicit parentheses around && in ||-expression.

19 years ago[PATCH] Fix for --merge-order, --max-age interaction issue
Jon Seymour [Mon, 20 Jun 2005 02:29:41 +0000 (12:29 +1000)]
[PATCH] Fix for --merge-order, --max-age interaction issue

This patch fixes a problem reported by Paul Mackerras regarding the interaction
of the --merge-order and --max-age switches of git-rev-list.

This patch applies to the current Linus HEAD. A cleaner fix for the same problem
in my current HEAD will follow later.

With this change, --merge-order produces the same result as no --merge-order
on the linux-2.6 git repository, to wit:

$> git-rev-list --max-age=1116330140 bcfff0b471a60df350338bcd727fc9b8a6aa54b2 | wc -l
655
$> git-rev-list --merge-order --max-age=1116330140 bcfff0b471a60df350338bcd727fc9b8a6aa54b2 | wc -l
655

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Prevent git-rev-list without --merge-order producing duplicates in output
Jon Seymour [Mon, 20 Jun 2005 02:29:38 +0000 (12:29 +1000)]
[PATCH] Prevent git-rev-list without --merge-order producing duplicates in output

If b is reachable from a, then:

 git-rev-list a b

argument would print one of the commits twice.

This patch fixes that problem. A previous problem fixed it for the
--merge-order switch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Prevent git-rev-list --merge-order producing duplicates in the output
Jon Seymour [Mon, 20 Jun 2005 02:29:36 +0000 (12:29 +1000)]
[PATCH] Prevent git-rev-list --merge-order producing duplicates in the output

If a is reachable from b, then git-rev-list --merge-order b a would
produce a duplicate output of b.

This causes a problem for an upcoming version of gitk since it
breaks the --merge-order ordering invariant.

This patch fixes the problem for the --merge-order switch. A subsequent
patch will fix the problem for the non --merge-order switch.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Relaxes error checking in epoch.c to allow duplicate parents
Jon Seymour [Mon, 20 Jun 2005 02:29:33 +0000 (12:29 +1000)]
[PATCH] Relaxes error checking in epoch.c to allow duplicate parents

Given that real trees in the wild include parents with duplicate parents, I have relaxed
over-zealous error checking in epoch.c and dealt with the problem a different way - duplicate
parents are now silently ignored.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fixes problem with --merge-order head ^head
Jon Seymour [Mon, 20 Jun 2005 02:29:31 +0000 (12:29 +1000)]
[PATCH] Fixes problem with --merge-order head ^head

git-rev-list --merge-order HEAD ^HEAD was faulting rather than generating an empty output.

This patch fixes that problem.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Tweaked --merge-order --show-breaks output in case specified head has no...
Jon Seymour [Mon, 20 Jun 2005 02:29:29 +0000 (12:29 +1000)]
[PATCH] Tweaked --merge-order --show-breaks output in case specified head has no parent

      git-rev-list --merge-order --show-breaks root

Was outputing:

| root

It now outputs:

= root

Which is consistent with the behaviour of other cases.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Additional git-rev-list unit tests to demonstrate problems that require fixes
Jon Seymour [Mon, 20 Jun 2005 02:29:26 +0000 (12:29 +1000)]
[PATCH] Additional git-rev-list unit tests to demonstrate problems that require fixes

1. --merge-order doesn't deal properly with a specified head that has no parent

   * FAIL 11: head has no parent

2. --merge-order doesn't deal properly with arguments of the form
     head ^head

   * FAIL 30: head ^head --merge-order git-rev-list --merge-order
     --show-breaks a3 ^a3

3. if one of the specified heads is reachable from the other, the
   head gets printed twice and this causes problems for upcoming
   versions of gitk. This is true for both --merge-order and non
   --merge-order style of invocations.
    * FAIL 24: one specified head reachable from another a4, c3, --merge-order
    * FAIL 26: one specified head reachable from another a4, c3, no --merge-order
    * FAIL 27: one specified head reachable from another c3, a4, no --merge-order

4. --merge-order aborts with commits that list the same parent twice...it should handle it more gracefully.
    * no longer unit testable

5. broken interaction between --merge-order and --max-age
   previously posted as:

    "[PATCH 1/2] Test case that demonstrates problem with --merge-order, --max-age interaction"
    * FAIL 23: --max-age=c3, --merge-order

Later patches in this patch set fix these problems.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Rework -B output.
Junio C Hamano [Sun, 19 Jun 2005 20:17:50 +0000 (13:17 -0700)]
[PATCH] Rework -B output.

Patch for a completely rewritten file detected by the -B flag
was shown as a pair of creation followed by deletion in earlier
versions.  This was an misguided attempt to make reviewing such
a complete rewrite easier, and unnecessarily ended up confusing
git-apply.  Instead, show the entire contents of old version
prefixed with '-', followed by the entire contents of new
version prefixed with '+'.  This gives the same easy-to-review
for human consumer while keeping it a single, regular
modification patch for machine consumption, something that even
GNU patch can grok.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Update diff documentation.
Junio C Hamano [Sun, 19 Jun 2005 20:14:53 +0000 (13:14 -0700)]
[PATCH] Update diff documentation.

This updates diff documentation to discuss --find-copies-harder,
and adds descriptions for options that were not described
earlier.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Make -C less eager.
Junio C Hamano [Sun, 19 Jun 2005 20:14:05 +0000 (13:14 -0700)]
[PATCH] Make -C less eager.

Like diff-tree, this patch makes -C option for diff-* brothers
to use only pre-image of modified files as rename/copy detection
by default.  Give --find-copies-harder to use unmodified files
to find copies from as well.

This also fixes "diff-files -C" problem earlier noticed by
Linus.  It was feeding the null sha1 even when the file in the
work tree was known to match what is in the index file.  This
resulted in diff-files showing everything in the project.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMake "git commit" clean up after itself
Linus Torvalds [Mon, 20 Jun 2005 02:57:01 +0000 (19:57 -0700)]
Make "git commit" clean up after itself

Noted by Jeff.

19 years agoClean up MERGE_HEAD and ORIG_HEAD also for the trivial fast-forward merges.
Linus Torvalds [Mon, 20 Jun 2005 02:42:21 +0000 (19:42 -0700)]
Clean up MERGE_HEAD and ORIG_HEAD also for the trivial fast-forward merges.

Otherwise you'll be bitten by a stale MERGE_HEAD like Jeff was..

19 years ago[PATCH] cvs2git.c: support incremental conversion
Panagiotis Issaris [Fri, 17 Jun 2005 16:26:57 +0000 (18:26 +0200)]
[PATCH] cvs2git.c: support incremental conversion

Add -u option to indicate incremental conversion.

I wanted to be able to track CVS repositories in a GIT repository.  The
cvs2git program worked fine with the initial import but needed a tiny
modification to enable me to resync the GIT repository with the updated
CVS tree.

[ The original version of this patch failed to track the correct
  branch on the first new commit. Fixed and tested by Sven. ]

Signed-off-by: Panagiotis Issaris <takis@lumumba.luc.ac.be>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] ssh-push.c: Fix handling of ssh://host/path URLs
Sven Verdoolaege [Fri, 17 Jun 2005 08:13:18 +0000 (10:13 +0200)]
[PATCH] ssh-push.c: Fix handling of ssh://host/path URLs

Previous patch to fix host:path notation broke
handling of ssh://host/path notation.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-commit-tree: ignore duplicate parents
Linus Torvalds [Sun, 19 Jun 2005 17:40:10 +0000 (10:40 -0700)]
git-commit-tree: ignore duplicate parents

But warn about them.  If somebody really ends up later wanting to
explicitly add a note that something has the same parent twice (who
knows, there are strange people around), we can add a flag to say that
it's expected and ok.

This was brought on by a commit in the kernel tree, where a repeated
merge caused a duplicate parent.

Parent duplicates aren't "wrong" per se, they're just in practice not
something you are ever interested in.

19 years agoFix up INSTALL and "git add"
Linus Torvalds [Sun, 19 Jun 2005 06:44:54 +0000 (23:44 -0700)]
Fix up INSTALL and "git add"

As suggested by Junio

19 years agoread-cache.c: remove stray debugging printf
Linus Torvalds [Sun, 19 Jun 2005 06:34:12 +0000 (23:34 -0700)]
read-cache.c: remove stray debugging printf

Pointed out by Junio, part of my debugging of the rewrite of the
file/dir conflict handling.

19 years agoRe-implement "check_file_directory_conflict()"
Linus Torvalds [Sun, 19 Jun 2005 03:21:34 +0000 (20:21 -0700)]
Re-implement "check_file_directory_conflict()"

This is (imho) more readable, and is also a lot faster.  The expense of
looking up sub-directory beginnings was killing us on things like
"git-diff-cache", even though that one didn't even care at all about the
file vs directory conflicts.

We really only care when somebody tries to add a conflicting name to
stage 0.

We should go through the conflict rules more carefully some day.

19 years agoAvoid warning about function without return.
Linus Torvalds [Sun, 19 Jun 2005 03:02:49 +0000 (20:02 -0700)]
Avoid warning about function without return.

Strangely, this warning only shows up when not compiling with "-O2",
which is why I didn't see it originally.

19 years ago[PATCH] cvs2git and file permissions
Sven Verdoolaege [Sat, 18 Jun 2005 22:31:15 +0000 (00:31 +0200)]
[PATCH] cvs2git and file permissions

git-cvs2git: propagate mode information

Let cvs checkout in a temporary directory rather than
using the pipe option to avoid loss of mode information.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMake "pretty" commit logs always show merge information
Linus Torvalds [Sat, 18 Jun 2005 20:52:05 +0000 (13:52 -0700)]
Make "pretty" commit logs always show merge information

Otherwise the "git log" information doesn't tell enough to make sense of
a merge.

I'll need to add some parent information for regular entries too, I
think, but the merge is more important.

19 years agogit-rev-list: add "--bisect" flag to find the "halfway" point
Linus Torvalds [Sat, 18 Jun 2005 05:54:50 +0000 (22:54 -0700)]
git-rev-list: add "--bisect" flag to find the "halfway" point

This is useful for doing binary searching for problems.  You start with
a known good and known bad point, and you then test the "halfway" point
in between:

git-rev-list --bisect bad ^good

and you test that.  If that one tests good, you now still have a known
bad case, but two known good points, and you can bisect again:

git-rev-list --bisect bad ^good1 ^good2

and test that point.  If that point is bad, you now use that as your
known-bad starting point:

git-rev-list --bisect newbad ^good1 ^good2

and basically at every iteration you shrink your list of commits by
half: you're binary searching for the point where the troubles started,
even though there isn't a nice linear ordering.

19 years agoUse "-M" instead of "-C" for "git diff" and "git status"
Linus Torvalds [Fri, 17 Jun 2005 22:34:19 +0000 (15:34 -0700)]
Use "-M" instead of "-C" for "git diff" and "git status"

The "C" in "-C" may stand for "Cool", but it's also pretty slow, since
right now it leaves all unmodified files to be tested even if there are
no new files at all.  That just ends up being unacceptably slow for big
projects, especially if it's not all in the cache.

19 years agogit-apply: use default name for mode change patches
Linus Torvalds [Fri, 17 Jun 2005 22:23:40 +0000 (15:23 -0700)]
git-apply: use default name for mode change patches

Pure mode changes won't have the file-name in the extended header lines,
so make sure we pick it up from the default name from the "diff --git"
line.

19 years agoDon't use -C in "git diff"
Linus Torvalds [Fri, 17 Jun 2005 19:46:38 +0000 (12:46 -0700)]
Don't use -C in "git diff"

Right now it confuses at least git-diff-files, since it leaves
all the files (whether changed or not) in the diff queue.

19 years agoAdd some installation notes in INSTALL
Linus Torvalds [Fri, 17 Jun 2005 18:30:04 +0000 (11:30 -0700)]
Add some installation notes in INSTALL

Jens was the second person who hadn't heard of the "merge" program, and
didn't have it installed.  So document as many dependency and install
issues as I can think of.

19 years agoDraw graph lines as one continuous line where possible
Paul Mackerras [Fri, 17 Jun 2005 00:12:26 +0000 (00:12 +0000)]
Draw graph lines as one continuous line where possible
Added context menu on lines
Added headline display when the mouse hovers over a line
Removed some debug messages

19 years agoFix operation without libreadobj.so.0.0
Paul Mackerras [Thu, 16 Jun 2005 10:54:04 +0000 (10:54 +0000)]
Fix operation without libreadobj.so.0.0
Display a watch cursor when reading the commits initially

19 years agoRestructure to do incremental drawing
Paul Mackerras [Thu, 16 Jun 2005 00:27:23 +0000 (00:27 +0000)]
Restructure to do incremental drawing
Some speedups from not doing update so often

19 years agogit-read-tree: fix "--reset" handling
Linus Torvalds [Wed, 15 Jun 2005 17:25:46 +0000 (10:25 -0700)]
git-read-tree: fix "--reset" handling

19 years agoUpdate tutorial a bit for scripted helpers.
Linus Torvalds [Wed, 15 Jun 2005 02:00:00 +0000 (19:00 -0700)]
Update tutorial a bit for scripted helpers.

19 years agoTrivial git script fixups
Linus Torvalds [Wed, 15 Jun 2005 01:56:05 +0000 (18:56 -0700)]
Trivial git script fixups

Fix permissions, and add trivial "reset" and "add" scripts.

The "reset" script just resets the index back to head, while the "add"
script is just a crutch for people used to do "cvs add".

19 years ago[PATCH] ssh-push: Don't add '/' to pathname
Sven Verdoolaege [Tue, 14 Jun 2005 10:37:38 +0000 (12:37 +0200)]
[PATCH] ssh-push: Don't add '/' to pathname

Paths in the host:path notation are usually interpreted
relative to the login directory rather than relative to
the root directory.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Unset TZ in t5000
Mark Allen [Tue, 14 Jun 2005 17:09:39 +0000 (10:09 -0700)]
[PATCH] Unset TZ in t5000

Unset TZ to force GMT in test #4 and add a set of parens around
the length function in the awk script.

Signed-off-by: Mark Allen <mrallen1@yahoo.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMake 'git' script be a bit more helpful on unrecognized commands
Linus Torvalds [Tue, 14 Jun 2005 18:01:49 +0000 (11:01 -0700)]
Make 'git' script be a bit more helpful on unrecognized commands

19 years agoMake "git commit" handle initial commits too
Linus Torvalds [Tue, 14 Jun 2005 17:20:14 +0000 (10:20 -0700)]
Make "git commit" handle initial commits too

No need to confuse ex-CVS users with a complex initial commit sequence.