Commit Graph

4259 Commits

Author SHA1 Message Date
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
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
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
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 71459c193d.

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,
246cc52f38 adjusted the old test
so that we do not expect to see trees in its output.  Later,
with 0f8f45cb4a, 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
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
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 0032d548db commit)
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
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
Junio C Hamano
c6df547a41 Merge branch 'sh/daemon'
* sh/daemon:
  socksetup: don't return on set_reuse_addr() error
2006-04-24 02:08:28 -07:00
Junio C Hamano
2effe71b7c Merge branch 'jc/cc-stat'
* jc/cc-stat:
  Fix "git show --stat"
2006-04-24 02:06:40 -07:00
Junio C Hamano
cdb63506a0 Merge branch 'jc/unresolve'
* jc/unresolve:
  git-update-index --unresolve
  Add git-unresolve <paths>...
2006-04-24 02:05:55 -07:00
Junio C Hamano
3a403e49b9 Merge branch 'jc/color'
* jc/color:
  Add colordiff for git to contrib/colordiff.
2006-04-24 02:05:07 -07:00
Junio C Hamano
a549e11cc2 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Let git-rev-list do the argument list parsing
2006-04-24 01:39:01 -07:00
Paul Mackerras
61e56c8823 gitk: Let git-rev-list do the argument list parsing
This is a fix for a problem reported by Jim Radford where an argument
list somewhere overflows on repositories with lots of tags.  In fact
it's now unnecessary to use git-rev-parse since git-rev-list can take
all the arguments that git-rev-parse can.  This is inspired by but not
the same as the solutions suggested by Jim Radford and Linus Torvalds.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-04-23 18:00:24 +10:00
Alex Riesen
227bdb186f make update-index --chmod work with multiple files and --stdin
The patch makes "--chmod=-x" and "--chmod=+x" act like "--add"
and "--remove" to affect the behaviour of the command for the
rest of the path parameters, not just the following one.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-23 00:47:03 -07:00
Junio C Hamano
5c21ac0e7c Libified diff-index: backward compatibility fix.
"diff-index -m" does not mean "do not ignore merges", but means
"pretend missing files match the index".

The previous round tried to address this, but failed because
setup_revisions() ate "-m" flag before the caller had a chance
to intervene.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-22 04:03:32 -07:00
Junio C Hamano
e09ad6e1e3 Libify diff-index.
The second installment to libify diff brothers.  The pathname
arguments are checked more strictly than before because we now
use the revision.c::setup_revisions() infrastructure.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-22 02:43:00 -07:00
Junio C Hamano
6973dcaee7 Libify diff-files.
This is the first installment to libify diff brothers.

The updated diff-files uses revision.c::setup_revisions()
infrastructure to parse its command line arguments, which means
the pathname arguments are checked more strictly than before.
The tests are adjusted to separate possibly missing paths from
the rest of arguments with double-dashes, to show the kosher
way.

As Linus pointed out, renaming diff.c to diff-lib.c was simply
stupid, so I am renaming it back.  The new diff-lib.c is to
contain pieces extracted from diff brothers.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-22 02:37:45 -07:00
Junio C Hamano
96ab4f4e7a Fix "git show --stat"
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 22:24:34 -07:00
Junio C Hamano
96afa0764e Add colordiff for git to contrib/colordiff.
I hacked it up to teach it the git extended diff headers, made
it not to read the whole patch in the array.

Also, the original program, when arguments are given, ran "diff"
with the given arguments and showed the output from it.  Of
course, I changed it to run "git diff" ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 22:24:30 -07:00
Junio C Hamano
e64961b057 Merge branch 'jc/diff'
* jc/diff:
  diff --stat: do not drop rename information.
2006-04-21 22:03:07 -07:00
Junio C Hamano
08df61713c Makefile: dependency for builtin-help.o
builtin-help.c wants to include common-cmds.h which is a
generated file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 21:56:31 -07:00
Linus Torvalds
70827b15bf Split up builtin commands into separate files from git.c
Right now it split it into "builtin-log.c" for log-related commands
("log", "show" and "whatchanged"), and "builtin-help.c" for the
informational commands (usage printing and "help" and "version").

This just makes things easier to read, I find.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 13:14:41 -07:00
Junio C Hamano
285755127a Merge branch 'fix'
* fix:
  git-log produces no output
2006-04-21 13:14:30 -07:00
Linus Torvalds
34fd1c9ac5 git-log produces no output
When $PAGER is set to 'less -i', we used to fail because we
assumed the $PAGER is a command and simply exec'ed it.

Try exec first, and then run it through shell if it fails.  This
allows even funkier PAGERs like these ;-):

	PAGER='sed -e "s/^/`date`: /" | more'
	PAGER='contrib/colordiff.perl | less -RS'

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 13:00:10 -07:00
Junio C Hamano
3c144afe50 Merge branch 'fix'
* fix:
  fix pack-object buffer size
  mailinfo: decode underscore used in "Q" encoding properly.
  Reintroduce svn pools to solve the memory leak.
  pack-objects: do not stop at object that is "too small"
2006-04-21 00:45:40 -07:00
Nicolas Pitre
0dec30b978 fix pack-object buffer size
The input line has 40 _chars_ of sha1 and no 20 _bytes_. It should also
account for the space before the pathname, and the terminating \n and \0.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 00:45:10 -07:00
Junio C Hamano
757319309a mailinfo: decode underscore used in "Q" encoding properly.
Quoted-Printable (RFC 2045) and the "Q" encoding (RFC 2047) are
subtly different; the latter is used on the mail header and an
underscore needs to be decoded to 0x20.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 00:09:28 -07:00
Santi_Béjar
d598075e52 Reintroduce svn pools to solve the memory leak.
Introduced in 4802426.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-20 23:41:24 -07:00
Junio C Hamano
f527cb8c38 pack-objects: do not stop at object that is "too small"
Because we sort the delta window by name-hash and then size,
hitting an object that is too small to consider as a delta base
for the current object does not mean we do not have better
candidate in the window beyond it.

Noticed by Shawn Pearce, analyzed by Nico, Linus and me.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-20 23:36:22 -07:00
Junio C Hamano
0080f50eb3 Merge branch 'fix'
* fix:
  git-commit --amend: two fixes.
2006-04-20 02:52:04 -07:00
Junio C Hamano
6a74642c50 git-commit --amend: two fixes.
When running "git commit --amend" only to fix the commit log
message without any content change, we mistakenly showed the
git-status output that says "nothing to commit" without
commenting it out.

If you have already run update-index but you want to amend the
top commit, "git commit --amend --only" without any paths should
have worked, because --only means "starting from the base
commit, update-index these paths only to prepare the index to
commit, and perform the commit".  However, we refused -o without
paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-20 02:51:12 -07:00
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
44aad15f0d diff --stat: do not drop rename information.
When a verbatim rename or copy is detected, we did not show
anything on the "diff --stat" for the filepair.  This makes it
to show the rename information.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 23:22:19 -07:00