There currently is an unfortunate circular dependency between
what init_revisions (the command line revision specification
parser) does and setting up the log and diff options. The
function uses setup_git_directory() to find the root of the
project relative to the current directory and calls diff_setup()
to prepare diff generation. However, some of the things that
diff_setup() does needs to depend on the configuration variable,
which needs to be read after setup_git_directory() is called.
This patch is a low impact workaround. It first lets
init_revisions() to run and do its thing, then uses git_config()
and diff_setup() after it returns, so that configuration
variables that affects the diff operation can be used from
subdirectories.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This makes it possible to fetch many commits (refs) at once, greatly
speeding up cg-clone.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
pull() now takes an array of arguments instead of just one of each kind.
Currently, no users use the new capability, but that'll change.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Currently it's a bit weird that pull() takes a single argument
describing the commit but takes the write_ref from a global variable.
This makes it take that as a parameter as well, which might be nicer
for the libification in the future, but especially it will make for
nicer code when we implement pull()ing multiple commits at once.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Mail I get sometimes has multiple From lines, like this:
From Majordomo@vger.kernel.org Thu Jul 27 16:39:36 2006
>From mtsirkin Thu Jul 27 16:39:36 2006
Received: from yok.mtl.com [10.0.8.11]
...
which confuses git-mailinfo since that does not recognize >From
as a valid header line.
This patch makes it recognize >From XXX as a valid header line.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This is a really ancient remnant of the short era of delta objects stored
directly in the object database.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-update-ref writes into the lockfile, and renames it afterwards. Like
commit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared
setups: every developer can have a different primary group; what matters
is that $GIT_DIR/refs/heads has to be writable by a group you are in.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This fixes the builtin mv for the test which Josef provided, and also
fixes moving directories into existing directories, as noted by Jon Smirl.
In case the destination exists, fail early (this cannot be overridden
by -f).
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This also moves add_file_to_index() to read-cache.c. Oh, and while
touching builtin-add.c, it also removes a duplicate git_config() call.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This backports the pieces that are not uncooked from the merge-recursive
WIP we have seen earlier, to be used in git-mv rewritten in C.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Earlier, cvsserver barfed when you tried to check in files with a
multiline commit message.
That is what Argumentx is for... Argument: lines can be followed by
several Argumentx: lines, which means they should be appended.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
If dir2 already exists, git-mv should move dir1 _into_dir2/.
Noticed by Jon Smirl.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Not everybody installs git to /usr/bin/git.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
So test for it, and do not always try to load mod_cgi.o.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
With this, you can say
git --bare repack -a -d
inside a bare repository, and it will actually work. While at it,
also move the --version, --help and --exec-path options to the
handle_options() function.
While at documenting the new options, also document the --paginate
option.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Now, something like
[alias]
pd = -p diff
works as expected.
[jc: a follow-up fix from Jeff King folded in.]
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Turns out that DBD::SQLite does not favour preparing statements which are
never executed. So, turn all 4 statements, which were prepared _always_,
into methods, like the other 12 prepared statements.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch defines $state->{prependdir} as the empty string, so that
quite a few warnings are avoided.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
I have a tag with a comment which includes an & character. Firefox wouldn't
display my gitweb summary page due to malformed XML. This solves the problem.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* jt/format-patch:
builtin-log: typefix for recent format-patch changes.
Add option to set initial In-Reply-To/References
Add option to enable threading headers
git-format-patch: Make the second and subsequent mails replies to the first
* ew/apply:
Fix t4114 on cygwin
apply: handle type-changing patch correctly.
apply: split out removal and creation into different phases.
apply: check D/F conflicts more carefully.
typechange tests for git apply (currently failing)
Eliminate git_read_blame_line() -- move that code inline and
optimize it.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Centralize printing of the page path so that
if the entity is a blob, we can set the page path
to be the link to the HEAD revision of the
"raw" blob.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
A revision block is the largest number of adjacent
lines of code originating from the same revision.
This patch adds color to git_blame2(), in that no two
adjacent revision blocks have the same color. The color
alternates between light and dark.
As we annotate the code lines, we alternate the color
(light, dark) of code lines _per revision_. This makes it
easier to see line conglomerations per revision.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Some callers of git_history() do not set $hash of $file_name.
Add code to find it, if it is not defined.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch adds the capability of back-trekking through
commits from git_blame2() as follows:
blame2->commit->blame2->commit->blame2->...->initial commit.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch adds an alternative simple working git-blame
called git_blame2(). Simple, because it displays just
three columns: the commit, the line number and the line
of code. Alternative, because the original git_blame()
is left untouched. Lines of code are printed html
escaped, but as-is.
git_blame2() uses git-blame as opposed to git-annotate
used by git_blame().
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
In "history" view, the "page_path" is now also a URL link to
the "raw" format of the file, which will always give you
the latest version in the repository.
This is helpful for externally linking files, such that
the latest version is always referenced and in "raw" format.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Teach git_history() to take its hash argument from
the hb parameter, i.e. from $hash_base. Also change
all "a=history" actions to pass "hb=" instead of "h=".
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Linus:
get_pathspec() does turn '.' into an empty string (which is
correct - git internally does _not_ ever understand the notion of
"." as the current working directory), but it doesn't ever do the
optimization of noticing that a pathspec that consists solely of
an empty string is "equivalent" to an empty pathspec.
The test is to ensure that this behaviour stays.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch brings the benefits of part of v1.4.1-rc2~37
to the "commit" colorizing patch.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When paging through the output of git-whatchanged, the color cues help to
visually navigate within a diff. However, it is difficult to notice when a
new commit starts, because the commit and log are shown in the "normal"
color. This patch colorizes the 'commit' line, customizable through
diff.colors.commit and defaulting to yellow.
As a side effect, some of the diff color engine (slot enum, get_color) has
become accessible outside of diff.c.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
It makes no sense to accept an mbox via stdin when we
won't accept it on the commandline.
The patch helps the following scenario:
# git init-db
"add file1 with content"
# git checkout -b apply
"edit file1 && commit"
# git checkout -b conflict master
"edit file1 && commit"
# git checkout -b ok master
"add file2"
# git checkout apply
# git format-patch -k -3 master..conflict | git am -k -3
=> git-am fails with a conflict message
# git reset --hard
# git format-patch -k -3 master..ok | git am -k -3
=> git am fails with the same conflict message as above,
=> since it's trying to apply the old .dotest directory
With the patch it complains about an old .dotest
directory instead.
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>