Commit graph

25803 commits

Author SHA1 Message Date
Junio C Hamano 1a507fc112 zlib wrapper: refactor error message formatter
Before refactoring the main part of the wrappers, first move the
logic to convert error status that come back from zlib to string
to a helper function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-10 10:31:34 -07:00
Jonathan Nieder 2c162b56f3 gitweb: do not misparse nonnumeric content tag files that contain a digit
v1.7.6-rc0~27^2~4 (gitweb: Change the way "content tags" ('ctags') are
handled, 2011-04-29) tried to make gitweb's tag cloud feature more
intuitive for webmasters by checking whether the ctags/<label> under
a project's .git dir contains a number (representing the strength of
association to <label>) before treating it as one.

With that change, after putting '$feature{'ctags'}{'default'} = [1];'
in your $GITWEB_CONFIG, you could do

	echo Linux >.git/ctags/linux

and gitweb would treat that as a request to tag the current repository
with the Linux tag, instead of the previous behavior of writing an
error page embedded in the projects list that triggers error messages
from Chromium and Firefox about malformed XML.

Unfortunately the pattern (\d+) used to match numbers is too loose,
and the "XML declaration allowed only at the start of the document"
error can still be experienced if you write "Linux-2.6" in place of
"Linux" in the example above.  Fix it by tightening the pattern to
^\d+$.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-09 09:22:44 -07:00
Junio C Hamano 2cbd969bcf Git 1.7.6-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-08 18:29:48 -07:00
Junio C Hamano d64a09fe22 Merge branch 'maint'
* maint:
  fetch: do not leak a refspec
2011-06-08 18:13:39 -07:00
Alex Neronskiy 4a1c269516 Document the underlying protocol used by shallow repositories and --depth commands.
Explain the exchange that occurs between a client and server when
the client is requesting shallow history and/or is already using
a shallow repository.

Signed-off-by: Alex Neronskiy <zakmagnus@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-08 18:08:21 -07:00
Alex Neronskiy a1e90b2352 Fix documentation of fetch-pack that implies that the client can disconnect after sending wants.
Specify conditions under which the client can terminate the connection
early. Previously, an unintended behavior was possible which could
confuse servers.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Alex Neronskiy <zakmagnus@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-08 18:08:20 -07:00
Jim Meyering d8ead15963 fetch: do not leak a refspec
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-08 17:21:08 -07:00
Junio C Hamano cc5c54e78b sha1_file.c: "legacy" is really the current format
Every time I look at the read-loose-object codepath, legacy_loose_object()
function makes my brain go through mental contortion. When we were playing
with the experimental loose object format, it may have made sense to call
the traditional format "legacy", in the hope that the experimental one
will some day replace it to become official, but it never happened.

This renames the function (and negates its return value) to detect if we
are looking at the experimental format, and move the code around in its
caller which used to do "if we are looing at legacy, do this special case,
otherwise the normal case is this". The codepath to read from the loose
objects in experimental format is the "unlikely" case.

Someday after Git 2.0, we should drop the support of this format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-08 16:39:33 -07:00
Junio C Hamano 8fba5f9852 Merge branch 'jc/magic-pathspec'
* jc/magic-pathspec:
  t3703: skip more tests using colons in file names on Windows
2011-06-07 08:32:42 -07:00
Alex Riesen 038e2e5656 t3703: skip more tests using colons in file names on Windows
Use the same test and prerequisite as introduced in similar
fix in 650af7ae8b.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-07 08:32:14 -07:00
Junio C Hamano 2c6b5d8828 Merge branch 'jn/mime-type-with-params'
* jn/mime-type-with-params:
  gitweb: Fix usability of $prevent_xss
2011-06-06 11:40:22 -07:00
Junio C Hamano eca4f3b1af Merge branch 'jn/gitweb-docs'
* jn/gitweb-docs:
  gitweb: Move "Requirements" up in gitweb/INSTALL
  gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
  gitweb: Move information about installation from README to INSTALL
2011-06-06 11:40:18 -07:00
Junio C Hamano 456a4c08b8 Merge branch 'jk/diff-not-so-quick'
* jk/diff-not-so-quick:
  diff: futureproof "stop feeding the backend early" logic
  diff_tree: disable QUICK optimization with diff filter

Conflicts:
	diff.c
