Commit Graph

6955 Commits

Author SHA1 Message Date
Peter Baumann
0f03ca9461 config option log.showroot to show the diff of root commits
This allows one to see a root commit as a diff in commands like git-log,
git-show and git-whatchanged.

Signed-off-by: Peter Baumann <Peter.B.Baumannn@stud.informatik.uni-erlangen.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24 02:35:26 -08:00
Junio C Hamano
3fbe2d54d7 Merge branch 'jc/upload-pack'
* jc/upload-pack:
  upload-pack: stop the other side when they have more roots than we do.
2006-11-24 02:34:27 -08:00
Eric Wong
30d055aa1e git-svn: handle authentication without relying on cached tokens on disk
This is mostly gleaned off SVN::Mirror, with added support for
--no-auth-cache and --config-dir.

Even with this patch, git-svn does not yet support repositories
where the user only has partial read permissions.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24 02:23:22 -08:00
Iñaki Arenaza
73bcf53342 git-cvsimport: add support for CVS pserver method HTTP/1.x proxying
This patch adds support for 'proxy' and 'proxyport' connection options
when using the pserver method for the CVS Root.

It has been tested with a Squid 2.5.x proxy server.

Quoting from the CVS info manual:

     The `gserver' and `pserver' connection methods all accept optional
  method options, specified as part of the METHOD string, like so:

       :METHOD[;OPTION=ARG...]:

     Currently, the only two valid connection options are `proxy', which
  takes a hostname as an argument, and `proxyport', which takes a port
  number as an argument.  These options can be used to connect via an HTTP
  tunnel style web proxy.  For example, to connect pserver via a web proxy
  at www.myproxy.net and port 8000, you would use a method of:

       :pserver;proxy=www.myproxy.net;proxyport=8000:

     *NOTE: The rest of the connection string is required to connect to
  the server as noted in the upcoming sections on password authentication,
  gserver and kserver.  The example above would only modify the METHOD
  portion of the repository name.*

     PROXY must be supplied to connect to a CVS server via a proxy
  server, but PROXYPORT will default to port 8080 if not supplied.
  PROXYPORT may also be set via the CVS_PROXY_PORT environment variable.

Signed-off-by: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24 02:21:29 -08:00
Petr Baudis
7182135189 Make git-clone --use-separate-remote the default
We've talked about this for quite some time on the list, and it
is a sane thing to do for a repository with an associcated
working tree.

For somebody who wants to use the traditional layout, there is a
backward compatibility option --use-immingled-remote, but it is
expected to be removed before the next major release.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 22:53:06 -08:00
Junio C Hamano
29561ad0ad refs outside refs/{heads,tags} match less strongly.
This changes the refname matching logic used to decide which ref
is updated with git-send-pack.  We used to error out when
pushing 'master' when the other end has both 'master' branch and
a tracking branch 'remotes/$name/master' but with this, 'master'
matches only 'refs/heads/master' when both and no other 'master'
exist.

Pushing 'foo' when both heads/foo and tags/foo exist at the
remote end is still considered an error and you would need to
disambiguate between them by being more explicit.

When neither heads/foo nor tags/foo exists at the remote,
pushing 'foo' when there is only remotes/origin/foo is not
ambiguous, while it still is ambiguous when there are more than
one such weaker match (remotes/origin/foo and remotes/alt/foo,
for example).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 22:52:52 -08:00
Andy Parkins
f73da29fa2 Increase length of function name buffer
In xemit.c:xdl_emit_diff() a buffer for showing the function name as
commentary is allocated; this buffer was 40 characters.  This is a bit
small; particularly for C++ function names where there is often an
identical prefix (like void LongNamespace::LongClassName) on multiple
functions, which makes the context the same everywhere.  In other words
the context is useless.  This patch increases that buffer to 80
characters - which may still not be enough, but is better

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 22:51:41 -08:00
Eric Wong
4769489a41 git-svn: preserve uncommitted changes after dcommit
Using dcommit could cause the user to lose uncommitted changes
during the reset --hard operation, so change it to reset --mixed.

