Junio C Hamano [Fri, 9 Mar 2007 11:52:12 +0000 (03:52 -0800)]
prepare_packed_git(): sort packs by age and localness.
When accessing objects, we first look for them in packs that
are linked together in the reverse order of discovery.
Since younger packs tend to contain more recent objects, which
are more likely to be accessed often, and local packs tend to
contain objects more relevant to our specific projects, sort the
list of packs before starting to access them. In addition,
favoring local packs over the ones borrowed from alternates can
be a win when alternates are mounted on network file systems.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 11 Mar 2007 07:38:18 +0000 (23:38 -0800)]
Merge branch 'js/attach'
* js/attach:
format-patch --attach: not folding some long headers.
format-patch: add --inline option and make --attach a true attachment
Junio C Hamano [Sun, 11 Mar 2007 07:26:33 +0000 (23:26 -0800)]
Merge branch 'js/diff-ni'
* js/diff-ni:
Get rid of the dependency to GNU diff in the tests
diff --no-index: support /dev/null as filename
diff-ni: fix the diff with standard input
diff: support reading a file from stdin via "-"
Junio C Hamano [Sun, 11 Mar 2007 07:10:26 +0000 (23:10 -0800)]
Merge branch 'jc/fsck'
* jc/fsck:
fsck: exit with non-zero status upon errors
unpack_sha1_file(): detect corrupt loose object files.
fsck: fix broken loose object check.
Junio C Hamano [Sun, 11 Mar 2007 07:00:38 +0000 (23:00 -0800)]
Merge branch 'pb/commit-i'
* pb/commit-i:
git-commit: add a --interactive option
Junio C Hamano [Sun, 11 Mar 2007 07:00:11 +0000 (23:00 -0800)]
Merge branch 'js/revert-cherry'
* js/revert-cherry:
cherry-pick: Bug fix 'cherry picked from' message.
cherry-pick: Suggest a better method to retain authorship
Make git-revert & git-cherry-pick a builtin
Junio C Hamano [Sun, 11 Mar 2007 06:33:13 +0000 (22:33 -0800)]
Merge branch 'sp/make'
* sp/make:
Allow "make -w" generate its usual output
Support of "make -s": do not output anything of the build itself
More build output cleaning up
Make 'make' quiet by default
Make 'make' quieter while building git
Junio C Hamano [Sun, 11 Mar 2007 06:07:26 +0000 (22:07 -0800)]
Merge branch 'maint'
* maint:
git.el: Retrieve commit log information from .dotest directory.
git.el: Avoid appending a signoff line that is already present.
setup_git_directory_gently: fix off-by-one error
user-manual: install user manual stylesheet with other web documents
user-manual: fix rendering of history diagrams
user-manual: fix missing colon in git-show example
user-manual: fix inconsistent use of pull and merge
user-manual: fix inconsistent example
glossary: fix overoptimistic automatic linking of defined terms
Documentation: s/seperator/separator/
Adjust reflog filemode in shared repository
Alexandre Julliard [Sat, 10 Mar 2007 18:22:26 +0000 (19:22 +0100)]
git.el: Retrieve commit log information from .dotest directory.
If a git-am or git-rebase is in progress, fill the commit log buffer
from the commit information found in the various files in the .dotest
directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alexandre Julliard [Sat, 10 Mar 2007 18:21:25 +0000 (19:21 +0100)]
git.el: Avoid appending a signoff line that is already present.
Also avoid inserting an extra newline if other signoff lines are
present.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Lederhofer [Sun, 11 Mar 2007 01:35:00 +0000 (02:35 +0100)]
setup_git_directory_gently: fix off-by-one error
don't tell getcwd that the buffer has one spare byte for an extra /
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Sun, 11 Mar 2007 05:47:01 +0000 (21:47 -0800)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
* 'maint' of git://linux-nfs.org/~bfields/git:
user-manual: install user manual stylesheet with other web documents
user-manual: fix rendering of history diagrams
user-manual: fix missing colon in git-show example
user-manual: fix inconsistent use of pull and merge
user-manual: fix inconsistent example
glossary: fix overoptimistic automatic linking of defined terms
J. Bruce Fields [Sun, 11 Mar 2007 03:58:54 +0000 (22:58 -0500)]
user-manual: install user manual stylesheet with other web documents
Install the stylesheet needed for the user manual. This should solve
the problem of, e.g.,
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
lacking a lot of formatting.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields [Sun, 11 Mar 2007 03:38:13 +0000 (22:38 -0500)]
user-manual: fix rendering of history diagrams
Asciidoc appears to interpret a backslash at the end of a line as
escaping the end-of-line character, which screws up the display of
history diagrams like
o--o--o
\
o--...
The obvious fix (replacing "\" by "\\") doesn't work. The only
workaround I've found is to include all such diagrams in a LiteralBlock.
Asciidoc claims that should be equivalent to a literal paragraph, so I
don't understand why the difference--perhaps it's an asciidoc bug.
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields [Sun, 11 Mar 2007 03:00:12 +0000 (22:00 -0500)]
user-manual: fix missing colon in git-show example
There should be a colon in this git-show example.
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields [Sun, 11 Mar 2007 02:52:39 +0000 (21:52 -0500)]
user-manual: fix inconsistent use of pull and merge
I used "git pull ." instead of "git merge" here without any explanation.
Stick instead to "git merge" for now (the equivalent pull syntax is
still covered in a later chapter).
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields [Sun, 11 Mar 2007 02:45:29 +0000 (21:45 -0500)]
user-manual: fix inconsistent example
The configuration file fragment here is inconsistent with the text
above. Thanks to Ramsay Jones for the correction.
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
J. Bruce Fields [Mon, 5 Mar 2007 00:13:09 +0000 (19:13 -0500)]
glossary: fix overoptimistic automatic linking of defined terms
The script sort_glossary.pl turns each use of "term" into a link to the
definition of "term". To avoid mangling links like
gitlink:git-term[1]
it doesn't replace any occurence of "term" preceded by "link:git-".
This fails for gitlink:git-symbolic-ref[1] when substituting for "ref".
So instead just refuse to replace anything preceded by a "-".
That could result in missing some opportunities, but that's a less
annoying error.
Actually I find the automatic substitution a little distracting; some
day maybe we should just run it once and commit the result, so it can
be hand-tuned.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Jeff King [Fri, 9 Mar 2007 20:21:41 +0000 (15:21 -0500)]
Documentation: s/seperator/separator/
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Kestenholz [Fri, 9 Mar 2007 22:38:57 +0000 (23:38 +0100)]
Adjust reflog filemode in shared repository
Without this, committing in a group-shared repository would not work
even though all developers are in the same group.
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Paolo Bonzini [Mon, 5 Mar 2007 07:57:53 +0000 (08:57 +0100)]
git-commit: add a --interactive option
The --interactive option behaves like "git commit", except that
"git add --interactive" is executed before committing. It is
incompatible with -a and -i.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Thu, 8 Mar 2007 08:53:38 +0000 (00:53 -0800)]
Merge branch 'js/config-rename'
* js/config-rename:
git-config: document --rename-section, provide --remove-section
Junio C Hamano [Thu, 8 Mar 2007 07:10:05 +0000 (23:10 -0800)]
Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
Allow fast-import frontends to reload the marks table
Use atomic updates to the fast-import mark file
Preallocate memory earlier in fast-import
Shawn O. Pearce [Wed, 7 Mar 2007 23:07:26 +0000 (18:07 -0500)]
Allow fast-import frontends to reload the marks table
I'm giving fast-import a lesson on how to reload the marks table
using the same format it outputs with --export-marks. This way
a frontend can reload the marks table from a prior import, making
incremental imports less painful.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce [Wed, 7 Mar 2007 23:05:38 +0000 (18:05 -0500)]
Use atomic updates to the fast-import mark file
When we allow fast-import frontends to reload a mark file from a
prior session we want to let them use the same file as they exported
the marks to. This makes it very simple for the frontend to save
state across incremental imports.
But we don't want to lose the old marks table if anything goes wrong
while writing our current marks table. So instead of truncating and
overwriting the path specified to --export-marks we use the standard
lockfile code to write the current marks out to a temporary file,
then rename it over the old marks table.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce [Wed, 7 Mar 2007 21:52:05 +0000 (16:52 -0500)]
Teach receive-pack to run pre-receive/post-receive hooks
Bill Lear pointed out that it is easy to send out notifications of
changes with the update hook, but successful execution of the update
hook does not necessarily mean that the ref was actually updated.
Lock contention on the ref or being unable to append to the reflog
may prevent the ref from being changed. Sending out notifications
prior to the ref actually changing is very misleading.
To help this situation I am introducing two new hooks to the
receive-pack flow: pre-receive and post-receive. These new hooks
are invoked only once per receive-pack execution and are passed
three arguments per ref (refname, old-sha1, new-sha1).
The new post-receive hook is ideal for sending out notifications,
as it has the complete list of all refnames that were successfully
updated as well as the old and new SHA-1 values. This allows more
interesting notifications to be sent. Multiple ref updates could
be easily summarized into one email, for example.
The new pre-receive hook is ideal for logging update attempts, as it
is run only once for the entire receive-pack operation. It can also
be used to verify multiple updates happen at once, e.g. an update
to the `maint` head must also be accompained by a new annotated tag.
Lots of documentation improvements for receive-pack are included
in this change, as we want to make sure the new hooks are clearly
explained.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 21:51:59 +0000 (16:51 -0500)]
Refactor handling of error_string in receive-pack
I discovered we did not send an ng line in the report-status feedback
if the ref was not updated because the repository has the config
option receive.denyNonFastForwards enabled. I think the reason this
happened is that it is simply too easy to forget to set error_string
when returning back a failure from update()
We now return an ng line for a non-fastforward update, which in
turn will cause send-pack to exit with a non-zero exit status.
Hence the modified test.
This refactoring changes update to return a const char* describing
the error, which execute_commands always loads into error_string.
The result is what I think is cleaner code, and allows us to
initialize the error_string member to NULL when we read_head_info.
I want error_string to be NULL in all commands before we call
execute_commands, so that we can reuse the run_hook function to
execute a new pre-receive hook.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 21:51:09 +0000 (16:51 -0500)]
Refactor run_update_hook to be more useful
This is a simple refactoring of run_update_hook to allow the function
to be passed the name of the hook it runs and also to build the
argument list from a list of struct commands, rather than just one
struct command.
The refactoring is to support new pre-receive and post-receive
hooks that will be given the entire list of struct commands,
rather than just one struct command. These new hooks will follow
in another patch.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 21:50:43 +0000 (16:50 -0500)]
Don't run post-update hook unless a ref changed
There is little point in executing the post-update hook if all refs
had an error and were unable to be updated. In this case nothing
new is reachable within the repository, and there is no state change
for the post-update hook to be interested in.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 21:50:24 +0000 (16:50 -0500)]
Move post-update hook to after all other activity
As the post-update hook is meant to run after we have completed the
receipt of the pushed changes, and it might actually try to kick off
a `repack -a -d`, we should delay on invoking it until after we have
removed the *.keep file on the uploaded pack (if we kept the pack).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Wed, 7 Mar 2007 22:45:25 +0000 (14:45 -0800)]
Merge branch 'maint'
* maint:
Catch write_ref_sha1 failure in receive-pack
make t8001 work on Mac OS X again
Shawn O. Pearce [Wed, 7 Mar 2007 22:09:21 +0000 (17:09 -0500)]
Preallocate memory earlier in fast-import
I'm about to teach fast-import how to reload the marks file created
by a prior session. The general approach that I want to use is to
immediately parse the marks file when the specific argument is found
in argv, thereby allowing the caller to supply multiple marks files,
as the mark space can be sparsely populated.
To make that work out we need to allocate our object tables before
we parse the command line options. Since none of these tables
depend on the command line options, we can easily relocate them.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:37 +0000 (20:44 -0500)]
Cast 64 bit off_t to 32 bit size_t
Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
This implies that we are able to access and work on files whose
maximum length is around 2^63-1 bytes, but we can only malloc or
mmap somewhat less than 2^32-1 bytes of memory.
On such a system an implicit conversion of off_t to size_t can cause
the size_t to wrap, resulting in unexpected and exciting behavior.
Right now we are working around all gcc warnings generated by the
-Wshorten-64-to-32 option by passing the off_t through xsize_t().
In the future we should make xsize_t on such problematic platforms
detect the wrapping and die if such a file is accessed.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:34 +0000 (20:44 -0500)]
Use off_t in pack-objects/fast-import when we mean an offset
Always use an off_t value in pack-objects anytime we are dealing
with an offset to some data within a packfile.
Also fixed a minor uintmax_t that was incorrectly defined before.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:30 +0000 (20:44 -0500)]
Use off_t when we really mean a file offset.
Not all platforms have declared 'unsigned long' to be a 64 bit value,
but we want to support a 64 bit packfile (or close enough anyway)
in the near future as some projects are getting large enough that
their packed size exceeds 4 GiB.
By using off_t, the POSIX type that is declared to mean an offset
within a file, we support whatever maximum file size the underlying
operating system will handle. For most modern systems this is up
around 2^60 or higher.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:24 +0000 (20:44 -0500)]
Use uint32_t for pack-objects counters.
As we technically try to support up to a maximum of 2**32-1 objects
in a single packfile we should act like it and use unsigned 32 bit
integers for all of our object counts and progress output.
This change does not modify everything in pack-objects that probably
needs to change to fully support the maximum of 2**32-1 objects.
I'm intentionally breaking the improvements into slightly smaller
commits to make them easier to follow.
No logic change should be occuring here, with the exception that
some comparsions will now work properly when the number of objects
exceeds 2**31-1.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:19 +0000 (20:44 -0500)]
Use uint32_t for all packed object counts.
As we permit up to 2^32-1 objects in a single packfile we cannot
use a signed int to represent the object offset within a packfile,
after 2^31-1 objects we will start seeing negative indexes and
error out or compute bad addresses within the mmap'd index.
This is a minor cleanup that does not introduce any significant
logic changes. It is roach free.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:17 +0000 (20:44 -0500)]
General const correctness fixes
We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime. Likewise we should always be
treating unsigned values as unsigned values, not as signed values.
Most of these are very straightforward. The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case. Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:14 +0000 (20:44 -0500)]
Don't build external_grep if its not used
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:11 +0000 (20:44 -0500)]
Fix mmap leak caused by reading bad indexes.
If an index is corrupt, or is simply too new for us to understand,
we were leaking the mmap that held the entire content of the index.
This could be a considerable size on large projects, given that
the index is at least 24 bytes * nr_objects.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:08 +0000 (20:44 -0500)]
Display the null SHA-1 as the base for an OBJ_OFS_DELTA.
Because we are currently cheating and never supplying the delta base
for an OBJ_OFS_DELTA we get a random SHA-1 in the delta base field.
Instead lets clear the hash out so its at least all 0's. This is
somewhat more obvious that something fishy is going on, like we
don't actually have the SHA-1 of the base handy. :)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Paolo Bonzini [Wed, 7 Mar 2007 09:43:41 +0000 (10:43 +0100)]
git-archimport: allow remapping branch names
This patch adds support to archimport for remapping the branch
names to match those used in git more closely. This is useful
for projects that migrate to git (as opposed to users that want
to use git on Arch-based projects). For example, one can choose
an Arch branch name and call it "master".
The new command-line syntax works even if there is a colon in
a branch name, since only the part after the last colon is taken
to be the git name (git does not allow colons in branch names).
The new feature is implemented so that archives rotated every
year can also be remapped into a single git archive.
Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Santi B\e,Ai\e(Bjar [Wed, 7 Mar 2007 12:18:59 +0000 (13:18 +0100)]
t/t5515-fetch-merge-logic.sh: Add two more tests
They test the behaviour with just a URL in the command line.
Signed-off-by: Santi B\e,Ai\e(Bjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Wed, 7 Mar 2007 17:04:24 +0000 (12:04 -0500)]
Catch write_ref_sha1 failure in receive-pack
This failure to catch the failure of write_ref_sha1 was noticed
by Bill Lear. The ref will not update if the log file could not
be appended to (due to file permissions problems). Such a failure
should be flagged as a failure to update the ref, so that the client
knows the push did not succeed.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski [Wed, 7 Mar 2007 01:21:25 +0000 (02:21 +0100)]
gitweb: Don't escape attributes in CGI.pm HTML methods
There is no need to escape HTML tag's attributes in CGI.pm
HTML methods (like CGI::a()), because CGI.pm does attribute
escaping automatically.
$cgi->a({ ... -attribute => atribute_value }, tag_contents)
is translated to
<a ... attribute="attribute_value">tag_contents</a>
The rules for escaping attribute values (which are string contents) are
different. For example you have to take care about escaping embedded '"'
and "'" characters; CGI::a() does that for us automatically.
CGI::a() does not HTML escape tag_contents; we would need to write
<a href="URL">some <b>bold</b> text</a>
for example. So we use esc_html (or esc_path) to escape tag_contents
as needed.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen [Tue, 6 Mar 2007 23:05:34 +0000 (00:05 +0100)]
Allow "make -w" generate its usual output
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen [Tue, 6 Mar 2007 23:44:49 +0000 (00:44 +0100)]
Support of "make -s": do not output anything of the build itself
Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen [Tue, 6 Mar 2007 22:37:18 +0000 (23:37 +0100)]
More build output cleaning up
- print output file name for .c files
- suppress output of the names of subdirectories when make changes into them
- use GEN prefix for makefile generation in perl/
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Wed, 7 Mar 2007 00:48:59 +0000 (19:48 -0500)]
make t8001 work on Mac OS X again
The test was recently broken to expect sed to leave the
incomplete line at the end without newline.
POSIX says that output of the pattern space is to be followed by
a newline, while GNU adds the newline back only when it was
stripped when input. GNU behaviour is arguably more intuitive
and nicer, but we should not depend on it.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Li Yang [Tue, 6 Mar 2007 03:58:56 +0000 (11:58 +0800)]
gitweb: Change to use explicitly function call cgi->escapHTML()
Change to use explicitly function call cgi->escapHTML().
This fix the problem on some systems that escapeHTML() is not
functioning, as default CGI is not setting 'escape' parameter.
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Tue, 6 Mar 2007 07:09:14 +0000 (02:09 -0500)]
Make 'make' quiet by default
Per Junio's suggestion we are setting 'make' to be quiet by default,
with `make V=1` available to force GNU make back to its default
behavior of showing each command it is running.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Tue, 6 Mar 2007 06:35:01 +0000 (01:35 -0500)]
Make 'make' quieter while building git
I find it difficult to see compiler warnings amongst the massive
spewing produced by GNU make as it works through our productions.
This is especially true if CFLAGS winds up being rather long, due
to a large number of -W options being enabled and due to a number
of -D options being configured/required by my platform.
By defining QUIET_MAKE (e.g. make QUIET_MAKE=YesPlease) during
compilation users will get a less verbose output, such as:
...
CC builtin-grep.c
builtin-grep.c:187: warning: 'external_grep' defined but not used
CC builtin-init-db.c
CC builtin-log.c
CC builtin-ls-files.c
CC builtin-ls-tree.c
...
The verbose (normal make) output is still the default.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Tue, 6 Mar 2007 08:45:34 +0000 (00:45 -0800)]
Merge branch 'maint'
* maint:
git-gui: Make 'make' quieter by default
git-gui: Remove unnecessary /dev/null redirection.
git-gui: Don't create empty (same tree as parent) commits.
git-gui: Add Reset to the Branch menu.
git-gui: Relocate the menu/transport menu code.
Junio C Hamano [Tue, 6 Mar 2007 08:39:52 +0000 (00:39 -0800)]
Merge branch 'master' of git://repo.or.cz/git-gui into maint
* 'master' of git://repo.or.cz/git-gui:
git-gui: Make 'make' quieter by default
git-gui: Remove unnecessary /dev/null redirection.
git-gui: Don't create empty (same tree as parent) commits.
git-gui: Add Reset to the Branch menu.
git-gui: Relocate the menu/transport menu code.
Junio C Hamano [Tue, 6 Mar 2007 06:48:00 +0000 (22:48 -0800)]
git-bundle: fix pack generation.
The handcrafted built-in rev-list lookalike forgot to mark the trees
and blobs contained in the boundary commits uninteresting, resulting
in unnecessary objects in the pack.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Tue, 6 Mar 2007 07:13:23 +0000 (02:13 -0500)]
git-gui: Make 'make' quieter by default
To fit nicely into the output of the git.git project's own quieter
Makefile, we want to make the git-gui Makefile nice and quiet too.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Junio C Hamano [Tue, 6 Mar 2007 07:11:54 +0000 (23:11 -0800)]
Merge branch 'maint'
* maint:
git-commit: cd to top before showing the final stat
Junio C Hamano [Mon, 5 Mar 2007 20:35:41 +0000 (12:35 -0800)]
git-commit: cd to top before showing the final stat
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Tue, 6 Mar 2007 05:46:00 +0000 (00:46 -0500)]
cherry-pick: Bug fix 'cherry picked from' message.
Somewhere along the line (in
abd6970a) git-revert.sh learned to
omit the private object name from the new commit message *unless*
-x was supplied on the command line by the user.
The way this was implemented is really non-obvious in the original
script. Setting replay=t (the default) means we don't include the
the private object name, while setting reply='' (the -x flag) means
we should include the private object name. These two settings now
relate to the replay=1 and replay=0 cases in the C version, so we
need to negate replay to test it is 0.
I also noticed the C version was adding an extra LF in the -x case,
where the older git-revert.sh was not.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Tue, 6 Mar 2007 05:23:46 +0000 (21:23 -0800)]
Merge branch 'master-for-junio' of git://repo.or.cz/git/fastimport; branch 'maint'
* 'master-for-junio' of git://repo.or.cz/git/fastimport:
fast-import: Fail if a non-existant commit is used for merge
fast-import: Avoid infinite loop after reset
* maint:
Fix diff-options references in git-diff and git-format-patch
Add definition of <commit-ish> to the main git man page.
Begin SubmittingPatches with a check list
fast-import: Fail if a non-existant commit is used for merge
fast-import: Avoid infinite loop after reset
Brian Gernhardt [Tue, 6 Mar 2007 03:27:44 +0000 (22:27 -0500)]
Fix diff-options references in git-diff and git-format-patch
Most of the git-diff-* documentation used [<common diff options>]
instead of [--diff-options], so make that change in git-diff and
git-format-patch.
In addition, git-format-patch didn't include the meanings of the diff
options.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Theodore Ts'o [Mon, 5 Mar 2007 19:46:05 +0000 (14:46 -0500)]
Add definition of <commit-ish> to the main git man page.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Tue, 6 Mar 2007 01:07:17 +0000 (17:07 -0800)]
Merge branch 'maint-for-junio' of git://repo.or.cz/git/fastimport into maint
* 'maint-for-junio' of git://repo.or.cz/git/fastimport:
fast-import: Fail if a non-existant commit is used for merge
fast-import: Avoid infinite loop after reset
Johannes Schindelin [Mon, 5 Mar 2007 15:37:54 +0000 (16:37 +0100)]
Begin SubmittingPatches with a check list
It seems that some people prefer a short list to a long text. But even for
the latter group, a quick reminder list is useful. So, add a check list to
Documentation/SubmittingPatches of what to do to get your patch accepted.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce [Mon, 5 Mar 2007 17:49:02 +0000 (12:49 -0500)]
Merge branch 'maint'
* maint:
fast-import: Fail if a non-existant commit is used for merge
fast-import: Avoid infinite loop after reset
[sp: Minor evil merge to deal with type_names array moving
to be private in 'master'.]
Shawn O. Pearce [Mon, 5 Mar 2007 17:43:14 +0000 (12:43 -0500)]
fast-import: Fail if a non-existant commit is used for merge
Johannes Sixt noticed during one of his own imports that fast-import
did not fail if a non-existant commit is referenced by SHA-1 value
as an argument to the 'merge' command. This allowed the user to
unknowingly create commits that would fail in fsck, as the commit
contents would not be completely reachable.
A side effect of this bug was that a frontend process could mark
any SHA-1 object (blob, tree, tag) as a parent of a merge commit.
This should also fail in fsck, as the commit is not a valid commit.
We now use the same rule as the 'from' command. If a commit is
referenced in the 'merge' command by hex formatted SHA-1 then the
SHA-1 must be a commit or a tag that can be peeled back to a commit,
the commit must already exist, and must be readable by the core Git
infrastructure code. This requirement means that the commit must
have existed prior to fast-import starting, or the commit must have
been flushed out by a prior 'checkpoint' command.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce [Mon, 5 Mar 2007 17:31:09 +0000 (12:31 -0500)]
fast-import: Avoid infinite loop after reset
Johannes Sixt noticed that a 'reset' command applied to a branch that
is already active in the branch LRU cache can cause fast-import to
relink the same branch into the LRU cache twice. This will cause
the LRU cache to contain a cycle, making unload_one_branch run in an
infinite loop as it tries to select the oldest branch for eviction.
I have trivially fixed the problem by adding an active bit to
each branch object; this bit indicates if the branch is already
in the LRU and allows us to avoid trying to add it a second time.
Converting the pack_id field into a bitfield makes this change take
up no additional memory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Junio C Hamano [Mon, 5 Mar 2007 08:22:06 +0000 (00:22 -0800)]
fsck: exit with non-zero status upon errors
git-fsck always exited with status 0, which was a bit sloppy.
This makes it exit with a non-zero status when errors are
found. The error code is an OR'ed result of:
1 if corrupted objects are found.
2 if objects that are ought to be reachable are missing or corrupt.
For example, it would exit with 1 in a repository with an
unreachable corrupt object. If a tree object of the HEAD commit
is corrupt, you would get 3.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 5 Mar 2007 08:21:37 +0000 (00:21 -0800)]
unpack_sha1_file(): detect corrupt loose object files.
We did not detect broken loose object files, either when
underlying inflate() signalled the breakage, nor inflate()
finished and we had garbage trailing at the end. We do better
now.
We also make unpack_sha1_file() a static function to
sha1_file.c, since it is not used by anybody outside.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 5 Mar 2007 08:21:24 +0000 (00:21 -0800)]
fsck: fix broken loose object check.
When "git fsck" without --full found a loose object missing
because it was broken, it mistakenly thought it was not parsed
because we found it in one of the packs. Back when this code
was written, we did not have a way to explicitly check if we
have the object in pack, but we do now.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Xavier Maillard [Mon, 5 Mar 2007 08:23:42 +0000 (09:23 +0100)]
contrib/emacs: Use non-interactive function to byte-compile files
Add git-blame as a candidate to the byte-compilation.
batch-byte-compile is the prefered way to byte-compile files in
batch mode. Use it instead of the interactive function.
Signed-off-by: Xavier Maillard <zedek@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Santi Béjar [Mon, 5 Mar 2007 08:09:39 +0000 (09:09 +0100)]
t/t5515-fetch-merge-logic.sh: Added tests for the merge login in git-fetch
Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 5 Mar 2007 06:49:10 +0000 (22:49 -0800)]
Post 1.5.0.3 cleanup
Update the main git.html page to point at 1.5.0.3 documentation.
Update draft 1.5.1 release notes with what we have so far.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 5 Mar 2007 00:08:04 +0000 (16:08 -0800)]
format-patch --attach: not folding some long headers.
Panagiotis Issaris reports that some MUAs seem not to like
folded "content-type" and "content-disposition" headers, so this
makes format-patch --attach output to avoid them.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sat, 3 Mar 2007 23:12:06 +0000 (00:12 +0100)]
format-patch: add --inline option and make --attach a true attachment
The existing --attach option did not create a true "attachment"
but multipart/mixed with Content-Disposition: inline. It should
have been with Content-Disposition: attachment.
Introduce --inline to add multipart/mixed that is inlined, and
make --attach to create an attachement.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano [Mon, 5 Mar 2007 01:31:21 +0000 (17:31 -0800)]
Merge branch 'js/fetch-progress' (early part)
* 'js/fetch-progress' (early part):
Fixup no-progress for fetch & clone
fetch & clone: do not output progress when not on a tty
Conflicts:
git-fetch.sh
Junio C Hamano [Mon, 5 Mar 2007 01:31:09 +0000 (17:31 -0800)]
Merge branch 'js/symlink'
* js/symlink:
Tell multi-parent diff about core.symlinks.
Handle core.symlinks=false case in merge-recursive.
Add core.symlinks to mark filesystems that do not support symbolic links.
Junio C Hamano [Mon, 5 Mar 2007 01:24:49 +0000 (17:24 -0800)]
Merge branch 'maint'
* maint:
GIT 1.5.0.3
glossary: Add definitions for dangling and unreachable objects
user-manual: more detailed merge discussion
user-manual: how to replace commits older than most recent
user-manual: insert earlier of mention content-addressable architecture
user-manual: ensure generated manual references stylesheet
user-manual: reset to ORIG_HEAD not HEAD to undo merge
Documentation: mention module option to git-cvsimport
Junio C Hamano [Mon, 5 Mar 2007 01:20:38 +0000 (17:20 -0800)]
GIT 1.5.0.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
Yasushi SHOJI [Sun, 4 Mar 2007 18:07:43 +0000 (03:07 +0900)]
glossary: Add definitions for dangling and unreachable objects
Define "dangling" and "unreachable" objects. Modified from original
text proposed by Yasushi Shoji.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Sat, 3 Mar 2007 20:34:27 +0000 (15:34 -0500)]
user-manual: more detailed merge discussion
Add more details on conflict, including brief discussion of file stages.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Sat, 3 Mar 2007 19:30:32 +0000 (14:30 -0500)]
user-manual: how to replace commits older than most recent
"Modifying" an old commit by checking it out, --amend'ing it, then
rebasing on top of it, is a slightly cumbersome technique, but I've
found it useful frequently enough to make it seem worth documenting.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Sat, 3 Mar 2007 19:04:42 +0000 (14:04 -0500)]
user-manual: insert earlier of mention content-addressable architecture
The content-addressable design is too important not to be worth at least
a brief mention a little earlier on.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Sat, 3 Mar 2007 18:33:48 +0000 (13:33 -0500)]
user-manual: ensure generated manual references stylesheet
The generated user manual is rather hard to read thanks to the lack of
the css that's supposed to be included from docbook-xsl.css.
I'm totally ignorant of the toolchain; grubbing through xmlto and
related scripts, the easiest way I could find to ensure that the
generated html links to the stylesheet is by calling xsltproc directly.
Maybe there's some better way.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Mon, 19 Feb 2007 23:46:09 +0000 (18:46 -0500)]
user-manual: reset to ORIG_HEAD not HEAD to undo merge
As Linus pointed out recently on the mailing list,
git reset --hard HEAD^
doesn't undo a merge in the case where the merge did a fast-forward. So
the rcommendation here is a little dangerous.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
J. Bruce Fields [Tue, 6 Feb 2007 07:51:26 +0000 (02:51 -0500)]
Documentation: mention module option to git-cvsimport
The git-cvsimport argument that specifies a cvs module to import should
probably be included in the default example.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sun, 4 Mar 2007 13:26:05 +0000 (14:26 +0100)]
cherry-pick: Suggest a better method to retain authorship
When a cherry-pick failed, we used to recommend setting environment
variables to retain the authorship. It is much easier, though, to use
the "-c" flag of git-commit.
Print this message also when merge-recursive fails (the code used to
exit(1) in that case, never reaching the proper failure path).
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong [Sun, 4 Mar 2007 08:15:29 +0000 (00:15 -0800)]
git-svn: fix show-ignore when not connected to the repository root
It was traversing the entire repository before.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sun, 25 Feb 2007 22:36:53 +0000 (23:36 +0100)]
Get rid of the dependency to GNU diff in the tests
Now that "git diff" handles stdin and relative paths outside the
working tree correctly, we can convert all instances of "diff -u"
to "git diff".
This commit is really the result of
$ perl -pi.bak -e 's/diff -u/git diff/' $(git grep -l "diff -u" t/)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from commit
c699a40d68215c7e44a5b26117a35c8a56fbd387)
Johannes Schindelin [Sun, 25 Feb 2007 22:36:31 +0000 (23:36 +0100)]
diff --no-index: support /dev/null as filename
This allows us to create "new file" and "delete file" patches.
It also cleans up the code.
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 08:17:27 +0000 (00:17 -0800)]
diff-ni: fix the diff with standard input
The earlier commit to read from stdin was full of problems, and
this corrects them.
- The mode bits should have been set to satisify S_ISREG(); we
forgot to the S_IFREG bits and hardcoded 0644;
- We did not give escape hatch to name a path whose name is
really "-". Allow users to say "./-" for that;
- Use of xread() was not prepared to see short read (e.g. reading
from tty) nor handing read errors.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Sun, 25 Feb 2007 22:36:10 +0000 (23:36 +0100)]
diff: support reading a file from stdin via "-"
This allows you to say
echo Hello World | git diff x -
to compare the contents of file "x" with the line "Hello World".
This automatically switches to --no-index mode.
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 07:45:14 +0000 (23:45 -0800)]
diff-ni: allow running from a subdirectory.
When run from a subdirectory of a repository, the command forgot
to adjust paths given to it with prefix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin [Thu, 1 Mar 2007 04:26:30 +0000 (05:26 +0100)]
Make git-revert & git-cherry-pick a builtin
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 06:51:46 +0000 (22:51 -0800)]
Merge branch 'js/diff-ni' (early part)
* 'js/diff-ni' (early part):
diff: make more cases implicit --no-index
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>
Johannes Sixt [Sat, 3 Mar 2007 19:38:00 +0000 (20:38 +0100)]
Tell multi-parent diff about core.symlinks.
When core.symlinks is false, and a merge of symbolic links had conflicts,
the merge result is left as a file in the working directory. A decision
must be made whether the file is treated as a regular file or as a
symbolic link. This patch treats the file as a symbolic link only if
all merge parents were also symbolic links.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Sixt [Sat, 3 Mar 2007 19:32:46 +0000 (20:32 +0100)]
Handle core.symlinks=false case in merge-recursive.
If the file system does not support symbolic links (core.symlinks=false),
merge-recursive must write the merged symbolic link text into a regular
file.
While we are here, fix a tiny memory leak in the if-branch that writes
real symbolic links.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>