1
0
mirror of https://github.com/git/git.git synced 2024-10-05 16:11:20 +02:00
Commit Graph

4493 Commits

Author SHA1 Message Date
Junio C Hamano
0fe7c1de16 built-in diff: assorted updates.
"git diff(n)" without --base, --ours, etc. defaults to --cc,
which usually is the same as -p unless you are in the middle of
a conflicted merge, just like the shell script version.

"git diff(n) blobA blobB path" complains and dies.

"git diff(n) tree0 tree1 tree2...treeN" does combined diff that
shows a merge of tree1..treeN to result in tree0.

Giving "-c" option to any command that defaults to "--cc" turns
off dense-combined flag.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-29 01:32:53 -07:00
Junio C Hamano
65056021f2 built-in diff.
This starts to replace the shell script version of "git diff".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28 23:20:52 -07:00
Nicolas Pitre
3dc5a9e4cd replace adler32 with Rabin's polynomial in diff-delta
This brings another small repacking speedup for sensibly the same pack
size.  On the Linux kernel repo, git-repack -a -f is 3.7% faster for a
0.4% larger pack.

Credits to Geert Bosch who brought the Rabin's polynomial idea to my
attention.

This also eliminate the issue of adler32() reading past the data buffer,
as noticed by Johannes Schindelin.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28 22:41:31 -07:00
Junio C Hamano
89719209f4 Merge branch 'fix'
* fix:
  Fix trivial typo in git-log man page.
  Properly render asciidoc "callouts" in git man pages.
  Fix up remaining man pages that use asciidoc "callouts".
  Update the git-branch man page to include the "-r" option,
  annotate: display usage information if no filename was given
  annotate: fix warning about uninitialized scalar
  git-am --resolved: more usable error message.
2006-04-28 16:57:32 -07:00
Sean Estabrooks
aa6bf0eb64 Fix trivial typo in git-log man page.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
2006-04-28 14:31:53 -07:00
Sean Estabrooks
776e994af5 Properly render asciidoc "callouts" in git man pages.
Adds an xsl fragment to render docbook callouts when
converting to man page format.  Update the Makefile
to have "xmlto" use it when generating man pages.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
2006-04-28 14:31:51 -07:00
Sean Estabrooks
48aeecdcc1 Fix up remaining man pages that use asciidoc "callouts".
Unfortunately docbook does not allow a callout to be
referenced from inside a callout list description.
Rewrite one paragraph in git-reset man page to work
around this limitation.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
2006-04-28 14:31:36 -07:00
Sean Estabrooks
2eaf273d51 Update the git-branch man page to include the "-r" option,
and fix up asciidoc "callouts"

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
2006-04-28 14:31:18 -07:00
Matthias Kestenholz
fe77bb1a02 annotate: display usage information if no filename was given
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
2006-04-28 14:29:04 -07:00
Matthias Kestenholz
d0ad165366 annotate: fix warning about uninitialized scalar
Use of uninitialized value in scalar chomp at
./git-annotate.perl line 212, <$kid> chunk 4.

Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
2006-04-28 14:28:28 -07:00
Junio C Hamano
c1d1128bef git-am --resolved: more usable error message.
After doing the hard work of hand resolving the conflicts in the
working tree, if the user forgets to run update-index to mark
the paths that have been resolved, the command gave an
unfriendly "fatal: git-write-tree: not able to write tree" error
message.  Catch the situation early and give more meaningful
message and suggestion.

Noticed and suggested by Len Brown.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28 02:32:44 -07:00
Junio C Hamano
c74320872b built-in count-objects.
Also it learned to do -v (verbose) to report:

	- number of loose objects
	- disk occupied by loose objects
	- number of objects in local packs
	- number of loose objects that are also in pack
	- unrecognised garbage in .git/objects/??/.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 21:35:27 -07:00
Junio C Hamano
9a8b6a0a9d pack-objects: update size heuristucs.
We used to omit delta base candidates that is much bigger than
the target, but delta size does not grow when we delete more, so
that was not a very good heuristics.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 19:31:46 -07:00
Junio C Hamano
bd346f105d Merge branch 'fix'
* fix:
  verify-pack: check integrity in a saner order.
2006-04-27 15:42:32 -07:00
Junio C Hamano
55e1805dff verify-pack: check integrity in a saner order.
Check internal integrity to report corrupt pack or idx, and
then check cross-integrity between idx and pack.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 15:42:17 -07:00
Junio C Hamano
e5de2c5e30 Merge branch 'pb/config'
* pb/config:
  git-cvsserver: typofixes
  Deprecate usage of git-var -l for getting config vars list
  git-repo-config --list support
2006-04-27 12:23:01 -07:00
Junio C Hamano
bd4bd2261b Merge branch 'jc/diffstat'
* jc/diffstat:
  diff --stat: show complete rewrites consistently.
2006-04-27 11:58:33 -07:00
Linus Torvalds
83aa18eade Fix "git help -a" terminal autosizing
When I split out the builtin commands into their own files, I left the
include of <sys/ioctl.h> in git.c rather than moving it to the file that
needed it (builtin-help.c).