If dcommit chooses the rebase path, then git-rebase will already
error out when local changes are made.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 15:17:46 -08:00
Eric Wong
e70dc780a4 git-svn: correctly handle revision 0 in SVN repositories
some SVN repositories have a revision 0 (committed by no author
and no date) when created; so when we need to ensure that we
check any revision variables are defined, and not just
non-zero.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 15:17:45 -08:00
Eric Wong
48d044b5fe git-svn: error out from dcommit on a parent-less commit
dcommit would unconditionally append "~1" to a commit in order
to generate a diff.  Now we generate a meaningful error message
if we try to generate an impossible diff.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 15:17:43 -08:00
René Scharfe
0ea865ce7a archive-zip: don't use sizeof(struct ...)
We can't rely on sizeof(struct zip_*) returning the sum of
all struct members.  At least on ARM padding is added at the
end, as Gerrit Pape reported.  This fixes the problem but
still lets the compiler do the summing by introducing
explicit padding at the end of the structs and then taking
its offset as the combined size of the preceding members.

As Junio correctly notes, the _end[] marker array's size
must be greater than zero for compatibility with compilers
other than gcc.  The space wasted by the markers can safely
be neglected because we only have one instance of each
struct, i.e. in sum 3 wasted bytes on i386, and 0 on ARM. :)

We still rely on the compiler to not add padding between the
struct members, but that's reasonable given that all of them
are unsigned char arrays.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-23 14:20:32 -08:00
Junio C Hamano
e945f95157 GIT 1.4.4.1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-22 16:57:34 -08:00
Junio C Hamano
2bbaaed9ee trust-executable-bit: fix breakage for symlinks
An earlier commit f28b34a broke symlinks when trust-executable-bit
is not set because it incorrectly assumed that everything was a
regular file.

Reported by Juergen Ruehle.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-22 16:36:49 -08:00
Chris Riddoch
5d1faf8791 Move --pretty options into Documentation/pretty-formats.txt
Asciidoc-include it into the manuals for programs that use the
--pretty command-line option, for consistency among the docs.

This describes all the pretty-formats currently listed in the cmit_fmt
enum in commit.h, and also briefly describes the presence and format
of the 'Merge: ' line in some pretty formats.

There's a hedge that limiting your view of history can affect what
goes in the Merge: line, and that --abbrev/--no-abbrev do nothing to
the 'raw' format.

Signed-off-by: Chris Riddoch <chris@syntacticsugar.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-22 16:06:32 -08:00
Paolo Ciarrocchi
5942706357 Doc: Make comment about merging in tutorial.txt more clear
Rephrased a sentence in order to make more clear the concept of
pull . branch

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-21 19:01:29 -08:00
Michal Rokos
aa9098611f archive: use setvbuf() instead of setlinebuf()
This tiny patch makes GIT compile again on HP-UX 11i.

