Commit graph

550 commits

Author SHA1 Message Date
Junio C Hamano 77882f60d9 Retire diffcore-pathspec.
Nobody except diff-stages used it -- the callers instead filtered
the input to diffcore themselves.  Make diff-stages do that as
well and retire diffcore-pathspec.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 15:57:24 -07:00
Junio C Hamano 5f1c3f07b7 log-tree: separate major part of diff-tree.
This separates out the part that deals with one-commit diff-tree
(and --stdin form) into a separate log-tree module.

There are two goals with this.  The more important one is to be
able to make this part available to "git log --diff", so that we
can have a native "git whatchanged" command.  Another is to
simplify the commit log generation part simpler.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-09 01:35:13 -07:00
Junio C Hamano 806d097e6b Merge branch 'nh/http' into next
* nh/http:
  Fix compile with expat, but an old curl version
2006-04-05 14:25:57 -07:00
Johannes Schindelin 459a21bd35 Fix compile with expat, but an old curl version
With an old curl version, git-http-push is not compiled. But git-http-fetch
still needs to be linked with expat if NO_EXPAT is not defined.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 12:49:56 -07:00
Junio C Hamano b4196cf70a Merge branches 'master' and 'jc/combine' into next
* master:
  Add git-clean command
  diff_flush(): leakfix.
  parse_date(): fix parsing 03/10/2006

* jc/combine:
  combine-diff: refactor built-in xdiff interface.
2006-04-05 02:58:14 -07:00
Pavel Roskin c3b831bd84 Add git-clean command
This command removes untracked files from the working tree.  This
implementation is based on cg-clean with some simplifications.  The
documentation is included.

[jc: with trivial documentation fix, noticed by Jakub Narebski]

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 02:51:27 -07:00
Junio C Hamano d9ea73e056 combine-diff: refactor built-in xdiff interface.
This refactors the line-by-line callback mechanism used in
combine-diff so that other programs can reuse it more easily.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-05 02:09:58 -07:00
Nick Hengeveld 8d9fbe57b3 http-fetch: add optional DAV-based pack list
If git is not built with NO_EXPAT, this patch changes git-http-fetch to
attempt using DAV to get a list of remote packs and fall back to using
objects/info/packs if the DAV request fails.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 18:06:35 -07:00
Nick Hengeveld 20fc9bc5e4 Set HTTP user agent to git/GIT_VERSION
Useful for diagnostics/troubleshooting to know which client versions are
hitting your server.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 14:42:47 -07:00
Junio C Hamano 8eef8e09ce Makefile: many programs now depend on xdiff/lib.a having been built.
The dependency was not properly updated when we added this
library, breaking parallel build with $(MAKE) -j.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-31 16:23:46 -08:00
Junio C Hamano 1b0c7174a1 tree/diff header cleanup.
Introduce tree-walk.[ch] and move "struct tree_desc" and
associated functions from various places.

Rename DIFF_FILE_CANON_MODE(mode) macro to canon_mode(mode) and
move it to cache.h.  This macro returns the canonicalized
st_mode value in the host byte order for files, symlinks and
directories -- to be compared with a tree_desc entry.
create_ce_mode(mode) in cache.h is similar but is intended to be
used for index entries (so it does not work for directories) and
returns the value in the network byte order.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-29 23:54:13 -08:00
Jason Riedy 9c48666aa0 Add ALL_LDFLAGS to the git target.
For some reason, I need ALL_LDFLAGS in the git target only on
AIX.  Once it builds, only one test "fails" on AIX 5.1 with
1.3.0.rc1, t5500-fetch-pack.sh, but it looks like it's some
odd tool problem in the tester + my setup and not a real bug.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-27 17:55:20 -08:00
Junio C Hamano ac93bfc3b6 Merge branch 'lt/diffgen' into next
* lt/diffgen:
  add clean and ignore rules for xdiff/
  Remove dependency on a file named "-lz"
2006-03-26 23:44:28 -08:00
Junio C Hamano 3467fec516 add clean and ignore rules for xdiff/
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-26 23:41:22 -08:00
Johannes Schindelin 54c261f90f Remove dependency on a file named "-lz"
By changing the dependency "$(LIB_H)" to "$(LIBS)", at least one version
of make thought that a file named "-lz" would be needed.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-26 19:07:08 -08:00
Junio C Hamano 9acf322d69 Merge branch 'lt/diffgen' into next
* lt/diffgen:
  built-in diff: minimum tweaks
  builtin-diff: \No newline at end of file.
  Use a *real* built-in diff generator
2006-03-25 17:44:01 -08:00
Linus Torvalds 3443546f6e Use a *real* built-in diff generator
This uses a simplified libxdiff setup to generate unified diffs _without_
doing  fork/execve of GNU "diff".

This has several huge advantages, for example:

Before:

	[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null

	real    0m24.818s
	user    0m13.332s
	sys     0m8.664s

After:

	[torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null

	real    0m4.563s
	user    0m2.944s
	sys     0m1.580s

and the fact that this should be a lot more portable (ie we can ignore all
the issues with doing fork/execve under Windows).

Perhaps even more importantly, this allows us to do diffs without actually
ever writing out the git file contents to a temporary file (and without
any of the shell quoting issues on filenames etc etc).

NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the
current "diff-core" code actually will always write the temp-files,
because it used to be something that you simply had to do. So this current
one actually writes a temp-file like before, and then reads it into memory
again just to do the diff. Stupid.

But if this basic infrastructure is accepted, we can start switching over
diff-core to not write temp-files, which should speed things up even
further, especially when doing big tree-to-tree diffs.

Now, in the interest of full disclosure, I should also point out a few
downsides:

 - the libxdiff algorithm is different, and I bet GNU diff has gotten a
   lot more testing. And the thing is, generating a diff is not an exact
   science - you can get two different diffs (and you will), and they can
   both be perfectly valid. So it's not possible to "validate" the
   libxdiff output by just comparing it against GNU diff.

 - GNU diff does some nice eye-candy, like trying to figure out what the
   last function was, and adding that information to the "@@ .." line.
   libxdiff doesn't do that.

 - The libxdiff thing has some known deficiencies. In particular, it gets
   the "\No newline at end of file" case wrong. So this is currently for
   the experimental branch only. I hope Davide will help fix it.

That said, I think the huge performance advantage, and the fact that it
integrates better is definitely worth it. But it should go into a
development branch at least due to the missing newline issue.

Technical note: this is based on libxdiff-0.17, but I did some surgery to
get rid of the extraneous fat - stuff that git doesn't need, and seriously
cutting down on mmfile_t, which had much more capabilities than the diff
algorithm either needed or used. In this version, "mmfile_t" is just a
trivial <pointer,length> tuple.

That said, I tried to keep the differences to simple removals, so that you
can do a diff between this and the libxdiff origin, and you'll basically
see just things getting deleted. Even the mmfile_t simplifications are
left in a state where the diffs should be readable.

Apologies to Davide, whom I'd love to get feedback on this all from (I
wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old
complex format had a helper function for that, but I did my surgery with
the goal in mind that eventually we _should_ just do

	mmfile_t mf;

	buf = read_sha1_file(sha1, type, &size);
	mf->ptr = buf;
	mf->size = size;
	.. use "mf" directly ..

which was really a nightmare with the old "helpful" mmfile_t, and really
is that easy with the new cut-down interfaces).

[ Btw, as any hawk-eye can see from the diff, this was actually generated
  with itself, so it is "self-hosting". That's about all the testing it
  has gotten, along with the above kernel diff, which eye-balls correctly,
  but shows the newline issue when you double-check it with "git-apply" ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 16:49:58 -08:00
Junio C Hamano b7986ce884 Merge branch 'master' into next
* master:
  Makefile: Add TAGS and tags targets
  ls-files: Don't require exclude files to end with a newline.
2006-03-18 14:58:20 -08:00
Fredrik Kuivinen f81e7c626f Makefile: Add TAGS and tags targets
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-18 14:01:46 -08:00
Junio C Hamano c301a0d2cf Merge branch 'fk/blame' into next
* fk/blame:
  blame: Rename detection (take 2)
  rev-lib: Make it easy to do rename tracking (take 2)
  Make it possible to not clobber object.util in sort_in_topological_order (take 2)
  Add git-imap-send, derived from isync 1.0.1.
  repack: prune loose objects when -d is given
  try_to_simplify_commit(): do not skip inspecting tree change at boundary.
  Fix t1200 test for breakage caused by removal of full-stop at the end of fast-forward message.
  Describe how to add extra mail header lines in mail generated by git-format-patch.
  Document the --attach flag.
  allow double click on current HEAD id after git-pull
2006-03-10 22:32:59 -08:00
Mike McCormack f2561fda36 Add git-imap-send, derived from isync 1.0.1.
git-imap-send drops a patch series generated by git-format-patch into an
IMAP folder. This allows patch submitters to send patches through their
own mail program.

git-imap-send uses the following values from the GIT repository
configuration:

The target IMAP folder:

[imap]
         Folder = "INBOX.Drafts"

A command to open an ssh tunnel to the imap mail server.

[imap]
         Tunnel = "ssh -q user@imap.server.com /usr/bin/imapd ./Maildir
2> /dev/null"

[imap]
         Host = imap.server.com
         User = bob
         Password = pwd
         Port = 143
2006-03-10 22:09:24 -08:00
Junio C Hamano b8cfe290a8 Merge branch 'jc/fsck' into next
* jc/fsck:
  fsck-objects: Remove --standalone
  refs.c::do_for_each_ref(): Finish error message lines with "\n"
  Nicer output from 'git'
  Use #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
  Remove trailing dot after short description
  Fix some inconsistencies in the docs
  contrib/git-svn: fix a harmless warning on rebuild (with old repos)
  contrib/git-svn: remove the --no-stop-on-copy flag
  contrib/git-svn: fix svn compat and fetch args
  Don't recurse into parents marked uninteresting.
  diff-delta: bound hash list length to avoid O(m*n) behavior
  test-delta needs zlib to compile
  git-fmt-merge-msg cleanup
2006-03-09 13:10:50 -08:00
Fredrik Kuivinen a87cd02ce0 Nicer output from 'git'
[jc: with suggestions by Jan-Benedict Glaw]

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 12:03:14 -08:00
Nicolas Pitre 3d99a7f4fa test-delta needs zlib to compile
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 01:35:07 -08:00
Junio C Hamano 2acc35b087 Merge branch 'master' into next
* master:
  repo-config: give value_ a sane default so regexec won't segfault
  Update http-push functionality
  cvsimport: Remove master-updating code
2006-03-07 17:07:40 -08:00
Nick Hengeveld aa1dbc9897 Update http-push functionality
This brings http-push functionality more in line with the ssh/git version,
by borrowing bits from send-pack and rev-list to process refspecs and
revision history in more standard ways.  Also, the status of remote objects
is determined using PROPFIND requests for the object directory rather than
HEAD requests for each object - while it may be less efficient for small
numbers of objects, this approach is able to get the status of all remote
loose objects in a maximum of 256 requests.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-07 17:03:21 -08:00
Junio C Hamano a0fb95e319 blame: avoid -lm by not using log().
... as suggested on the list.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 16:02:44 -08:00
Fredrik Kuivinen ea4c7f9bf6 git-blame: Make the output human readable
The default output mode is slightly different from git-annotate's.
However, git-annotate's output mode can be obtained by using the
'-c' flag.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 14:49:58 -08:00
Junio C Hamano f5948cfe67 count-delta: no need for this anymore.
This is a companion patch to e29e1147e4
which made diffcore similarity estimator independent from the packfile
deltifier.  There is no reason for us to be counting the xdelta anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:26:36 -08:00
Junio C Hamano f2fea68a0f Merge branch 'fk/blame'
* fk/blame:
  git-blame, take 2
  Merge part of 'lt/rev-list' into 'fk/blame'
  Add git-blame, a tool for assigning blame.
2006-03-04 13:22:01 -08:00
Junio C Hamano 21dbe12c76 Merge branch 'lt/rev-list'
* lt/rev-list:
  setup_revisions(): handle -n<n> and -<n> internally.
  git-log (internal): more options.
  git-log (internal): add approxidate.
  Rip out merge-order and make "git log <paths>..." work again.
  Tie it all together: "git log"
  Introduce trivial new pager.c helper infrastructure
  git-rev-list libification: rev-list walking
  Splitting rev-list into revisions lib, end of beginning.
  rev-list split: minimum fixup.
  First cut at libifying revlist generation
2006-03-04 13:21:17 -08:00
Junio C Hamano c40610422e Merge part of 'lt/rev-list' into 'fk/blame'
Now blame will depend on the new revision walker infrastructure,
we need to make it depend on earlier parts of Linus' rev-list
topic branch, hence this merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 15:10:05 -08:00
Linus Torvalds 765ac8ec46 Rip out merge-order and make "git log <paths>..." work again.
Well, assuming breaking --merge-order is fine, here's a patch (on top of
the other ones) that makes

	git log <filename>

actually work, as far as I can tell.

I didn't add the logic for --before/--after flags, but that should be
pretty trivial, and is independent of this anyway.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 01:45:50 -08:00
Junio C Hamano 65416758cd diffcore-rename: split out the delta counting code.
This is to rework diffcore break/rename/copy detection code
so that it does not affected when deltifier code gets improved.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 20:20:04 -08:00
Linus Torvalds 70b006b971 Tie it all together: "git log"
This is what the previous diffs all built up to.

We can do "git log" as a trivial small helper function inside git.c,
because the infrastructure is all there for us to use as a library.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 14:49:34 -08:00
Linus Torvalds f67b45f862 Introduce trivial new pager.c helper infrastructure
This introduces the new function

	void setup_pager(void);

to set up output to be written through a pager applocation.

All in preparation for doing the simple scripts in C.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 14:49:32 -08:00
Shawn Pearce e3601e8bb7 Darwin: Ignore missing /sw/lib
When on Darwin platforms don't include Fink or DarwinPorts
into the link path unless the related library directory
is actually present.  The linker on MacOS 10.4 complains
if it is given a directory which does not exist.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 11:02:13 -08:00
Linus Torvalds ae563542bf First cut at libifying revlist generation
This really just splits things up partially, and creates the
interface to set things up by parsing the command line.

No real code changes so far, although the parsing of filenames is a bit
stricter. In particular, if there is a "--", then we do not accept any
filenames before it, and if there isn't any "--", then we check that _all_
paths listed are valid, not just the first one.

The new argument parsing automatically also gives us "--default" and
"--not" handling as in git-rev-parse.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:33:27 -08:00
Junio C Hamano 43f72af1bc Build and install git-mailinfo.
The merge 712b1dd389 was done
incorrectly, and lost this program from Makefile.

Big thanks go to Tony Luck for noticing it, and Linus for
diagnosing it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 16:16:10 -08:00
Junio C Hamano 98214e96be Merge branch 'ml/cvs'
* ml/cvs:
  Introducing git-cvsserver -- a CVS emulator for git.
2006-02-22 19:20:55 -08:00
Junio C Hamano ab8c9fe256 Merge branch 'ra/anno'
* ra/anno:
  Use Ryan's git-annotate instead of jsannotate
  Add git-annotate, a tool for assigning blame.
2006-02-22 19:20:08 -08:00
Carl Worth d4a1cab541 Add new git-rm command with documentation
This adds a git-rm command which provides convenience similar to
git-add, (and a bit more since it takes care of the rm as well if
given -f).

Like git-add, git-rm expands the given path names through
git-ls-files. This means it only acts on files listed in the
index. And it does act recursively on directories by default, (no -r
needed as in the case of rm itself). When it recurses, it does not
remove empty directories that are left behind.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-22 17:10:42 -08:00
Martin Langhoff 3fda8c4cc7 Introducing git-cvsserver -- a CVS emulator for git.
git-cvsserver is highly functional. However, not all methods are implemented,
and for those methods that are implemented, not all switches are implemented.
All the common read operations are implemented, and add/remove/commit are
supported.

Testing has been done using both the CLI CVS client, and the Eclipse CVS
plugin. Most functionality works fine with both of these clients.

Currently git-cvsserver only works over SSH connections, see the
Documentation for more details on how to configure your client. It
does not support pserver for anonymous access but it should not be
hard to implement. Anonymous access will need tighter input validation.

In our very informal tests, it seems to be significantly faster than a real
CVS server.

This utility depends on a version of git-cvsannotate that supports -S and on
DBD::SQLite.

Licensed under GPLv2. Copyright The Open University UK.

Authors: Martyn Smith <martyn@catalyst.net.nz>
         Martin Langhoff <martin@catalyst.net.nz>

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-22 02:17:07 -08:00
Junio C Hamano 712b1dd389 Merge branch 'js/portable'
* js/portable:
  Fix "gmake -j"
  Really honour NO_PYTHON
  avoid makefile override warning
  Fixes for ancient versions of GNU make
2006-02-21 22:28:40 -08:00
Johannes Schindelin b992933853 Fix "gmake -j"
In my attempt to port git to IRIX, I broke it. Sorry.

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 16:48:10 -08:00
Paul Jakma e15f545155 Makefile tweaks: Solaris 9+ dont need iconv / move up uname variables
- Solaris 9 and up do not need -liconv, so NEEDS_LIBICONV should be set
   only for S8.
- Move the declaration of the uname variables to early in the Makefile
   so they can be referenced by prefix and gitexecdir variables.
- gitexecdir defaults to being same as bindir, it might as well reference
   that variable.

[jc: corrupt patch, sneakily tried to remove inclusion of GIT-VERSION-FILE
 I do not know why I am applying this...]

Signed-off-by: Paul Jakma <paul@quagga.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 00:55:00 -08:00
Fredrik Kuivinen cbfb73d73f Add git-blame, a tool for assigning blame.
I have also been working on a blame program. The algorithm is pretty
much the one described by Junio in his blame.perl. My variant doesn't
handle renames, but it shouldn't be too hard to add that. The output
is minimal, just the line number followed by the commit SHA1.

An interesting observation is that the output from my git-blame and
your git-annotate doesn't match on all files in the git
repository. One example where several lines differ is read-cache.c. I
haven't investigated it further to find out which one is correct.

The code should be considered as a work in progress. It certainly has
a couple of rough edges. The output looks fairly sane on the few files
I have tested it on, but it wouldn't be too surprising if it gets some
cases wrong.

[jc: adding it to pu for wider comments. I did minimum
whitespace fixups but it still needs an indent run and
-Wdeclaration-after-statement fixups.]

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 00:54:34 -08:00
Junio C Hamano 6643688867 Merge part of jc/portable branch 2006-02-21 00:52:18 -08:00
Junio C Hamano 83f50539a9 git-mktree: reverse of git-ls-tree.
This reads data in the format a (non recursive) ls-tree outputs
and writes a tree object to the object database.  The created
tree object name is output to the standard output.

For convenience, the input data does not need to be sorted; the
command sorts the input lines internally.

By request from Tommi Virtanen.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-21 00:50:05 -08:00
Junio C Hamano 8cf828b43c Merge branch 'lt/merge-tree'
* lt/merge-tree:
  git-merge-tree: generalize the "traverse <n> trees in sync" functionality
  Handling large files with GIT
  Handling large files with GIT
2006-02-21 00:49:38 -08:00
Ryan Anderson c65e898754 Add git-annotate, a tool for assigning blame.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-20 13:35:42 -08:00
Johannes Schindelin a348ab702a Really honour NO_PYTHON
Do not even test for subprocess (trying to execute python).

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-19 16:55:38 -08:00
Johannes Schindelin 2a3763ef3d avoid makefile override warning
Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-19 16:55:38 -08:00
Johannes Schindelin 39c015c556 Fixes for ancient versions of GNU make
Some versions of GNU make do not understand $(call), and have problems to
interpret rules like this:

some_target: CFLAGS += -Dsome=defs

[jc: simplified substitution a bit. ]

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-18 23:17:01 -08:00
Johannes Schindelin abb7c7b31c Optionally work without python
In some setups (notably server setups) you do not need that dependency.
Gracefully handle the absence of python when NO_PYTHON is defined.

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-18 23:16:09 -08:00
Johannes Schindelin 289c4b36e3 Support Irix
Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-17 16:32:43 -08:00
Johannes Schindelin 5b5d4d9e1b Optionally support old diffs
Some versions of diff do not correctly detect a missing new-line at the end
of the file under certain circumstances.

When defining NO_ACCURATE_DIFF, work around this bug.

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-17 16:32:41 -08:00
Fernando J. Pereda b6e56eca8a Allow building Git in systems without iconv
Systems using some uClibc versions do not properly support
iconv stuff. This patch allows Git to be built on those
systems by passing NO_ICONV=YesPlease to make. The only
drawback is mailinfo won't do charset conversion in those
systems.

Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-16 01:42:58 -08:00
Linus Torvalds 492e0759bf Handling large files with GIT
On Tue, 14 Feb 2006, Junio C Hamano wrote:

> Linus Torvalds <torvalds@osdl.org> writes:
>
> > If somebody is interested in making the "lots of filename changes" case go
> > fast, I'd be more than happy to walk them through what they'd need to
> > change. I'm just not horribly motivated to do it myself. Hint, hint.
>
> In case anybody is wondering, I share the same feeling.  I
> cannot say I'd be "more than happy to" clean up potential
> breakages during the development of such changes, but if the
> change eventually would help certain use cases, I can be
> persuaded to help debugging such a mess ;-).