2011-06-06 11:40:14 -07:00
Junio C Hamano 6c92972d7f Merge branch 'bc/maint-status-z-to-use-porcelain'
* bc/maint-status-z-to-use-porcelain:
  builtin/commit.c: set status_format _after_ option parsing
  t7508: demonstrate status's failure to use --porcelain format with -z

Conflicts:
	builtin/commit.c
2011-06-06 11:40:08 -07:00
Junio C Hamano c17b229454 checkout -b <name>: correctly detect existing branch
When create a new branch, we fed "refs/heads/<proposed name>" as a string
to get_sha1() and expected it to fail when a branch already exists.

The right way to check if a ref exists is to check with resolve_ref().

A naïve solution that might appear attractive but does not work is to
forbid slashes in get_describe_name() but that will not work. A describe
name is is in the form of "ANYTHING-g<short sha1>", and that ANYTHING part
comes from a original tag name used in the repository the user ran the
describe command. A sick user could have a confusing hierarchical tag
whose name is "refs/heads/foobar" (stored as refs/tags/refs/heads/foobar")
to generate a describe name "refs/heads/foobar-6-g02ac983", and we should
be able to use that name to refer to the object whose name is 02ac983.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-05 22:17:04 -07:00
Jakub Narebski bee6ea17a1 gitweb: Fix usability of $prevent_xss
With XSS prevention on (enabled using $prevent_xss), blobs
('blob_plain') of all types except a few known safe ones are served
with "Content-Disposition: attachment".  However the check was too
strict; it didn't take into account optional parameter attributes,

  media-type     = type "/" subtype *( ";" parameter )

as described in RFC 2616

  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
  http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7

This fixes that, and it for example treats following as safe MIME
media type:

  text/plain; charset=utf-8

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-05 10:38:47 -07:00
Jakub Narebski 80b4dfeeb2 gitweb: Move "Requirements" up in gitweb/INSTALL
This way you can examine prerequisites at first glance, before
detailed instructions on installing gitweb.  Straightforward
text movement.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-03 10:00:24 -07:00
Jakub Narebski 560869e321 gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
The build-time configuration variables JSMIN and CSSMIN were mentioned
only in Makefile; add their description to gitweb/INSTALL.

This required moving description of GITWEB_JS up, near GITWEB_CSS and
just introduced CSMIN and JSMIN.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-02 11:16:56 -07:00
Jakub Narebski cee694d012 gitweb: Move information about installation from README to INSTALL
Almost straightformard moving of "How to configure gitweb for your
local system" section from gitweb/README to gitweb/INSTALL, as it is
about build time configuration.  Updated references to it.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-02 11:14:21 -07:00
Junio C Hamano a6605d76cd Sync with 1.7.5.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-01 14:11:17 -07:00
Junio C Hamano e5af0de202 Git 1.7.5.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-01 14:08:26 -07:00
Junio C Hamano 1c6e3514d0 Merge branch 'jk/maint-config-alias-fix' into maint
* jk/maint-config-alias-fix:
  handle_options(): do not miscount how many arguments were used
  config: always parse GIT_CONFIG_PARAMETERS during git_config
  git_config: don't peek at global config_parameters
  config: make environment parsing routines static
2011-06-01 14:05:22 -07:00
Junio C Hamano 6e1a7510b1 Merge branch 'jc/fmt-req-fix' into maint
* jc/fmt-req-fix:
  userformat_find_requirements(): find requirement for the correct format
2011-06-01 14:03:07 -07:00
Junio C Hamano 2dd798469e Merge branch 'jk/maint-docs' into maint
* jk/maint-docs:
  docs: fix some antique example output
  docs: make sure literal "->" isn't converted to arrow
  docs: update status --porcelain format
  docs: minor grammar fixes to git-status
2011-06-01 14:02:52 -07:00
Junio C Hamano 24263cfb54 Merge branch 'jn/doc-remote-helpers' into maint
* jn/doc-remote-helpers:
  Documentation: do not misinterpret refspecs as bold text
2011-06-01 14:02:45 -07:00
Junio C Hamano c72b9143f9 Merge branch 'kk/maint-prefix-in-config-mak' into maint
* kk/maint-prefix-in-config-mak:
  config.mak.in: allow "configure --sysconfdir=/else/where"
2011-06-01 14:02:39 -07:00
Jim Meyering 6051561a6c diffcore-rename.c: avoid set-but-not-used warning
Since 9d8a5a5 (diffcore-rename: refactor "too many candidates" logic,
2011-01-06), diffcore_rename() initializes num_src but does not use it
anymore.  "-Wunused-but-set-variable" in gcc-4.6 complains about this.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-01 13:54:17 -07:00
Junio C Hamano 090a1a5d95 Update draft release notes to 1.7.6
I think we are almost there for the feature freeze.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-31 12:22:50 -07:00
Junio C Hamano f67d2e82d6 Merge branch 'jk/format-patch-am'
* jk/format-patch-am:
  format-patch: preserve subject newlines with -k
  clean up calling conventions for pretty.c functions
  pretty: add pp_commit_easy function for simple callers
  mailinfo: always clean up rfc822 header folding
  t: test subject handling in format-patch / am pipeline

Conflicts:
	builtin/branch.c
	builtin/log.c
	commit.h
2011-05-31 12:19:11 -07:00
Junio C Hamano 1c9d71944a Merge branch 'jn/doc-remote-helpers'
* jn/doc-remote-helpers:
  Documentation: do not misinterpret refspecs as bold text
2011-05-31 12:09:35 -07:00
Junio C Hamano aca820ae61 Merge branch 'jk/format-patch-empty-prefix'
* jk/format-patch-empty-prefix:
  format-patch: make zero-length subject prefixes prettier
2011-05-31 12:09:27 -07:00
Junio C Hamano 15af7075fc Merge branch 'ab/i18n-envsubst-doc-fix'
* ab/i18n-envsubst-doc-fix:
  git-sh-i18n--envsubst: add SYNOPSIS section to the documentation
2011-05-31 12:09:21 -07:00
Junio C Hamano b9575e78e5 Merge branch 'jc/log-quiet-fix'
* jc/log-quiet-fix:
  log: --quiet should serve as synonym to -s
2011-05-31 12:09:18 -07:00
Junio C Hamano 2177dc69cd Merge branch 'kk/maint-prefix-in-config-mak'
* kk/maint-prefix-in-config-mak:
  config.mak.in: allow "configure --sysconfdir=/else/where"
2011-05-31 12:09:12 -07:00
Junio C Hamano df873f96c8 Merge branch 'jk/rebase-head-reflog'
* jk/rebase-head-reflog:
  rebase: write a reflog entry when finishing
  rebase: create HEAD reflog entry when aborting
2011-05-31 12:09:08 -07:00
Junio C Hamano 7953156939 Merge branch 'jk/maint-docs'
* jk/maint-docs:
  docs: fix some antique example output
  docs: make sure literal "->" isn't converted to arrow
  docs: update status --porcelain format
  docs: minor grammar fixes to git-status
2011-05-31 12:09:00 -07:00
Junio C Hamano 27c6729201 Merge branch 'jk/read-in-full-stops-on-error'
* jk/read-in-full-stops-on-error:
  read_in_full: always report errors
2011-05-31 12:08:55 -07:00
Junio C Hamano 2cd517cdd3 Merge branch 'jk/maint-remote-mirror-safer'
* jk/maint-remote-mirror-safer:
  remote: allow "-t" with fetch mirrors
2011-05-31 12:08:52 -07:00
Junio C Hamano efd02e92c9 Merge branch 'jl/read-tree-m-dry-run'
* jl/read-tree-m-dry-run:
  Teach read-tree the -n|--dry-run option
  unpack-trees: add the dry_run flag to unpack_trees_options
2011-05-31 12:08:48 -07:00
Junio C Hamano 2951df7a9a Sync with maint 2011-05-31 12:07:14 -07:00
Junio C Hamano 2b0b64ee85 Start 1.7.5.4 draft release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-31 12:06:40 -07:00
Junio C Hamano 1618297f10 Merge branch 'tr/add-i-no-escape' into maint
* tr/add-i-no-escape:
  add -i: ignore terminal escape sequences
2011-05-31 12:02:04 -07:00
Junio C Hamano 398dbe536d Merge branch 'vh/config-interactive-singlekey-doc' into maint
* vh/config-interactive-singlekey-doc:
  git-reset.txt: better docs for '--patch'
  git-checkout.txt: better docs for '--patch'
  git-stash.txt: better docs for '--patch'
  git-add.txt: document 'interactive.singlekey'
  config.txt: 'interactive.singlekey; is used by...
2011-05-31 12:01:06 -07:00
Junio C Hamano 82ca09090e Merge branch 'ml/test-readme' into maint
* ml/test-readme:
  t/README: unify documentation of test function args
2011-05-31 12:00:43 -07:00
Junio C Hamano dd4c0ce908 Merge branch 'ab/i18n-fixup' into maint
* ab/i18n-fixup: (24 commits)
  i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
  i18n: use test_i18n{grep,cmp} in t7508
  i18n: use test_i18ngrep in t7506
  i18n: use test_i18ngrep and test_i18ncmp in t7502
  i18n: use test_i18ngrep in t7501
  i18n: use test_i18ncmp in t7500
  i18n: use test_i18ngrep in t7201
  i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110
  i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060
  i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014
  i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507
  i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200
  i18n: use test_i18ngrep in lib-httpd and t2019
  i18n: do not overuse C_LOCALE_OUTPUT (grep)
  i18n: use test_i18ncmp in t1200 and t2200
  i18n: .git file is not a human readable message (t5601)
  i18n: do not overuse C_LOCALE_OUTPUT
  i18n: mark init-db messages for translation
  i18n: mark checkout plural warning for translation
  i18n: mark checkout --detach messages for translation
  ...
2011-05-31 12:00:27 -07:00
Junio C Hamano b3c89315a3 Merge branch 'jc/rename-degrade-cc-to-c' into maint
* jc/rename-degrade-cc-to-c:
  diffcore-rename: fall back to -C when -C -C busts the rename limit
  diffcore-rename: record filepair for rename src
  diffcore-rename: refactor "too many candidates" logic
  builtin/diff.c: remove duplicated call to diff_result_code()
2011-05-31 12:00:02 -07:00
Junio C Hamano e596fd295f Merge branch 'rr/doc-content-type' into maint
* rr/doc-content-type:
  Documentation: Allow custom diff tools to be specified in 'diff.tool'
  Documentation: Add diff.<driver>.* to config
  Documentation: Move diff.<driver>.* from config.txt to diff-config.txt
  Documentation: Add filter.<driver>.* to config
2011-05-31 11:59:39 -07:00
Junio C Hamano b4194828dc diff-index --quiet: learn the "stop feeding the backend early" logic
A negative return from the unpack callback function usually means unpack
failed for the entry and signals the unpack_trees() machinery to fail the
entire merge operation, immediately and there is no other way for the
callback to tell the machinery to exit early without reporting an error.

This is what we usually want to make a merge all-or-nothing operation, but
the machinery is also used for diff-index codepath by using a custom
unpack callback function. And we do sometimes want to exit early without
failing, namely when we are under --quiet and can short-cut the diff upon
finding the first difference.

Add "exiting_early" field to unpack_trees_options structure, to signal the
unpack_trees() machinery that the negative return value is not signaling
an error but an early return from the unpack_trees() machinery. As this by
definition hasn't unpacked everything, discard the resulting index just
like the failure codepath.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-31 11:24:12 -07:00
Junio C Hamano 2d11f21c36 Merge remote-tracking branch 'ko/maint' into jc/diff-index-quick-exit-early
* ko/maint: (4352 commits)
  git-submodule.sh: separate parens by a space to avoid confusing some shells
  Documentation/technical/api-diff.txt: correct name of diff_unmerge()
  read_gitfile_gently: use ssize_t to hold read result
  remove tests of always-false condition
  rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
  Git 1.7.5.3
  init/clone: remove short option -L and document --separate-git-dir
  do not read beyond end of malloc'd buffer
  git-svn: Fix git svn log --show-commit
  Git 1.7.5.2
  provide a copy of the LGPLv2.1
  test core.gitproxy configuration
  copy_gecos: fix not adding nlen to len when processing "&"
  Update draft release notes to 1.7.5.2
  Documentation/git-fsck.txt: fix typo: unreadable -> unreachable
  send-pack: avoid deadlock on git:// push with failed pack-objects
  connect: let callers know if connection is a socket
  connect: treat generic proxy processes like ssh processes
  sideband_demux(): fix decl-after-stmt
  t3503: test cherry picking and reverting root commits
  ...

Conflicts:
	diff.c
2011-05-31 10:57:32 -07:00
Ramsay Jones 766d6268c6 config.c: Remove unused git_config_global() function
Commit 8f323c00 (drop support for GIT_CONFIG_NOGLOBAL, 15-03-2011)
removed the git_config_global() function, among other things, since
it is no longer required. Unfortunately, this function has since
been unintentionally restored by a faulty conflict resolution.

Remove it.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-31 10:51:18 -07:00