[jc: The setlinebuf() is described as unportable to BSD before
 4.2; it's not even in POSIX, while setvbuf() is in ISO C.]

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-21 16:57:55 -08:00
Paolo Ciarrocchi
69945602f9 Teach SubmittingPatches about git-commit -s
As discussed on git mailing list let's teach the reader about
the possiblity to have automatically signed off the commit running
the git-commit -s command

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-21 11:40:18 -08:00
Junio C Hamano
ef06b91804 do_for_each_ref: perform the same sanity check for leftovers.
An earlier commit b37a562a added a check to see if the ref
points at a valid object (as a part of 'negative ref' support
which we currently do not use), but did so only while iterating
over both packed and loose refs, and forgot to apply the same
check while iterating over the remaining ones.

We might want to replace the "if null then omit it" check with
"eh --- what business does a 0{40} value have here?" complaint
later since we currently do not use negative refs, but that is
a separate issue.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-19 18:44:29 -08:00
Junio C Hamano
6c96c0f194 git-fetch: follow lightweit tags as well.
This side-ports commit fd19f620 from Cogito, in which I fixed
exactly the same bug.  Somehow nobody noticed this for a long
time in git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-19 18:44:23 -08:00
Petr Baudis
198a4f4ff0 Documentation: Correct alternates documentation, document http-alternates
For one, the documentation invalidly claimed that the paths have to be
absolute when that's not the case and in fact there is a very valid reason
not to use absolute paths (documented the reason as well).

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 16:29:46 -08:00
Petr Baudis
e3d457fb59 Documentation: Define symref and update HEAD description
HEAD was still described as a symlink instead of a symref.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 14:04:51 -08:00
Rene Scharfe
fd931411c0 Document git-runstatus
I copied most of the text from git-status.txt.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 14:04:45 -08:00
Rene Scharfe
3dad11bfdb git-apply: slightly clean up bitfield usage
This patch fixes a sparse warning about inaccurate_eof being a
"dubious one-bit signed bitfield", makes three more binary
variables members of this (now unsigned) bitfield and adds a
short comment to indicate the nature of two ternary variables.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 11:40:11 -08:00
Rene Scharfe
38f4d138ee sparse fix: Using plain integer as NULL pointer
Z_NULL is defined as 0, use a proper NULL pointer in its stead.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 11:40:07 -08:00
Rene Scharfe
a6e8a76770 sparse fix: non-ANSI function declaration
The declaration of discard_cache() in cache.h already has its "void".

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 11:40:00 -08:00
Petr Baudis
f847c07b9a git-apply: Documentation typo fix
inacurate -> inaccurate, sorry if it was a pun. ;-)

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 11:09:55 -08:00
Petr Baudis
f8290630cb Fix git-for-each-refs broken for tags
Unfortunately, git-for-each-refs is currently unusable for peeking into tag
comments, since it uses freed pointers, so it just prints out all sort of
garbage.

This makes it strdup() contents and body values.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-18 11:09:46 -08:00
Linus Torvalds
6b1f8c32b1 "git fmt-merge-msg" SIGSEGV
Ok, this is a _really_ stupid case, and I don't think it matters, but hey,
we should never SIGSEGV.

Steps to reproduce:

	mkdir duh
	cd duh
	git init-db
	git-fmt-merge-msg < /dev/null

will cause a SIGSEGV in cmd_fmt_merge_msg(), because we're doing a
strncmp() with a NULL current_branch.

And yeah, it's an insane schenario, and no, it doesn't really matter. The
only reason I noticed was that a broken version of my "git pull" into an
empty directory would cause this.

This silly patch just replaces the SIGSEGV with a controlled exit with an
error message.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-16 23:45:57 -08:00
Linus Torvalds
d09e79cb1c git-pull: allow pulling into an empty repository
We used to complain that we cannot merge anything we fetched
with a local branch that does not exist yet.  Just treat the
case as a natural extension of fast forwarding and make the
local branch'es tip point at the same commit we just fetched.
After all an empty repository without an initial commit is an
ancestor of any commit.