Actually, I got interested in seeing how hard this is, and wrote a simple
first cut at doing a tree-optimized merger.

Let me shout a bit first:

  THIS IS WORKING CODE, BUT BE CAREFUL: IT'S A TECHNOLOGY DEMONSTRATION
  RATHER THAN THE FINAL PRODUCT!

With that out of the way, let me descibe what this does (and then describe
the missing parts).

This is basically a three-way merge that works entirely on the "tree"
level, rather than on the index. A lot of the _concepts_ are the same,
though, and if you're familiar with the results of an index merge, some of
the output will make more sense.

You give it three trees: the base tree (tree 0), and the two branches to
be merged (tree 1 and tree 2 respectively). It will then walk these three
trees, and resolve them as it goes along.

The interesting part is:
 - it can resolve whole sub-directories in one go, without actually even
   looking recursively at them. A whole subdirectory will resolve the same
   way as any individual files will (although that may need some
   modification, see later).
 - if it has a "content conflict", for subdirectories that means "try to
   do a recursive tree merge", while for non-subdirectories it's just a
   content conflict and we'll output the stage 1/2/3 information.
 - a successful merge will output a single stage 0 ("merged") entry,
   potentially for a whole subdirectory.
 - it outputs all the resolve information on stdout, so something like the
   recursive resolver can pretty easily parse it all.

