Commit graph

21455 commits

Author SHA1 Message Date
Shawn O. Pearce 0da8b2e7c8 http.c: Don't store destination name in request structures
The destination name within the object store is easily computed
on demand, reusing a static buffer held by sha1_file.c.  We don't
need to copy the entire path into the request structure for safe
keeping, when it can be easily reformatted after the download has
been completed.

This reduces the size of the per-request structure, and removes
yet another PATH_MAX based limit.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 13:55:46 -07:00
Shawn O. Pearce 3065274c58 http.c: Drop useless != NULL test in finish_http_pack_request
The test preq->packfile != NULL is always true.  If packfile was
actually NULL when entering this function the ftell() above would
crash out with a SIGSEGV, resulting in never reaching this point.

Simplify the code by just removing the conditional.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 13:55:46 -07:00
Shawn O. Pearce 021ab6f00b http.c: Tiny refactoring of finish_http_pack_request
Always remove the struct packed_git from the active list, even
if the rename of the temporary file fails.

While we are here, simplify the code a bit by using a common
local variable name ("p") to hold the relevant packed_git.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 13:55:45 -07:00
Shawn O. Pearce d761b2ac0e t5550-http-fetch: Use subshell for repository operations
Change into the server repository's directory using a subshell,
so we can return back to the top of the trash directory before
doing anything more in the test script.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 13:55:45 -07:00
Shawn O. Pearce 03b6aeb274 http.c: Remove bad free of static block
The filename variable here is pointing to a block of memory that
was allocated by sha1_file.c and is also held in a static variable
scoped within the sha1_pack_name() function.  Doing a free() here is
returning that memory to the allocator while we might still try to
reuse it on a subsequent sha1_pack_name() invocation.  That's not
acceptable, so don't free it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 13:55:45 -07:00
Jay Soffian f78683f3a8 Documentation/config.txt: default gc.aggressiveWindow is 250, not 10
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>
2010-04-13 12:27:19 -07:00
Marc Branchaud adda3c3beb Docs: Add -X option to git-merge's synopsis.
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>
2010-04-12 09:50:09 -07:00
Junio C Hamano fcd424011b Git 1.7.0.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11 13:42:33 -07:00
Junio C Hamano c512b03555 Merge branch 'rc/maint-reflog-msg-for-forced-branch' into maint
* rc/maint-reflog-msg-for-forced-branch:
  branch: say "Reset to" in reflog entries for 'git branch -f' operations
2010-04-11 13:39:47 -07:00
Junio C Hamano d8c416b251 blame documentation: -M/-C notice copied lines as well as moved ones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11 12:17:42 -07:00
Jens Lehmann 54fd955c21 Let check_preimage() use memset() to initialize "struct checkout"
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>
2010-04-09 22:42:57 -07:00
Junio C Hamano 408dee5222 Merge branch 'ef/maint-empty-commit-log' into maint
* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message
2010-04-09 22:38:53 -07:00
Junio C Hamano daaf2e8892 Merge branch 'jc/conflict-marker-size' into maint
* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute
2010-04-09 22:38:34 -07:00
Junio C Hamano 326bea47cb Merge branch 'sp/maint-http-backend-die-triggers-die-recursively' into maint
* sp/maint-http-backend-die-triggers-die-recursively:
  http-backend: Don't infinite loop during die()
2010-04-09 22:38:16 -07:00
Junio C Hamano fe7e37235d Merge branch 'mg/maint-send-email-lazy-editor' into maint
* mg/maint-send-email-lazy-editor:
  send-email: lazily assign editor variable
2010-04-09 22:23:04 -07:00
Junio C Hamano 2e5a40f0b5 Merge branch 'rr/imap-send-unconfuse-from-line' into maint
* rr/imap-send-unconfuse-from-line:
  imap-send: Remove limitation on message body
2010-04-09 22:22:44 -07:00
Junio C Hamano 581b26c82d Merge branch 'rb/maint-python-path' into maint
* rb/maint-python-path:
  Correct references to /usr/bin/python which does not exist on FreeBSD
2010-04-09 22:22:19 -07:00
Junio C Hamano 5d4bd79d80 Merge branch 'gh/maint-stash-show-error-message' into maint
* gh/maint-stash-show-error-message:
  Improve error messages from 'git stash show'
2010-04-09 22:22:14 -07:00
Junio C Hamano e80014a13e Merge branch 'mg/mailmap-update' into maint
* mg/mailmap-update:
  .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela
2010-04-09 22:22:06 -07:00
Junio C Hamano 2870695be0 Merge branch 'bc/maint-daemon-sans-ss-family' into maint
* bc/maint-daemon-sans-ss-family:
  daemon.c: avoid accessing ss_family member of struct sockaddr_storage