[jc: I added a trivial test.  We've become sloppy but we should
 stick to the discipline of covering new behaviour with new
 tests. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-16 23:45:48 -08:00
Junio C Hamano
73fbd33cce convert-objects: set _XOPEN_SOURCE to 600
Otherwise OpenBSD header files drop S_ISLNK() definition which is used in
an inline defined in cache.h

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 14:57:47 -08:00
Jim Meyering
efe4abd14c Run "git repack -a -d" once more at end, if there's 1MB or more of not-packed data.
Although I converted upstream coreutils to git last month, I just
reconverted coreutils once again, as a test, and ended up with a
git repository of about 130MB (contrast with my packed git repo of
size 52MB).  That was because there were a lot of commits (but < 1024)
after the final automatic "git-repack -a -d".

Running a final
  git-repack -a -d && git-prune-packed
cut the final repository size down to the expected size.

So this looks like an easy way to improve git-cvsimport.
Just run "git repack ..." at the end if there's more than
some reasonable amount of not-packed data.

My choice of 1MB is a little arbitrarily.  I wouldn't mind missing
the minimal repo size by 1MB.  At the other end of the spectrum,
it's probably not worthwhile to pack everything when the total
repository size is less than 1MB.

Here's the patch:

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 12:50:29 -08:00
Alexandre Julliard
faa1bbfdd2 gitweb: Put back shortlog instead of graphiclog in the project list.
Looks like a repo.or.cz-specific change slipped in.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 12:49:27 -08:00
Junio C Hamano
bf7e1472df git-checkout: allow pathspec to recover lost working tree directory
It is often wanted on the #git channel that this were to work to
recover removed directory:

	rm -fr Documentation
	git checkout -- Documentation
	git checkout HEAD -- Documentation ;# alternatively

Now it does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 12:01:44 -08:00
Junio C Hamano
897643cc79 git-checkout: do not allow -f and -m at the same time.
Instead of silently ignoring one over the other, complain on
this incompatible combination.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 12:01:30 -08:00
Johannes Schindelin
0a3881d4cf Seek back to current filepos when mmap()ing with NO_MMAP
"git-index-pack --fix-thin" relies on mmap() not changing the current
file position (otherwise the pack will be corrupted when writing the
final SHA1). Meet that expectation.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-15 10:23:47 -08:00
Junio C Hamano
e267c2f6f0 GIT 1.4.4
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-14 22:11:26 -08:00
Junio C Hamano
2a54323ce5 Merge branch 'maint'
* maint:
  Rework cvsexportcommit to handle binary files for all cases.
  Catch errors when writing an index that contains invalid objects.
  test-lib.sh: A command dying due to a signal is an unexpected failure.
  git-update-index(1): fix use of quoting in section title
2006-11-13 14:30:39 -08:00
Robin Rosenberg
fe142b3a45 Rework cvsexportcommit to handle binary files for all cases.
Also adds test cases for adding removing and deleting
binary and text files plus two tests for the checks on
binary files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:27:38 -08:00
Johannes Sixt
3d12d0cfbb Catch errors when writing an index that contains invalid objects.
If git-write-index is called without --missing-ok, it reports invalid
objects that it finds in the index. But without this patch it dies
right away or may run into an infinite loop.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:26:51 -08:00
Johannes Sixt
40cf043389 test-lib.sh: A command dying due to a signal is an unexpected failure.
When test_expect_failure detects that a command failed, it still has to
treat a program that crashed from a signal as unexpected failure.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:26:41 -08:00
Jonas Fonseca
bae777db33 git-update-index(1): fix use of quoting in section title
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-12 18:50:20 -08:00
Junio C Hamano
a74e60a0f5 GIT 1.4.4-rc2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-11 18:30:31 -08:00
Junio C Hamano
dc8302d274 Merge branch 'maint'
* maint:
  git-cvsserver: read from git with -z to get non-ASCII pathnames.
2006-11-11 18:30:31 -08:00
Junio C Hamano
e02cd6388f git-cvsserver: read from git with -z to get non-ASCII pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-11 18:26:57 -08:00
Junio C Hamano
5a4ffc8035 Merge branch 'maint'
* maint:
  path-list: fix path-list-insert return value
2006-11-11 14:49:25 -08:00
Junio C Hamano
057bc808b4 path-list: fix path-list-insert return value
When path-list-insert is called on an existing path, it returned an
unrelated element in the list.  Luckily most of the callers are
ignoring the return value, but merge-recursive uses it at three places
and this would have resulted in a bogus rename detection.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-11 14:46:11 -08:00
Junio C Hamano
8eaf79869f git-annotate: fix -S on graft file with comments.
The graft file can contain comment lines and read_graft_line can
return NULL for such an input, which should be skipped by the
reader.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-10 13:44:39 -08:00
Junio C Hamano
a19f901d9f git-annotate: no need to exec blame; it is built-in now. 2006-11-10 13:36:44 -08:00
Junio C Hamano
368c2ac249 Merge branch 'maint'
* maint:
  git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
  git-svn: fix dcommit losing changes when out-of-date from svn
  git-svn: don't die on rebuild when --upgrade is specified
  git-svn: avoid printing filenames of files we're not tracking
2006-11-09 15:08:19 -08:00
Robert Shearman
a6ec3c1599 git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
This reduces the number of conflicts when rebasing after a series of
patches to the same piece of code is committed upstream.

Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-09 14:41:16 -08:00