Now, the caveats:
 - we probably need to be more careful about subdirectory resolves. The
   trivial case (both branches have the exact same subdirectory) is a
   trivial resolve, but the other cases ("branch1 matches base, branch2 is
   different" probably can't be silently just resolved to the "branch2"
   subdirectory state, since it might involve renames into - or out of -
   that subdirectory)
 - we do not track the current index file at all, so this does not do the
   "check that index matches branch1" logic that the three-way merge in
   git-read-tree does. The theory is that we'd do a full three-way merge
   (ignoring the index and working directory), and then to update the
   working tree, we'd do a two-way "git-read-tree branch1->result"
 - I didn't actually make it do all the trivial resolve cases that
   git-read-tree does. It's a technology demonstration.

Finally (a more serious caveat):
 - doing things through stdout may end up being so expensive that we'd
   need to do something else. In particular, it's likely that I should
   not actually output the "merge results", but instead output a "merge
   results as they _differ_ from branch1"

However, I think this patch is already interesting enough that people who
are interested in merging trees might want to look at it. Please keep in
mind that tech _demo_ part, and in particular, keep in mind the final
"serious caveat" part.

In many ways, the really _interesting_ part of a merge is not the result,
but how it _changes_ the branch we're merging into. That's particularly
important as it should hopefully also mean that the output size for any
reasonable case is minimal (and tracks what we actually need to do to the
current state to create the final result).

The code very much is organized so that doing the result as a "diff
against branch1" should be quite easy/possible. I was actually going to do
it, but I decided that it probably makes the output harder to read. I
dunno.

Anyway, let's think about this kind of approach.. Note how the code itself
is actually quite small and short, although it's prbably pretty "dense".

As an interesting test-case, I'd suggest this merge in the kernel:

	git-merge-tree $(git-merge-base 4cbf876 7d2babc) 4cbf876 7d2babc

which resolves beautifully (there are no actual file-level conflicts), and
you can look at the output of that command to start thinking about what
it does.

The interesting part (perhaps) is that timing that command for me shows
that it takes all of 0.004 seconds.. (the git-merge-base thing takes
considerably more ;)

The point is, we _can_ do the actual merge part really really quickly.

		Linus

PS. Final note: when I say that it is "WORKING CODE", that is obviously by
my standards. IOW, I tested it once and it gave reasonable results - so it
must be perfect.

Whether it works for anybody else, or indeed for any other test-case, is
not my problem ;)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-15 23:35:40 -08:00
Fernando J. Pereda 6c5c62f340 Print an error if cloning a http repo and NO_CURL is set
If Git is compiled with NO_CURL=YesPlease and one tries to
clone a http repository, git-clone tries to call the curl
binary. This trivial patch prints an error instead in such
situation.

Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-15 19:14:01 -08:00
Fredrik Kuivinen 3654638513 s/SHELL/SHELL_PATH/ in Makefile
With the current Makefile we don't use the shell chosen by the
platform specific defines when we invoke GIT-VERSION-GEN.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-13 22:13:22 -08:00
Junio C Hamano cf7bb589af git-status -v
This revamps the git-status command to take the same set of
parameters as git commit.  It gives a preview of what is being
committed with that command.  With -v flag, it shows the diff
output between the HEAD commit and the index that would be
committed if these flags were given to git-commit command.

git-commit also acquires -v flag (it used to mean "verify" but
that is the default anyway and there is --no-verify to turn it
off, so not much is lost), which uses the updated git-status -v
to seed the commit log buffer.  This is handy for writing a log
message while reviewing the changes one last time.

Now, git-commit and git-status are internally share the same
implementation.

Unlike previous git-commit change, this uses a temporary index
to prepare the index file that would become the real index file
after a successful commit, and moves it to the real index file
once the commit is actually made.  This makes it safer than the
previous scheme, which stashed away the original index file and
restored it after an aborted commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-10 00:54:49 -08:00
Junio C Hamano 8389b52b2a git-rerere: reuse recorded resolve.
In a workflow that employs relatively long lived topic branches,
the developer sometimes needs to resolve the same conflict over
and over again until the topic branches are done (either merged
to the "release" branch, or sent out and accepted upstream).

