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>
When naming commits, stop walking the parent chain as soon as we find
a commit that already has a name. The parent chain of that commit will
be walked later on in any case (or may even have been walked already).
This avoids O(n^2) behavior; on a tree where show-branch displays 6800
commits, the total run time drops from 77 seconds to 5 seconds.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
For some repositories, deltas simply don't make sense. One can disable
them for git-repack by adding --window, but git-push insists on making
the deltas which can be very CPU-intensive for little benefit.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
It may be desirable for the compiler to disable linking against Fink
or DarwinPorts, especially if both are installed on the system and
the user wants GIT to be linked specifically to only one of them.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
By default, running git-status again will now reuse an existing buffer
that displays the same directory. The old behavior of always creating
a new buffer can be obtained by customizing the git-reuse-status-buffer
option.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This way the ignore command will really only ignore the marked files
and not files with the same name in subdirectories.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Log output from SVN doesn't list all the new files that were
added if a new directory was copied from an existing place in
the repository. This means we'll have to do some extra work and
traverse new directories ourselves.
This has been updated from the original patch to defer traversed
adds until all removals have been done. Please disregard the
original.
Thanks to Ben Williamson for the excellent bug report and
testing.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
By default, git-tar-tree(1) sets file and directories modes to 0666
or 0777. While this is both useful and acceptable for projects such
as the Linux Kernel, it might be excessive for other projects. With
this variable, it becomes possible to tell git-tar-tree(1) to apply
a specific umask to the modes above. The special value "user"
indicates that the user's current umask will be used. This should be
enough for most projects, as it will lead to the same permissions as
git-checkout(1) would use. The default value remains 0, which means
world read-write.
Signed-off-by: Willy Tarreau <w@1wt.eu>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
On cygwin, when you try to create a symlink over a directory, you do
not get EEXIST, but EACCES.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch adds support for -a which will add an "Author: " line, and possibly
a "Committer: " line to the bottom of the commit message for CVS.
The commit message parser is now a little bit better, and some warnings
have been cleaned up.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The very initial version of unpack-objects.c::unpack_all() used
to unpack from the end of the pack, but since end of June last
year it was changed to stream from the front and the comment
does not reflect the reality anymore.
Signed-off-by: Junio C Hamano <junkio@cox.net>
When --keep is specified there is no reason to pass --thin to git-fetch-pack,
which are mutually exclusive. This does not hurt because fetch-pack disables
thin transfer when both are given internally, but still is confusing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This tweaks the argument parser of "git diff" to allow "git-diff
A...B" to show diffs leading to B since their merge-base, when
there is only one sensible merge base between A and B.
Currently nonsense cases are thrown at combined-diff to produce
nonsense results, which would eventually need to be fixed.
Signed-off-by: Junio C Hamano <junkio@cox.net>
* sp/reflog:
Record rebase changes as 'rebase' in the reflog.
Log ref changes made by resolve.
Log ref changes made by quiltimport.
Log ref changes made by git-merge and git-pull.
A type-change diff is always split into a patch to delete old,
immediately followed by a patch to create new. check_patch()
routine noticed that the path to be created already exists in
the working tree and/or in the index when looking at the
creation patch and mistakenly thought it to be an error.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This reworks write_out_result() loop so we first remove the paths that
are to go away and then create them after finishing all the removal.
This is necessary when a patch creates a file "foo" and removes a file
"foo/bar".
Signed-off-by: Junio C Hamano <junkio@cox.net>
When creating a new file where a directory used to be (or the user had
an empty directory) the code did not check the result from lstat() closely
enough, and mistakenly thought the path already existed in the working tree.
This does not fix the problem where you have a patch that creates a file
at "foo" and removes a file at "foo/bar" (which presumably is the last file
in "foo/" directory in the original). For that, we would need to restructure
write_out_results() loop.
Signed-off-by: Junio C Hamano <junkio@cox.net>
When path foo/bar existed in the working tree, checkout -f to switch to
a branch that has a file foo silently did a wrong thing. It failed to
remove the directory foo, did not check out the file foo, and the worst
of all it did not report any errors.
Signed-off-by: Junio C Hamano <junkio@cox.net>
I've found that git apply is incapable of handling patches
involving object type changes to the same path.
Of course git itself is perfectly capable of making commits that
generate these changes, as it only tracks trees states. It's
just that the diffs between them are less useful if they can't
be applied.
Some of these are rare, but I've hit one of them (file becoming
a symlink) recently in real-world usage, and was inspired to
find more potential breakages :)
I'm not sure when I'll have time to fix these myself and I'm not
very familiar with the apply code. So if someone could get
some or all of these cases working, they would be my hero :)
Some of these are what I would refer to as corner-cases from
hell. Most (if not all) other systems fail some of these. In
fact, they aren't even capable of representing most of these
changes in their histories; much less being able to handle
patches to that effect.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Unlike other git-svn commands, commit-diff is intended to
operate without needing any additional metadata inside .git
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The core function used in show-branch, join_revs(), was supposed
to be exactly the same algorithm as merge_bases(), except that
it was a version enhanced for use with more than two heads.
However, it needed to mark and keep a list of all the commits it
has seen, because it needed them for its semi-graphical output.
The function to implement this list, mark_seen(), stupidly used
insert_by_date(), when it did not need to keep the list sorted
during its processing. This made "show-branch --merge-base"
more than 20x slower compared to "merge-base --all" in some
cases (e.g. between b5032a5 and 48ce8b0 in the Linux 2.6 kernel
archive). The performance of "show-branch --independent"
suffered from the same reason.
This patch sorts the resulting list after the list traversal
just once to fix these problems.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Autoconf 2.60 expresses datadir in terms of datarootdir. If datarootdir
is not substituted, configure issues a warning and uses a compatibility
substitution for datadir.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Not quoting macro arguments that contain other macros is a big no-no in
Autoconf. It can break at any time.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add the --in-reply-to option to provide a Message-Id for an initial
In-Reply-To/References header, useful for including a new patch series as part
of an existing thread.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add a --thread option to enable generation of In-Reply-To and References
headers, used to make the second and subsequent mails appear as replies to the
first.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add message_id and ref_message_id fields to struct rev_info, used in show_log
with CMIT_FMT_EMAIL to set Message-Id and In-Reply-To/References respectively.
Use these in git-format-patch to make the second and subsequent patch mails
replies to the first patch mail.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This changes "[user@]" to use {startsb} and {endsb} to insert [ and ],
similar to how {caret} is used in git-rev-parse.txt.
[jc: Removed a well-intentioned comment that broke the final
formatting from the original patch. While we are at it,
updated the paragraph that claims to be equivalent to the
section that was updated earlier without making matching
changes.]
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
After commit 55b7835e1b git-fetch --tags
exits with status 1 when no tags have been changed, which breaks calling
git-fetch from scripts.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The pack-file format is slightly different from the traditional git
object format, in that it has a much denser binary header encoding.
The traditional format uses an ASCII string with type and length
information, which is somewhat wasteful.
A new object format starts with uncompressed binary header
followed by compressed payload -- this will allow us later to
copy the payload straight to packfiles.
Obviously they cannot be read by older versions of git, so for
now new object files are created with the traditional format.
core.legacyheaders configuration item, when set to false makes
the code write in new format for people to experiment with.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Use monospace fonts for the commit header, commit message,
and tree-diff. This helps viewing commit logs with ASCII art.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-commit.sh has the only one place where perl is used
and there it can quite trivially be done in sh.
git-ls-files without "-z" produces quoted output, even if
is different from that produced by perl code it is good
enough.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Add support for more than 8 colors. Colors can be specified as numbers
-1..255. -1 is same as "normal".
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Make it possible to set both colors and a attribute for diff colors.
Background colors are supported too.
Syntax is now:
[attr] [fg [bg]]
[fg [bg]] [attr]
Empty value is same as "normal normal", ie use default colors. The new
syntax is backwards compatible.
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Use .git/info/exclude in the example in git-ls-files.txt,
instead of .git/ignore, and update the list of commands looking
at .git/info/exclude in repository-layout.txt.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>