2010-04-09 22:22:00 -07:00
Tay Ray Chuan e3163c7515 fetch/push: fix usage strings
- use "<options>" instead of just "options".
 - use "[<repository> [<refspec>...]]" to indicate that <repository> and
   <refspec> are optional, and that <refspec> cannot be specified
   without specifying <repository>.

Note that when called without specifying <repository> (eg. "git fetch
-f"), it is accurate to say that the "git fetch [<options>]
[<repository> ...]" case takes precedence over "git fetch [<options>]
<group>".

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 21:23:10 -07:00
Tay Ray Chuan 936db184f0 branch: say "Reset to" in reflog entries for 'git branch -f' operations
In 5f856dd (fix reflog entries for "git-branch"), it is mentioned that
'git branch -f' is intended to be equivalent to 'git reset'. Since we
usually say "reset to <commit>" in the git-reset Documentation and
elsewhere, it would make sense to say "Reset to" here as well, instead
of "Reset from" previously.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 20:40:54 -07:00
Jeff King 4c35f0dbc4 docs: clarify "branch -l"
This option is mostly useless these days because we turn on
reflogs by default in non-bare repos.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 13:42:36 -07:00
Tay Ray Chuan c8a97906ba pack-protocol.txt: fix pkt-line lengths
Previously, the lengths were 4-bytes short. Fix it such that the lengths
reflect the total length of the pkt-line, as per spec.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:18:21 -07:00
Tay Ray Chuan 8e50175d94 pack-protocol.txt: fix spelling
s/paramater/parameter/.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:18:19 -07:00
Junio C Hamano 2be10bb5c1 Git 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 15:12:08 -07:00
Junio C Hamano 970957dbad Merge branch 'jc/maint-refs-dangling' into maint
* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-31 15:09:32 -07:00
Holger Weiß 4318d3ba8f Documentation: show-ref <pattern>s are optional
Specifying one or more <pattern> parameters is optional when calling
show-ref, so mark them as such using brackets in the manual.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:22:17 -07:00
Holger Weiß 2170422790 Link against libiconv on IRIX
On IRIX, "-liconv" must be added to the linker command line in order to
get iconv(3) support; set the according Makefile variable appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:22:06 -07:00
Holger Weiß 21e403a7b9 Don't redefine htonl and ntohl on big-endian
Since commit 0fcabdeb52, compat/bswap.h
redefined htonl and ntohl to bswap32 not only if bswap32 has been
defined earlier in compat/bswap.h (which is done only on selected
platforms), but also if bswap32 has been defined anywhere else.  This
broke Git at least for NetBSD systems running on big-endian machines
(where ntohl and htonl should, of course, be NOOPs), since NetBSD
defines a bswap32 macro in the system headers.

So, we now undefine any previously defined bswap32 in compat/bswap.h
before defining our own.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:21:39 -07:00
Jakub Narebski 7a49c254cd gitweb: git_get_project_config requires only $git_dir, not also $project
Fix overeager early return in git_get_project_config, introduced in 9be3614
(gitweb: Fix project-specific feature override behavior, 2010-03-01).  When
git_get_project_config is called from projects list page via
git_get_project_owner($path) etc., it is called with $git_dir defined (in
git_get_project_owner($path) etc.), but $project variable is not defined.
git_get_project_config doesn't use $project variable anyway.

Reported-by: Tobias Heinlein <keytoaster@gentoo.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 10:57:04 -07:00
Jan Stępień e4762865c8 Updated the usage string of git reset
Make git reset usage string reflect the command's behaviour and contents of
the man page.

Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 08:15:02 -07:00
Greg Bacon 09f53b16bc Documentation: Clarify support for smart HTTP backend
In the description of http.getanyfile, replace the vague "older Git
clients" with the earliest release whose client is able to use the
upload pack service.

Signed-off-by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 16:49:19 -07:00
Johannes Sixt 852f098c06 Windows: fix utime() for read-only files
Starting with 5256b00 (Use git_mkstemp_mode instead of plain mkstemp to
create object files, 2010-02-22) utime() is invoked on read-only files.
This is not allowed on Windows and results in many warnings of the form

failed utime() on .git/objects/23/tmp_obj_VlgHlc: Permission denied

during a repack.  Fix it by making the file temporarily writable.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 16:34:04 -07:00
Johannes Sixt da1fbed3ff diff: fix textconv error zombies
To make the code simpler, run_textconv lumps all of its
error checking into one conditional. However, the
short-circuit means that an error in reading will prevent us
from calling finish_command, leaving a zombie child.
Clean up properly after errors.

Based-on-work-by: Jeff King <peff@peff.net>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 14:46:33 -07:00
Kevin Ballard 657ab61efa format-patch: Squelch 'fatal: Not a range." error
Don't output an error on `git format-patch --ignore-if-in-upstream HEAD`.
This matches the behavior of `git format-patch HEAD`.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-29 21:22:37 -07:00
Junio C Hamano e07665e524 Prepare for 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 21:32:25 -07:00
Junio C Hamano cc64c6970a Merge branch 'cp/add-u-pathspec' into maint
* cp/add-u-pathspec:
  test for add with non-existent pathspec
  git add -u: die on unmatched pathspec
2010-03-28 21:21:42 -07:00
Junio C Hamano 4c367c6ae9 t9350: fix careless use of "cd"
Upon failure of any of these tests (or when a test that is marked as
expecting a failure is fixed), we will end up running later tests in
random places.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 17:42:11 -07:00
David Aguilar 42accaec01 difftool: Fix '--gui' when diff.guitool is unconfigured
When diff.guitool is unconfigured and "--gui" is specified
git-difftool dies with the following error message:

	config diff.guitool: command returned error: 1

Catch the error so that the "--gui" flag is a no-op when
diff.guitool is unconfigured.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 09:29:12 -07:00
Sverre Rabbelier bb6ad28c23 fast-export: don't segfault when marks file cannot be opened
The error function only prints an error message, resulting in a
segfault if we later on try to fprintf to a NULL handle.

Fix this by using die_errno instead.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 09:26:16 -07:00
Michael J Gruber 0ce142c944 send-email: lazily assign editor variable
b4479f0 (add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR",
2009-10-30) introduced the use of "git var GIT_EDITOR" to obtain the
preferred editor program, instead of reading environment variables
themselves.

However, "git var GIT_EDITOR" run without a tty (think "cron job") would
give a fatal error "Terminal is dumb, but EDITOR unset".  This is not a
problem for add-i, svn, p4 and callers of git_editor() defined in
git-sh-setup, as all of these call it just before launching the editor.
At that point, we know the caller wants to edit.

But send-email ran this near the beginning of the program, even if it is
not going to use any editor (e.g. run without --compose).  Fix this by
calling the command only when we edit a file.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-25 03:07:31 -07:00
Junio C Hamano a757c646ee diff --check: honor conflict-marker-size attribute
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 19:35:34 -07:00
Junio C Hamano 0476228de5 Merge branch 'jc/color-attrs' into maint
* jc/color-attrs:
  color: allow multiple attributes
2010-03-24 16:24:13 -07:00
Junio C Hamano bcbbe4f9d9 Merge branch 'jk/maint-add-ignored-dir' into maint
* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such
2010-03-24 16:24:03 -07:00
Junio C Hamano 7b676b1bb5 Merge branch 'bg/apply-fix-blank-at-eof' into maint
* bg/apply-fix-blank-at-eof:
  t3417: Add test cases for "rebase --whitespace=fix"
  t4124: Add additional tests of --whitespace=fix
  apply: Allow blank context lines to match beyond EOF
  apply: Remove the quick rejection test
  apply: Don't unnecessarily update line lengths in the preimage
2010-03-24 16:23:50 -07:00
Shawn O. Pearce 5856b5f568 http-backend: Don't infinite loop during die()
If stdout has already been closed by the CGI and die() gets called,
the CGI will fail to write the "Status: 500 Internal Server Error" to
the pipe, which results in die() being called again (via safe_write).
This goes on in an infinite loop until the stack overflows and the
process is killed by SIGSEGV.

Instead set a flag on the first die() invocation and if we came back to
the handler, just die silently, as it only means we failed to report the
failure---we cannot report anything anyway in such a case.  This way
failures to write the error messages to the stdout pipe do not result in
an infinite loop.

We also now report on the death to stderr before we report to stdout,
to increase the chances that the cause of the die() invocation will
appear in the server's error log.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fixup! http-backend.c: Don't infinite loop

Now die_webcgi() actually can return during a recursive call into it,
causing

    http-backend.c:554: error: 'noreturn' function does return

The only reason we would come back to the die handler is because we
failed during it, so we cannot report anything anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 14:40:56 -07:00
R. Tyler Ballance 44211e8c2e Correct references to /usr/bin/python which does not exist on FreeBSD
On FreeBSD, Python does not ship as part of the base system but is available
via the ports system, which install the binary in /usr/local/bin.

Signed-off-by: R. Tyler Ballance <tyler@monkeypox.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 14:33:54 -07:00
Markus Heidelberg 846b8f681a Documentation: explain the meaning of "-g" in git-describe output
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 11:31:45 -07:00
Ramkumar Ramachandra 4916c8f953 imap-send: Remove limitation on message body
There is a documented limitation on the body of any email not being
able to contain lines starting with "From ". This patch removes that
limitation by improving the parser to search for "From", "Date", and
"Subject" fields in the email before considering it to be an email.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 11:00:25 -07:00