Nobody seems to have noticed, because everything still worked, but because
the TIOCGWINSZ macro was now no longer defined when compiling the
"term_columns()" function, it would no longer automatically notice the
terminal size unless your system used the ancient "COLUMNS" environment
variable approach.

Trivially fixed by just moving the header include to the file that
actually needs it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 11:45:39 -07:00
Paul Mackerras
7fcceed7a0 gitk: Use a text widget for the file list
This lets us do things like highlighting all the entries for which
the corresponding part of the diff is at least partly visible in the
commit/patch display window, and in future it will let us display
the file list in a hierarchical form rather than as a flat file list.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-27 19:21:49 +10:00
Junio C Hamano
61678d87c2 diff-index: fix compilation warnings.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 01:59:00 -07:00
Nicolas Pitre
f6c7081aa9 use delta index data when finding best delta matches
This patch allows for computing the delta index for each base object
only once and reuse it when trying to find the best delta match.

This should set the mark and pave the way for possibly better delta
generator algorithms.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 21:23:03 -07:00
Junio C Hamano
9af0b8dbe2 t0000-basic: more commit-tree tests.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 18:25:15 -07:00
Nick Hengeveld
093b068891 git-fetch: resolve remote symrefs for HTTP transport
git-fetch validates that a remote ref resolves to a SHA1 prior to calling
git-http-fetch.  This adds support for resolving a few levels of symrefs
to get to the SHA1.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 17:16:11 -07:00
sean
031321c654 Add --continue and --abort options to git-rebase.
git rebase [--onto <newbase>] <upstream> [<branch>]
  git rebase --continue
  git rebase --abort

Add "--continue" to restart the rebase process after
manually resolving conflicts.  The user is warned if
there are still differences between the index and the
working files.

Add "--abort" to restore the original branch, and
remove the .dotest working files.

Some minor additions to the git-rebase documentation.

