Commit Graph

6000 Commits

Author SHA1 Message Date
Junio C Hamano
e7a0f6714b unpack-objects: remove stale and confusing comment
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>
2006-07-17 13:10:58 -07:00
Junio C Hamano
482faa8daf git-fetch: fix --keep vs --thin
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>
2006-07-17 13:01:27 -07:00
Junio C Hamano
9919f41c91 git-diff A...B to (usually) mean "git-diff git-merge-base A B B"
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>
2006-07-17 01:10:03 -07:00
Junio C Hamano
b9718d41c7 Merge branch 'sp/reflog'
* 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.
2006-07-17 01:08:11 -07:00
Junio C Hamano
7f95aef28f apply: handle type-changing patch correctly.
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>
2006-07-17 00:10:47 -07:00
Junio C Hamano
eed46644ca apply: split out removal and creation into different phases.
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>
2006-07-16 23:52:09 -07:00
Junio C Hamano
c28c571c14 apply: check D/F conflicts more carefully.
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>
2006-07-16 23:28:36 -07:00
Junio C Hamano
f8f0b1f0e7 checkout -f failed to check out a file if an existing directory interfered.
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>
2006-07-16 23:25:12 -07:00
Eric Wong
8641fb24ee typechange tests for git apply (currently failing)
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>
2006-07-16 22:15:21 -07:00
Eric Wong
7b520e62a2 git-svn: don't check for migrations/upgrades on commit-diff
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>
2006-07-16 13:46:47 -07:00
Junio C Hamano
26a8ad25b2 show-branch: fix performance problem.
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>
2006-07-16 00:00:09 -07:00
Junio C Hamano
76af073457 builtin-log: typefix for recent format-patch changes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14 22:47:53 -07:00
Pavel Roskin
2d023581c9 Set datarootdir in config.mak.in
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>
2006-07-14 22:33:12 -07:00
Pavel Roskin
66142aa1f5 Quote all calls to GIT_CONF_APPEND_LINE
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>
2006-07-14 22:33:10 -07:00
Josh Triplett
da56645dd7 Add option to set initial In-Reply-To/References
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>
2006-07-14 20:41:37 -07:00
Josh Triplett
cc35de8470 Add option to enable threading headers
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>
2006-07-14 20:41:37 -07:00
Josh Triplett
d1566f7883 git-format-patch: Make the second and subsequent mails replies to the first
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>
2006-07-14 20:41:36 -07:00
Jonas Fonseca
a3e65d74ee Documentation/urls.txt: Use substitution to escape square brackets
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>
2006-07-14 16:36:00 -07:00
Junio C Hamano
c7543ce0be Documentation/Makefile: product depends on asciidoc.conf
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14 16:32:38 -07:00
Junio C Hamano
5cd060b56c Merge branch 'lt/unitype'
* lt/unitype:
  builtin-prune.c: forgot TYPE => OBJ changes.
  Remove TYPE_* constant macros and use object_type enums consistently.
2006-07-14 15:39:19 -07:00
Junio C Hamano
1733832d8e Merge branch 'sp/lazy-mkdir'
* sp/lazy-mkdir:
  Make lazy mkdir more robust.
2006-07-14 15:38:37 -07:00
Sergey Vlasov
7eae7b993e Fix "git-fetch --tags" exit status when nothing has been changed
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>
2006-07-14 11:33:14 -07:00
Matthias Lederhofer
d5b9e6cfa7 argv created by handle_alias should be NULL terminated
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14 11:32:39 -07:00
Alp Toker
dd4c59121f documentation (urls.txt) typofix 2006-07-14 11:31:50 -07:00
Junio C Hamano
e5a78b1ca8 builtin-prune.c: forgot TYPE => OBJ changes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 23:37:52 -07:00
Linus Torvalds
93821bd97a sha1_file: add the ability to parse objects in "pack file format"
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>
2006-07-13 23:11:56 -07:00
Junio C Hamano
57a39690b9 fetch/clone: check return status from ls-remote
Some callers of ls-remote did not check its return status.
2006-07-13 23:10:21 -07:00
Shawn Pearce
8ef1c7c77d Record rebase changes as 'rebase' in the reflog.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 23:08:24 -07:00
Luben Tuikov
4b7ce6e2d6 gitweb.css: Use monospace fonts for commits and tree-diff.
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>
2006-07-13 22:02:43 -07:00
Alex Riesen
3dffd2c828 Do not use perl in git-commit.sh
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>
2006-07-13 22:00:16 -07:00
Timo Hirvonen
f5b571fcf7 diff: Support 256 colors
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>
2006-07-13 21:53:25 -07:00
Timo Hirvonen
f37399e6b0 diff: Support both attributes and colors
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>
2006-07-13 21:53:23 -07:00
Matthias Lederhofer
ff4d78041e Documentation about exclude/ignore files
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>
2006-07-13 21:52:42 -07:00
Matthias Lederhofer
a5262768e1 daemon: new option --detach to run git-daemon in background
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:50:46 -07:00
Matthias Lederhofer
45ed5d7f4c daemon: new option --pid-file=<path> to store the pid
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:50:41 -07:00
Matthias Lederhofer
5f490ce03c upload-pack: ignore write errors to stderr
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:50:22 -07:00
Matthias Lederhofer
258e93a155 daemon: if one of the standard fds is missing open it to /dev/null
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:50:20 -07:00
Matthias Lederhofer
ad8b4f56b5 daemon: use a custom die routine with syslog
Removed the git-daemon prefix from die() because no other call to die
does this.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:50:14 -07:00
Junio C Hamano
8d5e26848d Documentation: Fix ssh://[user@]host.xz URL
Earlier commit c3f17061 broke asciidoc markup.

