3cb22b8 (Per-ref reflog expiry configuration, 2008-06-15) added support
for setting the expiry parameters differently for different reflog, but
it was never documented.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"git am -3" first tries to apply the patch without any extra trick, and
applies it to a synthesized tree for 3-way merge after the first attempt
fails. "git apply" exits with status 1 for a patch that is well-formed
but is not applicable (and it dies on other errors with non-zereo, non-1
status) and has an optimization to fall back to the 3-way merge only in
the case.
An earlier patch 3ddd170 (am: suppress apply errors when using 3-way,
2009-06-16) squelched diagnostic messages from the first attempt, not to
be shown to the end user. This worked reasonably well if the reason the
first application failed was because the patch was made against a wrong
version.
When the patch is corrupt (e.g. line-wrapped or leading whitespaces got
dropped), however, because the second patch application is not even
attempted, the error message from the first application is never shown
and is forever lost. This message is necessary to locate where the patch
is corrupt and fix it up.
We could fix this issue by reverting 3dd170, or keeping the error message
to somewhere and showing it, but because this is an error codepath, the
easiest is to disable the optimization. The second patch application is
attempted even when the input is corrupt, and it will notice, diagnose,
and stop with an error message.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This teaches the --color-words engine a more general interface that
supports two new modes:
* --word-diff=plain, inspired by the 'wdiff' utility (most similar to
'wdiff -n <old> <new>'): uses delimiters [-removed-] and {+added+}
* --word-diff=porcelain, which generates an ad-hoc machine readable
format:
- each diff unit is prefixed by [-+ ] and terminated by newline as
in unified diff
- newlines in the input are output as a line consisting only of a
tilde '~'
Both of these formats still support color if it is enabled, using it
to highlight the differences. --color-words becomes a synonym for
--word-diff=color, which is the color-only format. Also adds some
compatibility/convenience options.
Thanks to Junio C Hamano and Miles Bader for good ideas.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When using git log --pretty='%N' without an explicit --show-notes, git
would segfault. This patches fixes this behaviour by loading the needed
notes datastructures if --pretty is used and the format contains %N.
When --pretty='%N' is used together with --no-notes, %N won't be
expanded.
This is an extension to a proposed patch by Jeff King.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If more than one annotated tag points at the same commit, use the
tag whose tagger field has a more recent date stamp. This resolves
non-deterministic cases where the maintainer has done:
$ git tag -a -m "2.1-rc1" v2.1-rc1 deadbeef
$ git tag -a -m "2.1" v2.1 deadbeef
If the tag is an older-style annotated tag with no tagger date, we
assume a date stamp at the UNIX epoch. This will cause us to prefer
an annotated tag that has a valid date.
We could also try to consider the tag object chain, favoring a tag
that "includes" another one:
$ git tag -a -m "2.1-rc0" v2.1-rc1 deadbeef
$ git tag -a -m "2.1" v2.1 v2.1-rc1
However traversing the tag's object chain looking for inclusion
is much more complicated. Its already very likely that even in
these cases the v2.1 tag will have a more recent tagger date than
v2.1-rc1, so with this change describe should still resolve this
by selecting the more recent v2.1.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The default for gc.aggressiveWindow has been 250 since 1c192f3
(gc --aggressive: make it really aggressive, 2007-12-06).
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git remote-testgit is written in Python. In a NO_PYTHON build, tests
using it would fail, so skip them.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Just like with committer dates, we parse the tagger date into the
struct tag so its available for further downstream processing.
However since the tagger header was not introduced until Git 0.99.1
we must consider it optional. For tags missing this header we use
the default date of 0.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This code was horribly ugly to follow. The structure of the headers
in an annotated tag object must follow a prescribed order, and most
of these are required. Simplify the entire parsing logic by going
through the headers in the order they are supposed to appear in,
acting on each header as its identified in the buffer.
This change has the same behavior as the older version, its just
easier to read and maintain.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Its documented as unused. So lets just drop it from the structure
since we haven't ever used it.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
These lines were incorrectly indented with spaces, violating our
coding style. Its annoying to read with 4 position tab stops, so
fix the indentation to be correct.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In the same spirit as commit 9892bebafe, let's avoid allocating the full
buffer for the deflated data in write_compressed() in order to write it.
Let's deflate and write the data in chunks instead to reduce memory
usage.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rework the loop to remove duplicated calls to use() and fill(), and
to make the code easier to read.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In the same spirit as commit 9892bebafe, let's avoid allocating the full
buffer for the deflated data in get_data_from_pack() in order to inflate
it. Let's read and inflate the data in chunks instead to reduce memory
usage.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Also move -X's description next to -s's in merge-options.txt.
This makes it easier to learn how to specify merge strategy options.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A caller of start_command can set the member 'dir' to a directory to
request that the child process starts with that directory as CWD. The first
user of this feature was added recently in eee49b6 (Teach diff --submodule
and status to handle .git files in submodules).
On Windows, we have been lazy and had not implemented support for this
feature, yet. This fixes the shortcoming.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In particular, add a missing && to the update --init test.
The goal is to make it clearer what happened when one of these
tests fails. The update --init test is currently (consistently)
failing on a few unusual machines.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A new reader may not realize what properties the $submodurl
repository needs to have.
One of the tests is checking that ‘submodule add -b foo’ creates
a ‘foo’ branch. Put this test in context by checking that
without -b, no ‘foo’ branch is created.
While at it, make sure each added submodule is a reasonable
repository, with clean index, no stray files, and so on.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The setup in t7400-submodule-basic does a number of different
things to support different tests. Splitting it up makes the
test a little easier to read and should provide an opportunity
to move each piece of setup closer to the tests that require it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When using macros it is otherwise hard to know whether an
attribute set by the macro should override an already set
attribute. Consider the following .gitattributes file:
[attr]mybinary binary -ident
* ident
foo.bin mybinary
bar.bin mybinary ident
Without this patch both foo.bin and bar.bin will have
the ident attribute set, which is probably not what
the user expects. With this patch foo.bin will have an
unset ident attribute, while bar.bin will have it set.
Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When using macros it isn't inconceivable to have an attribute
being set by a macro, and then being reset explicitly.
Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When debug_set() was called during macro expansion, it
received a pointer to a struct git_attr rather than a
string.
Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mr/gitweb-jsmin:
gitweb: update INSTALL to use shorter make target
gitweb: add documentation to INSTALL regarding gitweb.js
instaweb: add minification awareness
Gitweb: add autoconfigure support for minifiers
Gitweb: add support for minifying gitweb.css
Gitweb: add ignore and clean rules for minified files
The way the code stored --smtp-domain was unlike its handling of other
similar options. Bring it in line with the others by:
- Renaming $mail_domain to $smtp_domain to match the command line
option. Also move its declaration from near the top of the file to
near other option variables.
- Removing $mail_domain_default. The variable was used once and only
served to move the default away from where it gets used.
- Adding a sendemail.smtpdomain config option. smtp-domain was the
only SMTP configuration option that couldn't be set in the user's
.gitconfig.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Although Net::Domain::domainname attempts to be very thorough, the
host's configuration can still refuse to give a FQDN. Check to see if
what we receive contains a dot as a basic sanity check.
Since the same condition is used twice and getting complex, let's move
it to a new function.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
As Jakub Narebski pointed out on the list, Perl code usually prefers
sub func {
}
over
sub func
{
}
git-send-email.perl is somewhat inconsistent in its style, with 23
subroutines using the first style and 6 using the second. Convert the
few odd subroutines so that the code matches normal Perl style.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The simple test for an existing .git directory gives an incorrect result
if .git is a file that records "gitdir: overthere". So for submodules that
use a .git file, "git status" and the diff family - when the "--submodule"
option is given - did assume the submodule was not populated at all when
a .git file was used, thus generating wrong output or no output at all.
This is fixed by using read_gitfile_gently() to get the correct location
of the .git directory. While at it, is_submodule_modified() was cleaned up
to use the "dir" member of "struct child_process" instead of setting the
GIT_WORK_TREE and GIT_DIR environment variables.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Every code site except check_preimage() uses either memset() or declares
a static instance of "struct checkout" to achieve proper initialization.
Lets use memset() instead of explicit initialization of all members here
too to be on the safe side in case this structure is expanded someday.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>