[jc: fix that applies to the maintenance track has been dealt
 with separately.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 17:10:33 -07:00
Junio C Hamano
ea92f41ff9 revision parsing: make "rev -- paths" checks stronger.
If you don't have a "--" marker, then:

 - all of the arguments we are going to assume are pathspecs
   must exist in the working tree.

 - none of the arguments we parsed as revisions could be
   interpreted as a filename.

so that there really isn't any possibility of confusion in case
somebody does have a revision that looks like a pathname too.

The former rule has been in effect; this implements the latter.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 17:08:44 -07:00
Junio C Hamano
69bcc43eca Merge branch 'fix'
* fix:
  commit-tree.c: check_valid() microoptimization.
  Fix filename verification when in a subdirectory
  rebase: typofix.
  socksetup: don't return on set_reuse_addr() error
2006-04-26 17:08:00 -07:00
Junio C Hamano
5981e09999 commit-tree.c: check_valid() microoptimization.
There is no point reading the whole object just to make sure it exists and
it is of the expected type.  We added sha1_object_info() for such need
after this code was written, so use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 16:55:25 -07:00
Linus Torvalds
e23d0b4a4a Fix filename verification when in a subdirectory
When we are in a subdirectory of a git archive, we need to take the prefix
of that subdirectory into accoung when we verify filename arguments.

Noted by Matthias Lederhofer

This also uses the improved error reporting for all the other git commands
that use the revision parsing interfaces, not just git-rev-parse. Also, it
makes the error reporting for mixed filenames and argument flags clearer
(you cannot put flags after the start of the pathname list).

[jc: with fix to a trivial typo noticed by Timo Hirvonen]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 12:16:21 -07:00
Junio C Hamano
b176e6ba5b rebase: typofix.
Noticed by Sean.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 12:16:19 -07:00
Junio C Hamano
3496277a56 commit-tree: allow generic object name for the tree as well.
We use get_sha1() for -p (parent) objects, but still used
get_sha1_hex() for the tree.  Just to be consistent, allow
extended SHA1 expression for the tree object name.

Note that this is not to encourage funky things like this:

	git-commit-tree HEAD^{tree} -p HEAD

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 03:18:51 -07:00
Junio C Hamano
2d86d2c6fc Makefile: remove and create xdiff library from scratch.
... in the same spirit as 71459c193d04870076efa0a387c317390b53e3e2.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 03:12:58 -07:00
Junio C Hamano
fdeb6bf55b t0000-basic: Add ls-tree recursive test back.
When we updated ls-tree recursive output to omit the tree nodes,
246cc52f388cae8ca99e5a12b8458c9bfa467765 adjusted the old test
so that we do not expect to see trees in its output.  Later,
with 0f8f45cb4a7e664b396f73c25891da46b953b8b8, we added back the
ability to show both with -t option, but we forgot to update the
test as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 02:27:59 -07:00
Junio C Hamano
5348b6e7f4 git-cvsserver: typofixes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-25 23:59:28 -07:00
Junio C Hamano
710158e3ca diff --stat: show complete rewrites consistently.
The patch format shows complete rewrite as deletion of all old lines
followed by addition of all new lines.  Count lines consistenly with
that when doing diffstat.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-25 23:40:09 -07:00
Paul Mackerras
cb303a949f Merge branch 'new' 2006-04-26 16:32:59 +10:00
Junio C Hamano
e9b5b75ca8 Merge branch 'jc/diff'
* jc/diff:
  Libified diff-index: backward compatibility fix.
  Libify diff-index.
  Libify diff-files.
2006-04-25 23:12:21 -07:00
Junio C Hamano
71459c193d Makefile: remove and create libgit.a from scratch.
Foolishly I renamed diff.o around which caused an old diff.o
taken out of libgit.a and got linked into resulting binary and
exhibited mysterious breakage for many people.  This borrows
from the kernel Makefile (scripts/Makefile.build) to first remove
the target and then recreate.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-25 23:11:17 -07:00
Martin Langhoff
992793c832 git-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups. 2006-04-26 12:26:16 +12:00
Josef Weidendorfer
a970fcf249 [PATCH] gitk: Add a visual tag for remote refs
This patch partly changes the background color for remote refs.
It makes it easy to quickly distinguish remote refs from local
developer branches.

I ignore remote HEADs, as these really should be drawn as
aliases to other heads. But there is no simple way to
detect that HEADs really are aliases for other refs via
"git-ls-remote".

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-25 22:44:47 +10:00
Paul Mackerras
d16c0812a9 gitk: add menu item for editing the current view
This allows the user to change the name of the view, whether it is
permanent, and the list of files/directories for the view.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-25 21:21:10 +10:00
Paul Mackerras
a90a6d249b gitk: Implement "permanent" views (stored in ~/.gitk)
With this the user can now mark a view as "permanent" and it will
appear in the list every time gitk is started (until it is deleted).
Also tidied up the view definition window, and changed the view
menu to use radiobuttons for the view selections so there is some
feedback as to which is the current view.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-25 17:12:46 +10:00
Serge E. Hallyn
7d09fbe4ab socksetup: don't return on set_reuse_addr() error
The set_reuse_addr() error case was the only error case in
socklist() where we returned rather than continued.  Not sure
why.  Either we must free the socklist, or continue.  This patch
continues on error.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 0032d548db56eac9ea09b4ba05843365f6325b85 commit)
v1.3.1
2006-04-24 23:07:54 -07:00
Petr Baudis
e1cbc46d12 Deprecate usage of git-var -l for getting config vars list
This has been an unfortunate sideway in the git API evolution.
We use git-repo-config for all the other .git/config interaction
so let's also use git-repo-config -l for the variable listing.

Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-04-24 22:29:36 -07:00
Petr Baudis
de791f15a1 git-repo-config --list support
This adds git-repo-config --list (or git-repo-config -l) support,
similar to what git-var -l does now (to be phased out so that we
have a single sane interface to the config file instead of fragmented
and confused API).

Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-04-24 22:29:33 -07:00
Nicolas Pitre
08abe669c0 split the diff-delta interface
This patch splits the diff-delta interface into index creation and delta
generation.  A wrapper is provided to preserve the diff-delta() call.

This will allow for an optimization in pack-objects.c where the source
object could be fixed and a full window of objects tentatively tried
against
that same source object without recomputing the source index each time.

This patch only restructure things, plus a couple cleanups for good
measure. There is no performance change yet.

Signed-off-by: Nicolas Pitre <nico@cam.org>
2006-04-24 22:27:33 -07:00
Junio C Hamano
36932eab77 Merge branch 'fix'
* fix:
  Document the configuration file
  Document git-var -l listing also configuration variables
  rev-parse: better error message for ambiguous arguments
2006-04-24 22:26:57 -07:00
Petr Baudis
1ab661ddb7 Document the configuration file
This patch adds a Documentation/config.txt file included by git-repo-config
and currently aggregating hopefully all the available git plumbing / core
porcelain configuration variables, as well as briefly describing the format.

It also updates an outdated bit of the example in git-repo-config(1).

Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-04-24 22:26:37 -07:00
Petr Baudis
4ee6bc9913 Document git-var -l listing also configuration variables
Signed-off-by: Petr Baudis <pasky@suse.cz>
2006-04-24 22:26:34 -07:00
Paul Mackerras
3e1a70d925 rev-parse: better error message for ambiguous arguments
Currently, if git-rev-parse encounters an argument that is neither a
recognizable revision name nor the name of an existing file or
directory, and it hasn't encountered a "--" argument, it prints an
error message saying "No such file or directory".  This can be
confusing for users, including users of programs such as gitk that
use git-rev-parse, who may then think that they can't ask about the
history of files that no longer exist.

This makes it print a better error message, one that points out the
ambiguity and tells the user what to do to fix it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-24 22:22:29 -07:00
Junio C Hamano
be02b3c53e Merge branch 'ar/chmod-series'
* ar/chmod-series:
  make update-index --chmod work with multiple files and --stdin
2006-04-24 02:08:35 -07:00