Noticed by Alp Toker with a fix, but fixed up in a way with smaller
formatting impact.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:48:45 -07:00
Junio C Hamano
855409296d Adjust t4013 tests to corrected format-patch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:40:44 -07:00
Robert Shearman
19b3bd3e2d format-patch: Generate a newline between the subject header and the message body
format-patch previously didn't generate a newline after a subject. This
caused the diffstat to not be displayed in messages with only one line
for the commit message.
This patch fixes this by adding a newline after the headers if a body
hasn't been added.
Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:40:43 -07:00
Junio C Hamano
a40d384cac t4013 diff format tests update
This changes one test commit in the sequence to have more than
one lines of commit log.  A few output formats (--pretty=email
aka format-patch and --pretty=oneline) need to behave
differently on single and multi-line log, and this change will
help catching breakages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:40:43 -07:00
Jakub Narebski
5716e794bf Display help for Git mode after pressing h' or ?' in *git-status*
Add bindings for "h" and "?" in git-status-mode to display help about the mode,
including keymap via (describe-function 'git-status-mode), like in PCL-CVS.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:21:34 -07:00
Jakub Narebski
1b3a667461 Wrap long lines in docstrings in contrib/emacs/git.el
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:21:27 -07:00
Linus Torvalds
1974632c66 Remove TYPE_* constant macros and use object_type enums consistently.
This updates the type-enumeration constants introduced to reduce
the memory footprint of "struct object" to match the type bits
already used in the packfile format, by removing the former
(i.e. TYPE_* constant macros) and using the latter (i.e. enum
object_type) throughout the code for consistency.

Eventually we can stop passing around the "type strings"
entirely, and this will help - no confusion about two different
integer enumeration.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-12 23:18:03 -07:00
Shawn Pearce
756aaf4ac5 Make lazy mkdir more robust.
Linus Torvalds <torvalds@osdl.org> wrote:

  It's entirely possible that we should just make that whole

	  if (ret == ENOENT)

  go away. Yes, it's the right error code if a subdirectory is missing, and
  yes, POSIX requires it, and yes, WXP is probably just a horrible piece of
  sh*t, but on the other hand, I don't think git really has any serious
  reason to even care.
2006-07-12 23:16:29 -07:00
Junio C Hamano
d3ba675aae Merge branch 'ml/trace'
* ml/trace:
  test-lib: unset GIT_TRACE
  GIT_TRACE: fix a mixed declarations and code warning
  GIT_TRACE: show which built-in/external commands are executed
2006-07-12 23:09:10 -07:00
Junio C Hamano
1d0361e806 test-lib: unset GIT_TRACE
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-12 23:09:00 -07:00
Junio C Hamano
a72f9373c0 git-repack: avoid redirecting stderr into git-pack-objects
We are trying to catch error condition of git-rev-list and cause
the downstream pack-objects to barf, but if you run rev-list
with anything that mucks with its stderr (such as GIT_TRACE),
any stderr output would cause the pipeline to fail.

[jc: originally from Matthias Lederhofer, with a reworded error message.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-12 23:00:46 -07:00
Junio C Hamano
869659a6a1 Fix grammatical error in git-revert
We always talk about "commit xyz".

We never talk about "xyz commit", except when we end up talking
about a commit as a branch head (notably, I would say "the HEAD
commit", or possibly "the top-of-master commit", but here
$commit is a SHA1 name, not anything else).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-12 22:51:25 -07:00