Commit graph

462 commits

Author SHA1 Message Date
Junio C Hamano 2bd452d3b9 git-update-index --unresolve
Retire git-unresolve and make it into "git-update-index --unresolve".
It processes all paths that follow.

During a merge, you would mark a path that is dealt with with:

	$ git update-index hello

and you would "undo" it with:

	$ git update-index --unresolve hello

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 23:52:05 -07:00
Junio C Hamano ec167793d8 Add git-unresolve <paths>...
This is an attempt to address the issue raised on #git channel
recently by Carl Worth.

After a conflicted automerge, "git diff" shows a combined diff
to give you how the tentative automerge result differs from
what came from each branch.  During a complex merge, it is
tempting to be able to resolve a few paths at a time, mark
them "I've dealt with them" with git-update-index to unclutter
the next "git diff" output, and keep going.  However, when the
final result does not compile or otherwise found to be a
mismerge, the workflow to fix the mismerged paths suddenly
changes to "git diff HEAD -- path" (to get a diff from our
HEAD before merging) and "git diff MERGE_HEAD -- path" (to get
a diff from theirs), and it cannot show the combined anymore.

With git-unresolve <paths>..., the versions from our branch and
their branch for specified blobs are placed in stage #2 and
stage #3, without touching the working tree files.  This gives
you the combined diff back for easier review, along with
"diff --ours" and "diff --theirs".

One thing it does not do is to place the base in stage #1; this
means "diff --base" would behave differently between the run
immediately after a conflicted three-way merge, and the run
after an update-index by mistake followed by a git-unresolve.

We could theoretically run merge-base between HEAD and
MERGE_HEAD to find which tree to place in stage #1, but
reviewing "diff --base" is not that useful so....

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 16:12:41 -07:00
Junio C Hamano ba580aeafb diff: move diff.c to diff-lib.c to make room.
Now I am not doing any real "git-diff in C" yet, but this would
help before doing so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 15:38:14 -07:00
Jonas Fonseca 8f2b72a936 Add git-annotate(1) and git-blame(1)
[jc: with entries in git.txt]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-18 12:06:55 -07:00
A Large Angry SCM e6bfaf3e33 Makefile fixups.
Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16 20:42:37 -07:00
Junio C Hamano 8c989ec528 Makefile: $(MAKE) check-docs
This target lists undocumented commands, and/or whose document
is not referenced from the main git documentation.

For now, there are some exceptions I added primarily because I
lack the energy to document them myself:

 - merge backends (we should really document them)
 - ssh-push/ssh-pull (does anybody still use them?)
 - annotate and blame (maybe after one of them eats the other ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13 00:21:47 -07:00
Junio C Hamano b5b1442ac3 Merge branch 'ds/index' into next
* ds/index:
  Replace index() with strchr().
  Solaris 9 also wants our own unsetenv/setenv.
  Retire git-log.sh (take #3)
2006-04-11 11:52:36 -07:00
Dennis Stosberg 40d88d4fa3 Solaris 9 also wants our own unsetenv/setenv.
[jc: the original had "index() is evil" but that should be a
separate patch.]
2006-04-11 11:42:26 -07:00
Junio C Hamano f94fbbee90 Retire git-log.sh (take #3)
Do not install built-in commands as separate files -- use
hardlinks instead.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-11 11:29:36 -07:00
Junio C Hamano 6b32ee2381 Merge branch 'jc/withraw' into next
* jc/withraw:
  diff-* --patch-with-raw
  Retire git-log.sh (take#2)
  Retire git-log.sh
  Retire diffcore-pathspec.
  Improve the git-diff-tree -c/-cc documentation
2006-04-10 19:44:35 -07:00
Junio C Hamano 944e3a88fe Retire git-log.sh (take#2)
... and install a replacement properly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 19:40:59 -07:00
Junio C Hamano 91730800e9 Retire git-log.sh
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 17:52:17 -07:00
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