This commit introduces a new command, "git rerere", to help this
process by recording the conflicted automerge results and
corresponding hand-resolve results on the initial manual merge,
and later by noticing the same conflicted automerge and applying
the previously recorded hand resolution using three-way merge.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-06 21:53:11 -08:00
Junio C Hamano 80d48ac623 git-show
This is essentially 'git whatchanged -n1 --always --cc "$@"'.
Just like whatchanged takes default flags from
whatchanged.difftree configuration, this uses show.difftree
configuration.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-05 16:42:49 -08:00
Junio C Hamano af3feefa1d diff-tree -c: show a merge commit a bit more sensibly.
A new option '-c' to diff-tree changes the way a merge commit is
displayed when generating a patch output.  It shows a "combined
diff" (hence the option letter 'c'), which looks like this:

    $ git-diff-tree --pretty -c -p fec9ebf1 | head -n 18
    diff-tree fec9ebf... (from parents)
    Merge: 0620db3... 8a263ae...
    Author: Junio C Hamano <junkio@cox.net>
    Date:   Sun Jan 15 22:25:35 2006 -0800

	Merge fixes up to GIT 1.1.3

    diff --combined describe.c
    @@@ +98,7 @@@
	    return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
       }

    -  static void describe(char *arg)
     - static void describe(struct commit *cmit, int last_one)
    ++ static void describe(char *arg, int last_one)
       {
     +      unsigned char sha1[20];
     +      struct commit *cmit;

There are a few things to note about this feature:

 - The '-c' option implies '-p'.  It also implies '-m' halfway
   in the sense that "interesting" merges are shown, but not all
   merges.

 - When a blob matches one of the parents, we do not show a diff
   for that path at all.  For a merge commit, this option shows
   paths with real file-level merge (aka "interesting things").

 - As a concequence of the above, an "uninteresting" merge is
   not shown at all.  You can use '-m' in addition to '-c' to
   show the commit log for such a merge, but there will be no
   combined diff output.

 - Unlike "gitk", the output is monochrome.

A '-' character in the nth column means the line is from the nth
parent and does not appear in the merge result (i.e. removed
from that parent's version).

A '+' character in the nth column means the line appears in the
merge result, and the nth parent does not have that line
(i.e. added by the merge itself or inherited from another
parent).

The above example output shows that the function signature was
changed from either parents (hence two "-" lines and a "++"
line), and "unsigned char sha1[20]", prefixed by a " +", was
inherited from the first parent.

The code as sent to the list was buggy in few corner cases,
which I have fixed since then.

It does not bother to keep track of and show the line numbers
from parent commits, which it probably should.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-28 00:08:28 -08:00
Alecs King b3bf974cab Add freebsd support in Makefile
Needs iconv and third party lib/headers are inside /usr/local

Signed-off-by: Alecs King <alecsk@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-26 18:14:40 -08:00
Jason Riedy 731043fd4d Add compat/unsetenv.c .
Implement a (slow) unsetenv() for older systems.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-25 15:10:39 -08:00
Jason Riedy 5ea06e2014 Run GIT-VERSION-GEN with $(SHELL), not sh.
Alas, not all shells named sh are capable enough to run
GIT-VERSION-GEN.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-25 15:10:37 -08:00
Junio C Hamano 63be37b06f DT_UNKNOWN: do not fully trust existence of DT_UNKNOWN
The recent Cygwin defines DT_UNKNOWN although it does not have d_type
in struct dirent.  Give an option to tell us not to use d_type on such
platforms.  Hopefully this problem will be transient.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-21 19:33:22 -08:00
Junio C Hamano 35a730f01c fsck-objects: support platforms without d_ino in struct dirent.
The d_ino field is only used for performance reasons in
fsck-objects.  On a typical filesystem, i-number tends to have a
strong correlation with where the actual bits sit on the disk
platter, and we sort the entries to allow us scan things that
ought to be close together together.

If the platform lacks support for it, it is not a big deal.
Just do not use d_ino for sorting, and scan them unsorted.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-21 19:33:22 -08:00
Junio C Hamano bdc37f5a81 Makefile: do not assume lack of IPV6 means no sockaddr_storage.
Noticed first by Alex, that the latest Cygwin now properly has
sockaddr_storage.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-21 19:33:22 -08:00
Pavel Roskin 2fabd21733 Disable USE_SYMLINK_HEAD by default
Disable USE_SYMLINK_HEAD by default.  Recommend using it only for
compatibility with older software.

Treat USE_SYMLINK_HEAD like other optional defines - check whether it's
defined, not its value.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-19 23:14:31 -08:00
Junio C Hamano b42934d611 Fix the installation location.
The earlier change to separate $(gitexecdir) from $(bindir) had
the installation location of the git wrapper and the rest of the
commands the wrong way (right now, both of them point at the
same location so there is no real harm).

Also gitk needs to be installed in $(bindir).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-13 16:49:02 -08:00
Michal Ostrowski 77cb17e940 Exec git programs without using PATH.
The git suite may not be in PATH (and thus programs such as
git-send-pack could not exec git-rev-list).  Thus there is a need for
logic that will locate these programs.  Modifying PATH is not
desirable as it result in behavior differing from the user's
intentions, as we may end up prepending "/usr/bin" to PATH.

- git C programs will use exec*_git_cmd() APIs to exec sub-commands.
- exec*_git_cmd() will execute a git program by searching for it in
  the following directories:
	1. --exec-path (as used by "git")
	2. The GIT_EXEC_PATH environment variable.
	3. $(gitexecdir) as set in Makefile (default value $(bindir)).
- git wrapper will modify PATH as before to enable shell scripts to
  invoke "git-foo" commands.

Ideally, shell scripts should use the git wrapper to become independent
of PATH, and then modifying PATH will not be necessary.

[jc: with minor updates after a brief review.]

Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-13 16:49:01 -08:00
Junio C Hamano 4dc00021f7 Makefile: add 'strip' target
This is not invoked by any other target (most notably, "make
install" does not), but is provided as a convenience for people
who are building from the source.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-12 21:51:23 -08:00
H. Peter Anvin 181129d24c For release tarballs, include the proper version
When producing a release tarball, include a "version" file, which
GIT-VERSION-GEN can then use to do the right thing when building from a
tarball.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-09 20:22:26 -08:00
Junio C Hamano 5a2282de13 GIT 1.1.0 2006-01-08 14:22:19 -08:00
Junio C Hamano 8fc11b5aa9 GIT 1.0.8 2006-01-07 21:32:48 -08:00
Junio C Hamano 7d0e65b892 Retire debian/ directory.
The official maintainer is keeping up-to-date quite well, and now
the older Debian is supported with backports.org, there is no reason
for me to keep debian/ directory around here.

I have not been building and publishing debs since 1.0.4 anyway.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06 19:18:12 -08:00
Junio C Hamano 92e802c6cc GIT 1.0.7
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-05 20:52:50 -08:00
Junio C Hamano 17dff84b5e GIT 1.0.6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 18:08:58 -08:00
Junio C Hamano 9b88fcef7d Makefile: use git-describe to mark the git version.
Note: with this commit, the GIT maintainer workflow must change.
GIT-VERSION-GEN is now the file to munge when the default
version needs to be changed, not Makefile.  The tag needs to be
pushed into the repository to build the official tarball and
binary package beforehand.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:28 -08:00
Linus Torvalds 908e5310b9 Add a "git-describe" command
It shows you the most recent tag that is reachable from a particular
commit is.

Maybe this is something that "git-name-rev" should be taught to do,
instead of having a separate command for it. Regardless, I find it useful.

What it does is to take any random commit, and "name" it by looking up the
most recent commit that is tagged and reachable from that commit. If the
match is exact, it will just print out that ref-name directly. Otherwise
it will print out the ref-name, followed by the 8-character "short SHA".

IOW, with something like Junios current tree, I get:

	[torvalds@g5 git]$ git-describe parent
	refs/tags/v1.0.4-g2414721b

ie the current head of my "parent" branch (ie Junio) is based on v1.0.4,
but since it has a few commits on top of that, it has added the git hash
of the thing to the end: "-g" + 8-char shorthand for the commit
2414721b19.

Doing a "git-describe" on a tag-name will just show the full tag path:

	[torvalds@g5 git]$ git-describe v1.0.4
	refs/tags/v1.0.4

unless there are _other_ tags pointing to that commit, in which case it
will just choose one at random.

This is useful for two things:

 - automatic version naming in Makefiles, for example. We could use it in
   git itself: when doing "git --version", we could use this to give a
   much more useful description of exactly what version was installed.

 - for any random commit (say, you use "gitk <pathname>" or
   "git-whatchanged" to look at what has changed in some file), you can
   figure out what the last version of the repo was. Ie, say I find a bug
   in commit 39ca371c45b04cd50d0974030ae051906fc516b6, I just do:

	[torvalds@g5 linux]$ git-describe 39ca371c45b04cd50d0974030ae051906fc516b6
	refs/tags/v2.6.14-rc4-g39ca371c

   and I now know that it was _not_ in v2.6.14-rc4, but was presumably in
   v2.6.14-rc5.

The latter is useful when you want to see what "version timeframe" a
commit happened in.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27 17:57:27 -08:00
Junio C Hamano e5f5219a4f GIT 1.0.5
Minor fixes.

Starting from this one I won't be touching debian/ directory
since the official maintainer seems to be reasonably quick to
package up things.  The packaging procedure used there seems to
be quite different from what I have, so I'd like to avoid
potential confusion and reduce work by the official maintainer
and myself.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-26 18:44:15 -08:00
Junio C Hamano 6ab58895cd GIT 1.0.4
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-24 00:02:08 -08:00
Junio C Hamano c10d634518 Merge in fixes up to 1.0.3 maintenance branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-22 18:19:03 -08:00
Junio C Hamano c63da8d8e8 GIT 1.0.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-22 18:14:31 -08:00
Johannes Schindelin e99fcf96de git-format-patch should show the correct version
We want to record the version of the tools the patch was generated with.
While these tools could be rebuilt, git-format-patch stayed the same and
report the wrong version.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-22 12:52:29 -08:00
Junio C Hamano c894168631 Versioning scheme changes.
HPA suggests it is simply silly to imitate Linux versioning
scheme where the leading "2" does not mean anything anymore, and
I tend to agree.

The first feature release after 1.0.0 will be 1.1.0, and the
development path leading to 1.1.0 will carry 1.0.GIT as the
version number from now on.  Similarly, the third maintenance
release that follows 1.0.0 will not be 1.0.0c as planned, but
will be called 1.0.3.  The "maint" branch will merge in fixes
and immediately tagged, so there is no need for 1.0.2.GIT that
is in between 1.0.2 (aka 1.0.0b) and 1.0.3.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-21 22:33:37 -08:00
Junio C Hamano 8d712aafd2 GIT 1.0.0b
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-21 13:51:51 -08:00
Junio C Hamano e4e79a2175 GIT 1.0.0a
- Avoid misleading success message on error (Johannes)
    - objects/info/packs: work around bug in http-fetch.c::fetch_indices()
    - http-fetch.c: fix objects/info/pack parsing.
    - An off-by-one bug found by valgrind (Pavel)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-21 13:17:54 -08:00
Junio C Hamano 5d9d11db3c Post 1.0.0 development track.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-21 12:12:26 -08:00
Junio C Hamano c2f3bf071e GIT 1.0.0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-21 00:01:00 -08:00
Junio C Hamano e32faa8adb Remove "octopus".
We still advertise "git resolve" as a standalone command, but never
"git octopus", so nobody should be using it and it is safe to
retire it.  The functionality is still available as a strategy
backend.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-19 18:05:49 -08:00
Junio C Hamano d89056c258 Remove generated files */*.py[co]
We missed ones in the compat/ subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-19 18:00:54 -08:00
Junio C Hamano ad89721508 fetch-pack: -k option to keep downloaded pack.
Split out the functions that deal with the socketpair after
finishing git protocol handshake to receive the packed data into
a separate file, and use it in fetch-pack to keep/explode the
received pack data.  We earlier had something like that on
clone-pack side once, but the list discussion resulted in the
decision that it makes sense to always keep the pack for
clone-pack, so unpacking option is not enabled on the clone-pack
side, but we later still could do so easily if we wanted to with
this change.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-17 23:11:29 -08:00
Junio C Hamano 1ed91937e5 GIT 0.99.9n aka 1.0rc6
Oh, I hate to do this but I ended up merging big usage string
cleanups from Fredrik, git-am enhancements that made a lot of
sense for non mbox users from HPA, and rebase changes (done
independently by me and Lukas) among other things, so git is
still in perpetual state of 1.0rc.  1.0 will probably be next
Wednesday, but who knows.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14 17:30:03 -08:00
Junio C Hamano 773b633943 Do not let errors pass by unnoticed when running `make check'.
[jc: originally from Amos Waterland.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14 13:32:52 -08:00
Junio C Hamano a9572072f0 GIT 0.99.9m aka 1.0rc5
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-11 16:49:45 -08:00
Jason Riedy a6da9395a5 [PATCH] Initial AIX portability fixes.
Added an AIX clause in the Makefile; that clause likely
will be wrong for any AIX pre-5.2, but I can only test
on 5.3.  mailinfo.c was missing the compat header file,
and convert-objects.c needs to define a specific
_XOPEN_SOURCE as well as _XOPEN_SOURCE_EXTENDED.

Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-06 16:15:55 -08:00
Junio C Hamano 4050c0df8e Clean up compatibility definitions.
This attempts to clean up the way various compatibility
functions are defined and used.

 - A new header file, git-compat-util.h, is introduced.  This
   looks at various NO_XXX and does necessary function name
   replacements, equivalent of -Dstrcasestr=gitstrcasestr in the
   Makefile.

 - Those function name replacements are removed from the Makefile.

 - Common features such as usage(), die(), xmalloc() are moved
   from cache.h to git-compat-util.h; cache.h includes
   git-compat-util.h itself.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05 15:50:29 -08:00
Junio C Hamano 423325a2d2 GIT 0.99.9l aka 1.0rc4 2005-12-03 23:46:02 -08:00
Jason Riedy e40b61fb6b Add compat/setenv.c, use in git.c.
There is no setenv() in Solaris 5.8.  The trivial calls to
setenv() were replaced by putenv() in a much earlier patch,
but setenv() was used again in git.c.  This patch just adds
a compat/setenv.c.

The rule for building git$(X) also needs to include compat.
objects and compiler flags.  Those are now in makefile vars
COMPAT_OBJS and COMPAT_CFLAGS.

Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03 22:25:25 -08:00
Junio C Hamano 2731d04883 Makefile: say the default target upfront.
Alex Riesen wants to keep extra makefile targets in config.mak, but
the file is included before any of our real targets.  Having this
at the beginning allows you to do so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01 12:26:41 -08:00
Timo Hirvonen b34403aa97 Move couple of ifdefs after "include config.mk"
This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.

Also remove GIT_LIST_TWEAK because it isn't used anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30 17:46:35 -08:00
Junio C Hamano 93dcab2937 GIT 0.99.9k
This is not 1.0rc4 yet, but to push the recent fixes out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25 16:35:20 -08:00
Johannes Schindelin ee72aeaf00 Rename git-config-set to git-repo-config
... and adjust all references.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-24 11:10:40 -08:00
Junio C Hamano 9ce392f482 Move diff.renamelimit out of default configuration.
Otherwise we would end up linking all the unneeded stuff into git-daemon
only to link with git_default_config.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-21 23:00:50 -08:00
Andreas Ericsson d6ebd2590c Introduce $(ALL_PROGRAMS) for 'all:' and 'install:' to operate on.
Remove $(SIMPLE_PROGRAMS) from $(PROGRAMS) so buildrules don't have
to be overridden.

Put $(SCRIPTS) with the other target-macros so it doesn't get lonely.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-21 16:37:58 -08:00
Ryan Anderson 3d32051f4f Add Python version checks to the Makefile to automatically set WITH_OWN_SUBPROCESS_PY
Also rearrange some path settings in the Makefile in the process.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-20 22:17:56 -08:00
Johannes Schindelin 1b1e59c508 Add git-config-set, a simple helper for scripts to set config variables
This is meant for the end user, who cannot be expected to edit
.git/config by hand.

Example:

	git-config-set core.filemode true

will set filemode in the section [core] to true,

	git-config-set --unset core.filemode

will remove the entry (failing if it is not there), and

	git-config-set --unset diff.twohead ^recar

will remove the unique entry whose value matches the regex "^recar"
(failing if there is no unique such entry).

It is just a light wrapper around git_config_set() and
git_config_set_multivar().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-19 20:47:29 -08:00
Nick Hengeveld 0890098780 Decide whether to build http-push in the Makefile
The decision about whether to build http-push or not belongs in the
Makefile.  This follows Junio's suggestion to determine whether curl
is new enough to support http-push.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-19 20:17:25 -08:00
Nick Hengeveld 29508e1efb Isolate shared HTTP request functionality
Move shared HTTP request functionality out of http-fetch and http-push,
and replace the two fwrite_buffer/fwrite_buffer_dynamic functions with
one fwrite_buffer function that does dynamic buffering.  Use slot
callbacks to process responses to fetch object transfer requests and
push transfer requests, and put all of http-push into an #ifdef check
for curl multi support.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-19 20:17:24 -08:00
Junio C Hamano 52b6536c62 Merge branch 'master' 2005-11-18 16:58:51 -08:00
Junio C Hamano 2e67a5f449 Cygwin *might* be helped with NO_MMAP
When HPA added Cygwin target, it ran just fine without NO_MMAP for him,
but recently we are getting reports that for some people things break
without it.  For now, just suggest it in the Makefile without actually
updating the default.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-18 11:22:27 -08:00
Junio C Hamano 6eb668df76 Merge branch 'master' 2005-11-18 00:11:28 -08:00
Nicolas Pitre d2ac1cd263 'make clean' forgot about some files
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-17 21:28:39 -08:00
Junio C Hamano 27dedf0c3b GIT 0.99.9j aka 1.0rc3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-16 21:32:44 -08:00
Andreas Ericsson 8e49d50388 C implementation of the 'git' program, take two.
This patch provides a C implementation of the 'git' program and
introduces support for putting the git-* commands in a directory
of their own. It also saves some time on executing those commands
in a tight loop and it prints the currently available git commands
in a nicely formatted list.

The location of the GIT_EXEC_PATH (name discussion's closed, thank gods)
can be obtained by running

	git --exec-path

which will hopefully give porcelainistas ample time to adapt their
heavy-duty loops to call the core programs directly and thus save
the extra fork() / execve() overhead, although that's not really
necessary any more.

The --exec-path value is prepended to $PATH, so the git-* programs
should Just Work without ever requiring any changes to how they call
other programs in the suite.

Some timing values for 10000 invocations of git-var >&/dev/null:
	git.sh: 24.194s
	git.c:   9.044s
	git-var: 7.377s

The git-<tab><tab> behaviour can, along with the someday-to-be-deprecated
git-<command> form of invocation, be indefinitely retained by adding
the following line to one's .bash_profile or equivalent:

	PATH=$PATH:$(git --exec-path)

Experimental libraries can be used by either setting the environment variable
GIT_EXEC_PATH, or by using

	git --exec-path=/some/experimental/exec-path

Relative paths are properly grok'ed as exec-path values.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 16:02:57 -08:00
Junio C Hamano 3299c6f6a8 diff: make default rename detection limit configurable.
A while ago, a rename-detection limit logic was implemented as a
response to this thread:

	http://marc.theaimsgroup.com/?l=git&m=112413080630175

where gitweb was found to be using a lot of time and memory to
detect renames on huge commits.  git-diff family takes -l<num>
flag, and if the number of paths that are rename destination
candidates (i.e. new paths with -M, or modified paths with -C)
are larger than that number, skips rename/copy detection even
when -M or -C is specified on the command line.

This commit makes the rename detection limit easier to use.  You
can have:

	[diff]
		renamelimit = 30

in your .git/config file to specify the default rename detection
limit.  You can override this from the command line; giving 0
means 'unlimited':

	git diff -M -l0

We might want to change the default behaviour, when you do not
have the configuration, to limit it to say 20 paths or so.  This
would also help the diffstat generation after a big 'git pull'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 15:08:27 -08:00
H. Peter Anvin 8b649e27dd git-core-foo -> git-foo, except the core package
This patch renames the tarball "git" rather than "git-core", and changes
the names of various packages from git-core-foo to git-foo.  git-core is
still the true core package; an empty RPM package named "git" pulls in
ALL the git packages -- this makes updates work correctly, and allows
"yum install git" to do the obvious thing.

It also renames the git-(core-)tk package to gitk.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-15 00:07:46 -08:00
Junio C Hamano 60d64db461 GIT 0.99.9i aka 1.0rc2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 18:39:18 -08:00
Josef Weidendorfer 1331df8781 Remove git-rename. git-mv does the same
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 00:50:18 -08:00
Junio C Hamano 94d2331770 Separate LDFLAGS and CFLAGS.
Stuffing -L flag and friends meant for the linking phase into
ALL_CFLAGS is not right; honor LDFLAGS and introduce ALL_LDFLAGS
to separate them out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-14 00:26:49 -08:00
Junio C Hamano 0086e2c854 Rename lost+found to lost-found.
Because we use "lost-found" as the directory name to hold
dangling object names, it is confusing to call the command
git-lost+found, although it makes sense and is even cute ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-13 02:07:02 -08:00
Junio C Hamano f7a2eb7359 GIT 0.99.9h
This is GIT 1.0-rc1 in disguise.  It is plausible that
relatively new parts of the system still need tweaking and
fixing, but that is why it is not 1.0 but rc ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 22:37:38 -08:00
Junio C Hamano 04e7ca1a1b git-lost+found
This command helps you resurrect accidentally lost tags and commits.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 21:52:20 -08:00
Lukas_Sandström 9bc0f32c77 Rename git-pack-intersect to git-pack-redundant
This patch renames git-pack-intersect to git-pack-redundant
as suggested by Petr Baudis. The new name reflects what the
program does, rather than how it does it.

Also fix a small argument parsing bug.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 21:19:11 -08:00
Lukas_Sandström c283ab21c1 Add git-pack-intersect
This patch adds the program git-pack-intersect. It is
used to find redundant packs in git repositories.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-11 21:19:10 -08:00
Junio C Hamano 23ea3e201c GIT 0.99.9g
Another snapshot, as slow and steady marth towards 1.0 continues.
Major changes include:

 - Jim Radford's RPM split.
 - Fredrik's recursive merge strategy is now default for two heads merge.
 - Yaacov's SVN importer updates.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-09 21:09:43 -08:00
Junio C Hamano 5ca15b8af7 GIT 0.99.9f
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 01:25:59 -08:00
Junio C Hamano 77131db585 Merge branch 'master' 2005-11-07 18:23:45 -08:00
Martin Langhoff 5e0306adfa Introducing: git-cvsexportcommit
A script that can replay commits git into a CVS checkout. Tries to ensure the
sanity of the operation and supports mainly manual usage.

If you are reckless enough, you can ask it to autocommit when everything has
applied cleanly. Combined with a couple more scripts could become part of
a git2cvs gateway.

Should support adds/removes and binary files.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-07 13:28:37 -08:00
Junio C Hamano 72e5890b68 GIT 0.99.9e
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 18:57:40 -08:00
Randal L. Schwartz 0cfddacdcc Use fink/darwinport paths for OSX
There's no standard libexpat for OSX, so if you install it
after-market, it can end up in various directories.  Give
paths used by fink and darwinports by default to CFLAGS.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 10:52:48 -08:00
Junio C Hamano 4ea836dba9 Merge in http-push first stage. 2005-11-06 01:27:15 -08:00
Nick Hengeveld 58e60dd203 Add support for pushing to a remote repository using HTTP/DAV
Add support for pushing to a remote repository using HTTP/DAV

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 01:14:44 -08:00
Junio C Hamano d071e8dbb6 Package split: Debian.
As discussed on the list, split the foreign SCM interoperability
packages and documentation from the git-core binary package.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 01:12:31 -08:00
Junio C Hamano 12aa7456c9 Simplify CFLAGS/DEFINES in Makefile
I think the original intention was to make CFLAGS overridable
from the make command line, but somehow we ended up accumulating
conditional makefile sections that wrongly appends values to
CFLAGs.  These assignments do not work when the user actually
override them from the make command line!

DEFINES are handled the same way; it was seemingly overridable,
but the makefile sections had assignments, which meant
overriding it from the command line broke things.

This simplifies things by limiting the internal futzing to
ALL_CFLAGS, and by removing DEFINES altogether.  Overriding
CFLAGS from the command line should start working with this
change.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-06 01:12:31 -08:00
Junio C Hamano 87ce294c91 GIT 0.99.9d
This is primarily to include the 'git clone -l' (without -s) fix,
first spotted and diagnosed by Linus and caused James Bottomley's
repository to become unreadable.  It also contains documentation
updates happened on the "master" branch since 0.99.9c

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-05 11:50:24 -08:00
Junio C Hamano 6ddc096403 GIT 0.99.9c
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-03 15:45:36 -08:00
Junio C Hamano 64da9e604e Add 'ours' merge strategy.
This adds the coolest merge strategy ever, "ours".  It can take
arbitrary number of foreign heads and merge them into the
current branch, with the resulting tree always taken from our
branch head, hence its name.

What this means is that you can declare that the current branch
supersedes the development histories of other branches using
this merge strategy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-03 14:55:10 -08:00
Peter Eriksen 2fd955cc0b [PATCH] Clean up the SunOS Makefile rule
Don't set a non-standard CURLDIR as default, and fix an error
in Solaris 10 by setting NEEDS_LIBICONV.

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-02 16:50:58 -08:00
Junio C Hamano 4ccafd7a02 Make test-date buildable again.
Now we define and use our own ctype-replacement, we need to link
with it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-02 16:50:58 -08:00
Junio C Hamano 235d521da6 GIT 0.99.9b
This contains the changes made on the master branch since 0.99.9a.

The workaround for building RPMs has not changed since 0.99.9a,
mainly because I haven't heard back if it was good enough for
kernel.org consumption, or otherwise what changes are needed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-01 21:58:53 -08:00
Junio C Hamano 319f8b3da6 Do not install backward compatibility links anymore.
This is a companion patch to 4f9dcf7e5c
which stops mentioning the old command names.  As promised, we do not
install symlinks to let people use backward compatibility names anymore.

cmd-rename.sh script is still shipped to help people who installed
previous git by hand to clean up the leftover symlinks.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-01 16:46:38 -08:00
Petr Baudis e3a39000e2 Remove git-findtags.perl
This script was superseded by git-name-rev, which is more versatile,
actually documented, faster, and everything else...

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-01 14:45:48 -08:00
Junio C Hamano e634aec752 GIT 0.99.9a
... to contain the RPM workaround.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-30 18:06:39 -08:00
Junio C Hamano c2d07d24e4 GIT 0.99.9 master branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-30 17:27:38 -08:00
Junio C Hamano 46774a81f9 GIT 0.99.9
Done in 0.99.9
==============

Ports
~~~~~

* Cygwin port [HPA].

* OpenBSD build [Merlyn and others].

Fixes
~~~~~

* clone request over git native protocol from a repository with
  too many refs did not work; this has been fixed.

* git-daemon got safer for kernel.org use [HPA].

* Extended SHA1 parser was not enforcing uniqueness for
  abbreviated SHA1; this has been fixed.

* http transport does not barf on funny characters in URL.

* The ref naming restrictions have been formalized and the
  coreish refuses to create funny refs; we still need to audit
  importers.  See git-check-ref-format(1).

New Features and Commands
~~~~~~~~~~~~~~~~~~~~~~~~~

* .git/config file as a per-repository configuration mechanism,
  and some commands understand it [Linus].  See
  git(7).

* The core.filemode configuration item can be used to make us a
  bit more FAT friendly.  See git(7).

* The extended SHA1 notation acquired Peel-the-onion operator
  ^{type} and ^{}.  See git-rev-parse(1).

* SVN importer [Matthias].  See git-svnimport(1).

* .git/objects/[0-9a-f]{2} directories are created on demand,
  and removed when becomes empty after prune-packed [Linus].

* Filenames output from various commands without -z option are
  quoted when they embed funny characters (TAB and LF) using
  C-style quoting within double-quotes, to match the proposed
  GNU diff/patch notation [me, but many people contributed in
  the discussion].

* git-mv is expected to be a better replacement for git-rename.
  While the latter has two parameter restriction, it acts more
  like the regular 'mv' that can move multiple things to one
  destinatino directory [Josef Weidendorfer].

* git-checkout can take filenames to revert the changes to
  them.  See git-checkout(1)

* The new program git-am is a replacement for git-applymbox that
  has saner command line options and a bit easier to use when a
  patch does not apply cleanly.

* git-ls-remote can show unwrapped onions using ^{} notation, to
  help Cogito to track tags.

* git-merge-recursive backend can merge unrelated projects.

* git-clone over native transport leaves the result packed.

* git-http-fetch issues multiple requests in parallel when
  underlying cURL library supports it [Nick and Daniel].

* git-fetch-pack and git-upload-pack try harder to figure out
  better common commits [Johannes].

* git-read-tree -u removes a directory when it makes it empty.

* git-diff-* records abbreviated SHA1 names of original and
  resulting blob; this sometimes helps to apply otherwise an
  unapplicable patch by falling back to 3-way merge.

* git-format-patch now takes series of from..to rev ranges and
  with '-m --stdout', writes them out to the standard output.
  This can be piped to 'git-am' to implement cheaper
  cherry-picking.

* git-tag takes '-u' to specify the tag signer identity [Linus].

* git-rev-list can take optional pathspecs to skip commits that
  do not touch them (--dense) [Linus].

* Comes with new and improved gitk [Paulus and Linus].

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-29 14:35:11 -07:00