Paolo Bonzini [Fri, 2 Mar 2007 20:53:33 +0000 (21:53 +0100)]
git-config: document --rename-section, provide --remove-section
This patch documents the previously undocumented option --rename-section
and adds a new option to zap an entire section.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 4 Mar 2007 03:47:46 +0000 (19:47 -0800)]
Merge branch 'maint'
* maint:
Unset NO_C99_FORMAT on Cygwin.
Fix a "pointer type missmatch" warning.
Fix some "comparison is always true/false" warnings.
Fix an "implicit function definition" warning.
Fix a "label defined but unreferenced" warning.
Document the config variable format.suffix
git-merge: fail correctly when we cannot fast forward.
builtin-archive: use RUN_SETUP
Fix git-gc usage note
Ramsay Jones [Sat, 3 Mar 2007 18:28:39 +0000 (18:28 +0000)]
Unset NO_C99_FORMAT on Cygwin.
This should only be set based on the capability of your
compiler/library to support c99 format specifiers. In this
case the version of gcc/newlib and indirectly the version
of Cygwin. It should probably only be set in your config.mak
file.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Ramsay Jones [Sat, 3 Mar 2007 18:29:03 +0000 (18:29 +0000)]
Fix a "pointer type missmatch" warning.
In particular, the second parameter in the call to iconv() will
cause this warning if your library declares iconv() with the
second (input buffer pointer) parameter of type const char **.
This is the old prototype, which is none-the-less used by the
current version of newlib on Cygwin. (It appears in old versions
of glibc too).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Ramsay Jones [Sat, 3 Mar 2007 18:28:57 +0000 (18:28 +0000)]
Fix some "comparison is always true/false" warnings.
On Cygwin the wchar_t type is an unsigned short (16-bit) int.
This results in the above warnings from the return statement in
the wcwidth() function (in particular, the expressions involving
constants with values larger than 0xffff). Simply replace the
use of wchar_t with an unsigned int, typedef-ed as ucs_char_t.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Ramsay Jones [Sat, 3 Mar 2007 18:28:52 +0000 (18:28 +0000)]
Fix an "implicit function definition" warning.
The function at issue being initgroups() from the <grp.h> header
file. On Cygwin, setting _XOPEN_SOURCE suppresses the definition
of initgroups(), which causes the warning while compiling daemon.c.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Ramsay Jones [Sat, 3 Mar 2007 18:28:46 +0000 (18:28 +0000)]
Fix a "label defined but unreferenced" warning.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sat, 3 Mar 2007 23:17:23 +0000 (00:17 +0100)]
Document the config variable format.suffix
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sat, 3 Mar 2007 21:04:54 +0000 (13:04 -0800)]
git-merge: fail correctly when we cannot fast forward.
When we cannot fast forward the working tree and the current
branch, git-merge did not exit with non-zero status.
Noticed by Larry Streepy, the section to be fixed identfied by
Johannes Schindelin.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sat, 3 Mar 2007 16:14:25 +0000 (17:14 +0100)]
builtin-archive: use RUN_SETUP
It used to roll its own setup.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Kestenholz [Sat, 3 Mar 2007 17:28:14 +0000 (18:28 +0100)]
Fix git-gc usage note
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sat, 3 Mar 2007 00:57:53 +0000 (16:57 -0800)]
Merge branch 'maint'
* maint:
Fix quoting in update hook template
Julian Phillips [Sat, 3 Mar 2007 00:31:17 +0000 (00:31 +0000)]
git-branch: document new --no-abbrev option
Add the new --no-abbrev option to the man page for the git-branch command.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Julian Phillips [Sat, 3 Mar 2007 00:31:16 +0000 (00:31 +0000)]
git-branch: improve abbreviation of sha1s in verbose mode
git-branch has an --abbrev= command line option, but it does
no checking of the input. Take the argument parsing code from
setup_revisions in revisions.c, and also the code for parsing
the --no-abbrev option.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Fri, 2 Mar 2007 14:28:00 +0000 (15:28 +0100)]
print_wrapped_text: fix output for negative indent
When providing a negative indent, it means that -indent columns were
already printed. Fix a bug where the function ate the first character
if already the first word did not fit into the first line.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Gerrit Pape [Fri, 2 Mar 2007 12:20:10 +0000 (12:20 +0000)]
Fix quoting in update hook template
By default allowunannotated is unset in the repo config, hence
$allowunannotated is empty, and must be quoted to not break the syntax.
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Andy Parkins [Fri, 2 Mar 2007 19:29:20 +0000 (19:29 +0000)]
Sample update hook: typofix and modernization to use "git log"
Instead of using antiquated "git-rev-parse | git-rev-list"
pipeline, it is easier to use "git-rev-list" or "git-log" these
days, as Linus points out.
While we are at it, fix the typo on variable name $newref that
should be $newrev.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Fri, 2 Mar 2007 08:37:12 +0000 (00:37 -0800)]
Merge branch 'js/commit-format'
* js/commit-format:
show_date(): rename the "relative" parameter to "mode"
Actually make print_wrapped_text() useful
pretty-formats: add 'format:<string>'
Junio C Hamano [Fri, 2 Mar 2007 08:31:51 +0000 (00:31 -0800)]
Merge branch 'maint'
* maint:
Another memory overrun in http-push.c
fetch.o depends on the headers, too.
Documentation: Correct minor typo in git-add documentation.
Documentation/git-send-email.txt: Fix labeled list formatting
Documentation/git-quiltimport.txt: Fix labeled list formatting
Documentation/build-docdep.perl: Fix dependencies for included asciidoc files
Eygene Ryabinkin [Thu, 1 Mar 2007 16:09:12 +0000 (19:09 +0300)]
Another memory overrun in http-push.c
Use of strlcpy() are wrong, as the source buffer at these
locations may not be NUL-terminated.
Johannes Schindelin [Tue, 27 Feb 2007 23:55:48 +0000 (00:55 +0100)]
fetch.o depends on the headers, too.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Christian Schlotter [Thu, 1 Mar 2007 17:08:17 +0000 (18:08 +0100)]
Documentation: Correct minor typo in git-add documentation.
Signed-off-by: Christian Schlotter <schlotter@users.sourceforge.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Sergey Vlasov [Thu, 1 Mar 2007 19:41:17 +0000 (22:41 +0300)]
Documentation/git-svn.txt: Fix formatting errors
Fix some formatting problems:
- Some list labels were missing their "::" characters.
- Some of continuation paragraphs in labeled lists were incorrectly
formatted as literal paragraphs.
- In one case "[verse]" was missing before the config key list.
- The "Basic Examples" section was incorrectly nested inside the
"Config File-Only Options" section.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Sergey Vlasov [Thu, 1 Mar 2007 19:41:16 +0000 (22:41 +0300)]
Documentation/git-send-email.txt: Fix labeled list formatting
Mark continuation paragraphs of list entries as such to avoid
getting literal paragraphs instead.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Sergey Vlasov [Thu, 1 Mar 2007 19:41:15 +0000 (22:41 +0300)]
Documentation/git-quiltimport.txt: Fix labeled list formatting
Mark the continuation paragraph of a list entry as such to avoid
getting a literal paragraph instead.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Sergey Vlasov [Thu, 1 Mar 2007 19:41:14 +0000 (22:41 +0300)]
Documentation/build-docdep.perl: Fix dependencies for included asciidoc files
Adding dependencies on included files to the generated man pages is
wrong - includes are processed by asciidoc, therefore the intermediate
Docbook XML files really depend on included files. Because of these
wrong dependencies the man pages were not rebuilt properly if the
intermediate XML files were left in the tree.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Michael Coleman [Thu, 1 Mar 2007 05:14:23 +0000 (23:14 -0600)]
fix various doc typos
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 23:06:38 +0000 (15:06 -0800)]
Add recent changes to draft 1.5.1 release notes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 22:56:08 +0000 (14:56 -0800)]
Merge branch 'js/commit-by-name'
* js/commit-by-name:
object name: introduce ':/<oneline prefix>' notation
Junio C Hamano [Wed, 28 Feb 2007 22:38:36 +0000 (14:38 -0800)]
Merge branch 'js/bundle'
* js/bundle:
bundle: reword missing prerequisite error message
git-bundle: record commit summary in the prerequisite data
git-bundle: fix 'create --all'
git-bundle: avoid fork() in verify_bundle()
git-bundle: assorted fixes
Add git-bundle: move objects and references by archive
Junio C Hamano [Wed, 28 Feb 2007 22:18:57 +0000 (14:18 -0800)]
Merge branch 'maint'
* maint:
Start preparing Release Notes for 1.5.0.3
Documentation: git-remote add [-t <branch>] [-m <branch>] [-f] name url
Include config.mak in doc/Makefile
git.el: Set the default commit coding system from the repository config.
git-archimport: support empty summaries, put summary on a single line.
http-push.c::lock_remote(): validate all remote refs.
git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs.
Junio C Hamano [Wed, 28 Feb 2007 22:17:45 +0000 (14:17 -0800)]
Start preparing Release Notes for 1.5.0.3
Junio C Hamano [Wed, 28 Feb 2007 22:05:42 +0000 (14:05 -0800)]
Documentation: git-remote add [-t <branch>] [-m <branch>] [-f] name url
Signed-off-by: Junio C Hamano <junkio@cox.net>
Uwe Kleine-König [Wed, 28 Feb 2007 20:57:42 +0000 (21:57 +0100)]
Include config.mak in doc/Makefile
config.mak.autogen is already there. Without this change it is not
possible to override mandir in config.mak.
Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alexandre Julliard [Wed, 28 Feb 2007 19:59:48 +0000 (20:59 +0100)]
git.el: Set the default commit coding system from the repository config.
If not otherwise specified, take the default coding system for commits
from the 'i18n.commitencoding' repository configuration value.
Also set the buffer-file-coding-system variable in the log buffer to
make the selected coding system visible on the modeline.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Paolo Bonzini [Wed, 28 Feb 2007 20:02:02 +0000 (21:02 +0100)]
git-archimport: support empty summaries, put summary on a single line.
Don't fail if the summary line in an arch commit is empty. In this case,
try to use the first line in the commit message followed by an ellipsis.
In addition, if the summary is multi-line, it is joined on a single line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Eygene Ryabinkin [Wed, 28 Feb 2007 20:12:02 +0000 (12:12 -0800)]
http-push.c::lock_remote(): validate all remote refs.
Starting from offset 11 might have been good back when it was
only used for updating "refs/heads/*", but it is used to update
"info/refs" and "refs/tags/*" as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 19:57:39 +0000 (11:57 -0800)]
index_fd(): convert blob only if it is a regular file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 19:52:04 +0000 (11:52 -0800)]
index_fd(): pass optional path parameter as hint for blob conversion
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 19:45:56 +0000 (11:45 -0800)]
index_fd(): use enum object_type instead of type name string.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 19:58:27 +0000 (11:58 -0800)]
Merge branch 'np/types'
* np/types:
Cleanup check_valid in commit-tree.
make sure enum object_type is signed
get rid of lookup_object_type()
convert object type handling from a string to a number
formalize typename(), and add its reverse type_from_string()
sha1_file.c: don't ignore an error condition in sha1_loose_object_info()
sha1_file.c: cleanup "offset" usage
sha1_file.c: cleanup hdr usage
Gerrit Pape [Wed, 28 Feb 2007 12:35:39 +0000 (12:35 +0000)]
git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs.
Unless the -c option is given, and the commit to cvs was successful,
.msg shouldn't be deleted to be able to run the command suggested by
git-cvsexportcommit.
See http://bugs.debian.org/412732
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 28 Feb 2007 06:23:40 +0000 (22:23 -0800)]
Merge branch 'mc/sendmail'
* mc/sendmail:
git-send-email: abort/usage on bad option
Junio C Hamano [Wed, 28 Feb 2007 06:18:22 +0000 (22:18 -0800)]
Merge branch 'js/diff-ni' (early part)
* 'js/diff-ni' (early part):
diff --no-index: also imitate the exit status of diff(1)
Fix typo: do not show name1 when name2 fails
Teach git-diff-files the new option `--no-index`
run_diff_{files,index}(): update calling convention.
update-index: do not die too early in a read-only repository.
git-status: do not be totally useless in a read-only repository.
Junio C Hamano [Wed, 28 Feb 2007 06:15:42 +0000 (22:15 -0800)]
Merge branch 'maint'
* maint:
builtin-fmt-merge-msg: fix bugs in --file option
index-pack: Loop over pread until data loading is complete.
blameview: Fix the browse behavior in blameview
Fix minor typos/grammar in user-manual.txt
Correct ordering in git-cvsimport's option documentation
git-show: Reject native ref
Fix git-show man page formatting in the EXAMPLES section
Michael Coleman [Wed, 28 Feb 2007 05:44:42 +0000 (23:44 -0600)]
builtin-fmt-merge-msg: fix bugs in --file option
If --file's argument is missing, don't crash. If it cannot be opened,
die with an error message.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 28 Feb 2007 04:47:19 +0000 (23:47 -0500)]
index-pack: Loop over pread until data loading is complete.
A filesystem might not be able to completely supply our pread
request in one system call, such as if we are reading data from a
network file system and the requested length is just simply huge.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Aneesh Kumar [Mon, 26 Feb 2007 08:31:57 +0000 (14:01 +0530)]
blameview: Fix the browse behavior in blameview
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Tue, 27 Feb 2007 15:00:33 +0000 (10:00 -0500)]
Cleanup check_valid in commit-tree.
This routine should be using the object_type enum rather than a
string comparsion, as the expected type is always supplied and is
known at compile time.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Wed, 28 Feb 2007 01:38:31 +0000 (20:38 -0500)]
make sure enum object_type is signed
This allows for keeping the common idiom which consists of using
negative values to signal error conditions by ensuring that the enum
will be a signed type.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Michael Coleman [Wed, 28 Feb 2007 04:47:54 +0000 (22:47 -0600)]
git-send-email: abort/usage on bad option
Instead of proceeding, abort and give usage message when a bad option
is seen.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Michael Coleman [Wed, 28 Feb 2007 04:13:09 +0000 (22:13 -0600)]
Fix minor typos/grammar in user-manual.txt
Signed-off-by: Junio C Hamano <junkio@cox.net>
Michael Poole [Wed, 28 Feb 2007 03:27:44 +0000 (22:27 -0500)]
Correct ordering in git-cvsimport's option documentation
A pair of commits on January 8th added option documentation (for -a,
-S and -L) in the middle of the documentation for the -A option. This
makes -A's documentation contiguous again.
Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Tue, 27 Feb 2007 15:21:04 +0000 (16:21 +0100)]
show_date(): rename the "relative" parameter to "mode"
Now, show_date() can print three different kinds of dates: normal,
relative and short (%Y-%m-%s) dates.
To achieve this, the "int relative" was changed to "enum date_mode
mode", which has three states: DATE_NORMAL, DATE_RELATIVE and
DATE_SHORT.
Since existing users of show_date() only call it with relative_date
being either 0 or 1, and DATE_NORMAL and DATE_RELATIVE having these
values, no behaviour is changed.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Tue, 27 Feb 2007 15:20:31 +0000 (16:20 +0100)]
Actually make print_wrapped_text() useful
Now, it returns the current column, does not add a newline, and you can
pass a negative indent, to indicate that the indent was already printed.
With this, you can actually continue in the middle of a paragraph, not
having to print everything into a buffer first.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Linus Torvalds [Wed, 28 Feb 2007 00:22:52 +0000 (16:22 -0800)]
git-show: Reject native ref
So when we do
git show v1.4.4..v1.5.0
that's an illogical thing to do, since "git show" is defined to be a
non-revision-walking action, which means the range operator be pointless
and wrong. The fact that we happily accept it (and then _only_ show
v1.5.0, which is the positive end of the range) is quite arguably not very
logical.
We should complain, and say that you can only do "no_walk" with positive
refs. Negative object refs really don't make any sense unless you walk
the obejct list (or you're "git diff" and know about ranges explicitly).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Andy Parkins [Tue, 27 Feb 2007 13:46:55 +0000 (13:46 +0000)]
cvsserver: Make always-binary mode a config file option
The config option gitcvs.allbinary may be set to force all entries to
get the -kb flag.
In the future the gitattributes system will probably be a more
appropriate way of doing this, but that will easily slot in as the
entries lines sent to the CVS client now have their kopts set via the
function kopts_from_path().
In the interim it might be better to not just have a all-or-nothing
approach, but rather detect based on file extension (or file contents?).
That would slot in easily here as well. However, I personally prefer
everything to be binary-safe, so I just switch the switch.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Andy Parkins [Tue, 27 Feb 2007 12:49:09 +0000 (12:49 +0000)]
cvsserver: Remove trailing "\n" from commithash in checkin function
The commithash for updating the ref is obtained from a call to
git-commit-tree. However, it was returned (and stored) with the
trailing newline. This meant that the later call to git-update-ref that
was trying to update to $commithash was including the newline in the
parameter - obviously that hash would never exist, and so git-update-ref
would always fail.
The solution is to chomp() the commithash as soon as it is returned by
git-commit-tree.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 21 Feb 2007 05:54:39 +0000 (21:54 -0800)]
Make 'cvs ci' lockless in git-cvsserver by using git-update-ref
This makes "ci" codepath lockless by following the usual
"remember the tip, do your thing, then compare and swap at the
end" update pattern using update-ref. Incidentally, by updating
the code that reads where the tip of the head is to use
show-ref, it makes it safe to use in a repository whose refs are
pack-pruned.
I noticed that other parts of the program are not yet pack-refs
safe, but tried to keep the changes to the minimum.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Theodore Tso [Tue, 27 Feb 2007 15:43:28 +0000 (10:43 -0500)]
Fix git-show man page formatting in the EXAMPLES section
Fix asciidoc markup so that the man page is properly formatted in the
EXAMPLES section.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:56:00 +0000 (14:56 -0500)]
get rid of lookup_object_type()
This function is called only once in the whole source tree. Let's move
its code inline instead, which is also in the spirit of removing as much
object type char arrays as possible (not that this patch does anything for
that but at least it is now a local matter).
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:55:59 +0000 (14:55 -0500)]
convert object type handling from a string to a number
We currently have two parallel notation for dealing with object types
in the code: a string and a numerical value. One of them is obviously
redundent, and the most used one requires more stack space and a bunch
of strcmp() all over the place.
This is an initial step for the removal of the version using a char array
found in object reading code paths. The patch is unfortunately large but
there is no sane way to split it in smaller parts without breaking the
system.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:55:58 +0000 (14:55 -0500)]
formalize typename(), and add its reverse type_from_string()
Sometime typename() is used, sometimes type_names[] is accessed directly.
Let's enforce typename() all the time which allows for validating the
type.
Also let's add a function to go from a name to a type and use it instead
of manual memcpy() when appropriate.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:55:57 +0000 (14:55 -0500)]
sha1_file.c: don't ignore an error condition in sha1_loose_object_info()
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:55:56 +0000 (14:55 -0500)]
sha1_file.c: cleanup "offset" usage
First there are too many offsets there and it is getting confusing.
So 'offset' is now 'curpos' to distinguish from other offsets like
'obj_offset'.
Then structures like x = foo(x, &y) are now done as y = foo(&x).
It looks more natural that the result y be returned directly and
x be passed as reference to be updated in place. This has the effect
of reducing some line length and removing a few, needing a bit less
stack space, and it even reduces the compiled code size.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre [Mon, 26 Feb 2007 19:55:55 +0000 (14:55 -0500)]
sha1_file.c: cleanup hdr usage
Let's have hdr be a simple char pointer/array when possible, and let's
reduce its storage to 32 bytes. Especially for sha1_loose_object_info()
where 128 bytes is way excessive and wastes extra CPU cycles inflating.
The object type is already restricted to 10 bytes in parse_sha1_header()
and the size, even if it is 64 bits, will fit in 20 decimal numbers. So
32 bytes is plenty.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Tue, 27 Feb 2007 09:33:52 +0000 (01:33 -0800)]
Merge branch 'maint'
* maint:
git-apply: do not fix whitespaces on context lines.
diff --cc: integer overflow given a 2GB-or-larger file
mailinfo: do not get confused with logical lines that are too long.
Junio C Hamano [Tue, 27 Feb 2007 09:31:42 +0000 (01:31 -0800)]
git-apply: do not fix whitespaces on context lines.
Internal function apply_line() is called to copy both context lines
and added lines to the output buffer, while possibly fixing the
whitespace breakages depending on --whitespace=strip settings.
However, it did its fix-up on both context lines and added lines.
This resulted in two symptoms:
(1) The number of lines reported to have been fixed up included
these context lines.
(2) However, the lines actually shown were limited to the added
lines that had whitespace breakages.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Jim Meyering [Mon, 26 Feb 2007 23:11:35 +0000 (00:11 +0100)]
diff --cc: integer overflow given a 2GB-or-larger file
Few of us use git to compare or even version-control 2GB files,
but when we do, we'll want it to work.
Reading a recent patch, I noticed two lines like this:
int len = st.st_size;
Instead of "int", that should be "size_t". Otherwise, in the
non-symlink case, with 64-bit size_t, if the file's size is 2GB,
the following xmalloc will fail:
result = xmalloc(len + 1);
trying to allocate 2^64 - 2^31 + 1 bytes (assuming sign-extension
in the int-to-size_t promotion). And even if it didn't fail, the
subsequent "result[len] = 0;" would be equivalent to an unpleasant
"result[-
2147483648] = 0;"
The other nearby "int"-declared size variable, sz, should also be of
type size_t, for the same reason. If sz ever wraps around and becomes
negative, xread will corrupt memory _before_ the "result" buffer.
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Linus Torvalds [Mon, 26 Feb 2007 19:10:59 +0000 (11:10 -0800)]
mailinfo: do not get confused with logical lines that are too long.
It basically considers all the continuation lines to be lines of their
own, and if the total line is bigger than what we can fit in it, we just
truncate the result rather than stop in the middle and then get confused
when we try to parse the "next" line (which is just the remainder of the
first line).
[jc: added test, and tightened boundary a bit per list discussion.]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sun, 25 Feb 2007 22:34:54 +0000 (23:34 +0100)]
diff --no-index: also imitate the exit status of diff(1)
diff sets the exit status to 0 when no changes were found, to 1
when changes were found, and 2 means error.
We imitate this to be able to use "git diff" in the test scripts.
(Actually, keeping in line with the rest of git, -1 is returned
on error, which corresponds to an exit status 255).
To find out if the diff is not empty, a member called
"found_changes" was introduced in struct diff_options, which is
set in builtin_diff() and fn_out_consume().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 09:20:42 +0000 (01:20 -0800)]
Merge branch 'master' into js/diff-ni
* master: (201 commits)
Documentation: link in 1.5.0.2 material to the top documentation page.
Documentation: document remote.<name>.tagopt
GIT 1.5.0.2
git-remote: support remotes with a dot in the name
Documentation: describe "-f/-t/-m" options to "git-remote add"
diff --cc: fix display of symlink conflicts during a merge.
merge-recursive: fix longstanding bug in merging symlinks
merge-index: fix longstanding bug in merging symlinks
diff --cached: give more sensible error message when HEAD is yet to be created.
Update tests to use test-chmtime
Add test-chmtime: a utility to change mtime on files
Add Release Notes to prepare for 1.5.0.2
Allow arbitrary number of arguments to git-pack-objects
rerere: do not deal with symlinks.
rerere: do not skip two conflicted paths next to each other.
Don't modify CREDITS-FILE if it hasn't changed.
diff-patch: Avoid emitting double-slashes in textual patch.
Reword git-am 3-way fallback failure message.
Limit filename for format-patch
core.legacyheaders: Use the description used in RelNotes-1.5.0
...
Junio C Hamano [Mon, 26 Feb 2007 09:16:01 +0000 (01:16 -0800)]
Documentation: link in 1.5.0.2 material to the top documentation page.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Aneesh Kumar K.V [Sat, 24 Feb 2007 15:32:56 +0000 (21:02 +0530)]
Documentation: document remote.<name>.tagopt
Update config.txt with info regarding tagopt option
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 08:32:19 +0000 (00:32 -0800)]
Merge branch 'maint'
* maint:
GIT 1.5.0.2
git-remote: support remotes with a dot in the name
Documentation: describe "-f/-t/-m" options to "git-remote add"
diff --cc: fix display of symlink conflicts during a merge.
Junio C Hamano [Mon, 26 Feb 2007 07:58:50 +0000 (23:58 -0800)]
GIT 1.5.0.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
Pavel Roskin [Wed, 21 Feb 2007 05:03:36 +0000 (00:03 -0500)]
git-remote: support remotes with a dot in the name
[jc: the original from Pavel was limiting the variable names to only
fetch and url, but I loosened it to take valid variable names.]
[jc: cherry-picked from 'master', since people seem to be reinventing
this many times.]
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 07:26:11 +0000 (23:26 -0800)]
Documentation: describe "-f/-t/-m" options to "git-remote add"
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 06:24:47 +0000 (22:24 -0800)]
diff --cc: fix display of symlink conflicts during a merge.
"git-diff-files --cc" to show conflicts during merge did not pass
the correct mode information for the working tree down, and showed
bogus combined diff.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 03:10:13 +0000 (19:10 -0800)]
Merge branch 'maint'
* maint:
merge-recursive: fix longstanding bug in merging symlinks
merge-index: fix longstanding bug in merging symlinks
Junio C Hamano [Mon, 26 Feb 2007 03:09:59 +0000 (19:09 -0800)]
Merge branch 'jc/merge-symlink' into maint
* jc/merge-symlink:
merge-recursive: fix longstanding bug in merging symlinks
merge-index: fix longstanding bug in merging symlinks
Junio C Hamano [Mon, 26 Feb 2007 02:42:07 +0000 (18:42 -0800)]
merge-recursive: fix longstanding bug in merging symlinks
Commit
3af244ca added unlink(2) before running symlink(2) to
update the working tree with the merge result, but it was
unlinking a wrong path. This resulted in loss of the path
pointed by a symlink.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 26 Feb 2007 02:17:15 +0000 (18:17 -0800)]
merge-index: fix longstanding bug in merging symlinks
Ancient commit
e2b6a9d0 added code to pass "file modes" from
merge-index to merge-one-file, and then later commit
54dd99a1
wanted to make sure we do not end up creating a nonsense symlink
that points at a path whose name contains conflict markers.
However, nobody noticed that the code in merge-index added by
e2b6a9d0 were stripping the S_IFMT bits and the code in
54dd99a1
was meaningless. This fixes it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sun, 25 Feb 2007 22:34:31 +0000 (23:34 +0100)]
Fix typo: do not show name1 when name2 fails
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 25 Feb 2007 06:26:33 +0000 (22:26 -0800)]
diff --cached: give more sensible error message when HEAD is yet to be created.
It is not like the user said 'diff --cached HEAD', so complaining about
HEAD not being a valid commit, while technically might be correct, is
not very helpful.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong [Sun, 25 Feb 2007 00:59:52 +0000 (16:59 -0800)]
Update tests to use test-chmtime
test-lib:
Make sure test-chmtime has been built before starting.
t4200-rerere:
Removed non-portable date dependency and avoid touch
Avoid "test -a" which isn't portable, either
lib-git-svn:
Use test-chmtime instead of Perl one-liner to poke
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong [Sun, 25 Feb 2007 02:18:22 +0000 (18:18 -0800)]
Add test-chmtime: a utility to change mtime on files
This is intended to be a portable replacement for our usage
of date(1), touch(1), and Perl one-liners in tests.
Usage: test-chtime (+|=|-|=+|=-)<seconds> <file>..."
'+' increments the mtime on the files by <seconds>
'-' decrements the mtime on the files by <seconds>
'=' sets the mtime on the file to exactly <seconds>
'=+' and '=-' sets the mtime on the file to <seconds> after or
before the current time.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 25 Feb 2007 19:08:47 +0000 (11:08 -0800)]
Merge branch 'maint'
* maint:
Add Release Notes to prepare for 1.5.0.2
Allow arbitrary number of arguments to git-pack-objects
rerere: do not deal with symlinks.
rerere: do not skip two conflicted paths next to each other.
Don't modify CREDITS-FILE if it hasn't changed.
Junio C Hamano [Sun, 25 Feb 2007 18:53:42 +0000 (10:53 -0800)]
Add Release Notes to prepare for 1.5.0.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
Roland Dreier [Sun, 25 Feb 2007 17:34:27 +0000 (09:34 -0800)]
Allow arbitrary number of arguments to git-pack-objects
If a repository ever gets in a situation where there are too many
packs (more than 60 or so), perhaps because of frequent use of
git-fetch -k or incremental git-repack, then it becomes impossible to
fully repack the repository with git-repack -a. That command just
dies with the cryptic message
fatal: too many internal rev-list options
This message comes from git-pack-objects, which is passed one command
line option like --unpacked=pack-<SHA1>.pack for each pack file to be
repacked. However, the current code has a static limit of 64 command
line arguments and just aborts if more arguments are passed to it.
Fix this by dynamically allocating the array of command line
arguments, and doubling the size each time it overflows.
Signed-off-by: Roland Dreier <roland@digitalvampire.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 25 Feb 2007 09:29:43 +0000 (01:29 -0800)]
rerere: do not deal with symlinks.
Who would use multi-line symlinks that would benefit from rerere?
Just ignore them.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 25 Feb 2007 09:24:34 +0000 (01:24 -0800)]
rerere: do not skip two conflicted paths next to each other.
The code forgot to take the for (;;) loop control into account,
incrementing the index once too many.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 25 Feb 2007 07:33:12 +0000 (23:33 -0800)]
Merge git://repo.or.cz/git-gui into maint
* git://repo.or.cz/git-gui:
Don't modify CREDITS-FILE if it hasn't changed.
Junio C Hamano [Sun, 25 Feb 2007 07:18:11 +0000 (02:18 -0500)]
Don't modify CREDITS-FILE if it hasn't changed.
We should always avoid rewriting a built file during `make install`
if nothing has changed since `make all`. This is to help support
the typical installation process of compiling a package as yourself,
then installing it as root.
Forcing CREDITS-FILE to be always be rebuilt in the Makefile means
that CREDITS-GEN needs to check for a change and only update
CREDITS-FILE if the file content actually differs. After all,
content is king in Git.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Junio C Hamano [Sat, 24 Feb 2007 10:20:13 +0000 (02:20 -0800)]
Evil Merge branch 'jc/status' (early part) into js/diff-ni
* 'jc/status' (early part):
run_diff_{files,index}(): update calling convention.
update-index: do not die too early in a read-only repository.
git-status: do not be totally useless in a read-only repository.
This is to resolve semantic conflict (which is not textual) that
changes the calling convention of run_diff_files() early.
Johannes Schindelin [Sat, 24 Feb 2007 02:08:20 +0000 (03:08 +0100)]
object name: introduce ':/<oneline prefix>' notation
To name a commit, you can now say
$ git rev-parse ':/Initial revision of "git"'
and it will return the hash of the youngest commit whose
commit message (the oneline) begins with the given prefix.
For future extension, a leading exclamation mark is treated
specially: if you want to match a commit message starting with
a '!', just repeat the exclamation mark. So, to match a commit
which starts with '!Hello World', use
$ git show ':/!!Hello World'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sat, 24 Feb 2007 10:00:32 +0000 (02:00 -0800)]
Merge branch 'js/apply'
* js/apply:
apply: make --verbose a little more useful
Junio C Hamano [Sat, 24 Feb 2007 09:47:56 +0000 (01:47 -0800)]
Merge branch 'js/no-limit-boundary'
* js/no-limit-boundary:
rev-list --max-age, --max-count: support --boundary
Junio C Hamano [Sat, 24 Feb 2007 09:43:28 +0000 (01:43 -0800)]
Merge branch 'js/etc-config'
* js/etc-config:
Make tests independent of global config files
config: read system-wide defaults from /etc/gitconfig
Junio C Hamano [Sat, 24 Feb 2007 09:42:06 +0000 (01:42 -0800)]
Merge branch 'maint'
* maint:
diff-patch: Avoid emitting double-slashes in textual patch.
Reword git-am 3-way fallback failure message.
Limit filename for format-patch
core.legacyheaders: Use the description used in RelNotes-1.5.0
git-show-ref --verify: Fail if called without a reference
Conflicts:
builtin-show-ref.c
diff.c