git.git
11 years agoMerge branch 'tf/gitweb-ss-tweak'
Junio C Hamano [Wed, 11 Sep 2013 22:00:54 +0000 (15:00 -0700)]
Merge branch 'tf/gitweb-ss-tweak'

Tweak Gitweb CSS to layout some elements better.

* tf/gitweb-ss-tweak:
  gitweb: make search help link less ugly
  gitweb: omit the repository owner when it is unset
  gitweb: vertically centre contents of page footer
  gitweb: ensure OPML text fits inside its box

11 years agoMerge branch 'sb/mailmap-freeing-NULL-is-ok'
Junio C Hamano [Wed, 11 Sep 2013 22:00:43 +0000 (15:00 -0700)]
Merge branch 'sb/mailmap-freeing-NULL-is-ok'

* sb/mailmap-freeing-NULL-is-ok:
  mailmap: remove redundant check for freeing memory

11 years agoMerge branch 'js/xread-in-full'
Junio C Hamano [Wed, 11 Sep 2013 21:59:46 +0000 (14:59 -0700)]
Merge branch 'js/xread-in-full'

A call to xread() was used without a loop around to cope with short
read in the codepath to stream new contents to a pack.

* js/xread-in-full:
  stream_to_pack: xread does not guarantee to read all requested bytes

11 years agoMerge branch 'es/rebase-i-respect-core-commentchar'
Junio C Hamano [Wed, 11 Sep 2013 21:58:52 +0000 (14:58 -0700)]
Merge branch 'es/rebase-i-respect-core-commentchar'

"rebase -i" forgot that the comment character can be configurable
while reading its insn sheet.

* es/rebase-i-respect-core-commentchar:
  rebase -i: fix cases ignoring core.commentchar

11 years agoMerge branch 'jn/post-receive-utf8'
Junio C Hamano [Wed, 11 Sep 2013 21:58:46 +0000 (14:58 -0700)]
Merge branch 'jn/post-receive-utf8'

Update post-receive-email script to make sure the message contents
and pathnames are encoded consistently in UTF-8.

* jn/post-receive-utf8:
  hooks/post-receive-email: set declared encoding to utf-8
  hooks/post-receive-email: force log messages in UTF-8
  hooks/post-receive-email: use plumbing instead of git log/show

11 years agoMerge branch 'sh/pull-rebase-preserve'
Junio C Hamano [Wed, 11 Sep 2013 21:57:49 +0000 (14:57 -0700)]
Merge branch 'sh/pull-rebase-preserve'

"git pull --rebase" always flattened the history; pull.rebase can
now be set to "preserve" to invoke "rebase --preserve-merges".

* sh/pull-rebase-preserve:
  pull: allow pull to preserve merges when rebasing

11 years agoMerge branch 'nd/push-no-thin'
Junio C Hamano [Wed, 11 Sep 2013 21:56:58 +0000 (14:56 -0700)]
Merge branch 'nd/push-no-thin'

"git push --no-thin" was a no-op by mistake.

* nd/push-no-thin:
  push: respect --no-thin

11 years agoUpdate draft release notes to 1.8.5 for the second batch of topics
Junio C Hamano [Mon, 9 Sep 2013 21:51:42 +0000 (14:51 -0700)]
Update draft release notes to 1.8.5 for the second batch of topics

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nd/magic-pathspec'
Junio C Hamano [Mon, 9 Sep 2013 21:50:42 +0000 (14:50 -0700)]
Merge branch 'nd/magic-pathspec'

Use "struct pathspec" interface in more places, instead of array of
characters, the latter of which cannot express magic pathspecs
(e.g. ":(icase)makefile" that matches both Makefile and makefile).

* nd/magic-pathspec:
  add: lift the pathspec magic restriction on "add -p"
  pathspec: catch prepending :(prefix) on pathspec with short magic

11 years agoMerge branch 'jk/mailmap-incomplete-line'
Junio C Hamano [Mon, 9 Sep 2013 21:50:41 +0000 (14:50 -0700)]
Merge branch 'jk/mailmap-incomplete-line'

* jk/mailmap-incomplete-line:
  mailmap: handle mailmap blobs without trailing newlines

11 years agoMerge branch 'sp/clip-read-write-to-8mb'
Junio C Hamano [Mon, 9 Sep 2013 21:50:39 +0000 (14:50 -0700)]
Merge branch 'sp/clip-read-write-to-8mb'

Send a large request to read(2)/write(2) as a smaller but still
reasonably large chunks, which would improve the latency when the
operation needs to be killed and incidentally works around broken
64-bit systems that cannot take a 2GB write or read in one go.

* sp/clip-read-write-to-8mb:
  Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
  xread, xwrite: limit size of IO to 8MB

11 years agoMerge branch 'tg/index-struct-sizes'
Junio C Hamano [Mon, 9 Sep 2013 21:50:38 +0000 (14:50 -0700)]
Merge branch 'tg/index-struct-sizes'

The code that reads from a region that mmaps an on-disk index
assumed that "int"/"short" are always 32/16 bits.

* tg/index-struct-sizes:
  read-cache: use fixed width integer types

11 years agoMerge branch 'jc/transport-do-not-use-connect-twice-in-fetch'
Junio C Hamano [Mon, 9 Sep 2013 21:50:37 +0000 (14:50 -0700)]
Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch'

The auto-tag-following code in "git fetch" tries to reuse the same
transport twice when the serving end does not cooperate and does
not give tags that point to commits that are asked for as part of
the primary transfer.  Unfortunately, Git-aware transport helper
interface is not designed to be used more than once, hence this
does not work over smart-http transfer.

* jc/transport-do-not-use-connect-twice-in-fetch:
  builtin/fetch.c: Fix a sparse warning
  fetch: work around "transport-take-over" hack
  fetch: refactor code that fetches leftover tags
  fetch: refactor code that prepares a transport
  fetch: rename file-scope global "transport" to "gtransport"
  t5802: add test for connect helper

11 years agoMerge branch 'es/contacts-blame-L-multi'
Junio C Hamano [Mon, 9 Sep 2013 21:50:36 +0000 (14:50 -0700)]
Merge branch 'es/contacts-blame-L-multi'

* es/contacts-blame-L-multi:
  contacts: reduce git-blame invocations
  contacts: gather all blame sources prior to invoking git-blame
  contacts: validate hunk length earlier

11 years agoMerge branch 'jc/url-match'
Junio C Hamano [Mon, 9 Sep 2013 21:50:32 +0000 (14:50 -0700)]
Merge branch 'jc/url-match'

Allow section.<urlpattern>.var configuration variables to be
treated as a "virtual" section.var given a URL, and use the
mechanism to enhance http.* configuration variables.

This is a reroll of Kyle J. McKay's work.

* jc/url-match:
  builtin/config.c: compilation fix
  config: "git config --get-urlmatch" parses section.<url>.key
  builtin/config: refactor collect_config()
  config: parse http.<url>.<variable> using urlmatch
  config: add generic callback wrapper to parse section.<url>.key
  config: add helper to normalize and match URLs
  http.c: fix parsing of http.sslCertPasswordProtected variable

11 years agoMerge branch 'jl/submodule-mv'
Junio C Hamano [Mon, 9 Sep 2013 21:36:15 +0000 (14:36 -0700)]
Merge branch 'jl/submodule-mv'

"git mv A B" when moving a submodule A does "the right thing",
inclusing relocating its working tree and adjusting the paths in
the .gitmodules file.

* jl/submodule-mv: (53 commits)
  rm: delete .gitmodules entry of submodules removed from the work tree
  mv: update the path entry in .gitmodules for moved submodules
  submodule.c: add .gitmodules staging helper functions
  mv: move submodules using a gitfile
  mv: move submodules together with their work trees
  rm: do not set a variable twice without intermediate reading.
  t6131 - skip tests if on case-insensitive file system
  parse_pathspec: accept :(icase)path syntax
  pathspec: support :(glob) syntax
  pathspec: make --literal-pathspecs disable pathspec magic
  pathspec: support :(literal) syntax for noglob pathspec
  kill limit_pathspec_to_literal() as it's only used by parse_pathspec()
  parse_pathspec: preserve prefix length via PATHSPEC_PREFIX_ORIGIN
  parse_pathspec: make sure the prefix part is wildcard-free
  rename field "raw" to "_raw" in struct pathspec
  tree-diff: remove the use of pathspec's raw[] in follow-rename codepath
  remove match_pathspec() in favor of match_pathspec_depth()
  remove init_pathspec() in favor of parse_pathspec()
  remove diff_tree_{setup,release}_paths
  convert common_prefix() to use struct pathspec
  ...

11 years agoMerge branch 'es/blame-L-twice'
Junio C Hamano [Mon, 9 Sep 2013 21:35:11 +0000 (14:35 -0700)]
Merge branch 'es/blame-L-twice'

Teaches "git blame" to take more than one -L ranges.

* es/blame-L-twice:
  line-range: reject -L line numbers less than 1
  t8001/t8002: blame: add tests of -L line numbers less than 1
  line-range: teach -L^:RE to search from start of file
  line-range: teach -L:RE to search from end of previous -L range
  line-range: teach -L^/RE/ to search from start of file
  line-range-format.txt: document -L/RE/ relative search
  log: teach -L/RE/ to search from end of previous -L range
  blame: teach -L/RE/ to search from end of previous -L range
  line-range: teach -L/RE/ to search relative to anchor point
  blame: document multiple -L support
  t8001/t8002: blame: add tests of multiple -L options
  blame: accept multiple -L ranges
  blame: inline one-line function into its lone caller
  range-set: publish API for re-use by git-blame -L
  line-range-format.txt: clarify -L:regex usage form
  git-log.txt: place each -L option variation on its own line

11 years agoMerge branch 'tr/log-full-diff-keep-true-parents'
Junio C Hamano [Mon, 9 Sep 2013 21:33:16 +0000 (14:33 -0700)]
Merge branch 'tr/log-full-diff-keep-true-parents'

Output from "git log --full-diff -- <pathspec>" looked strange,
because comparison was done with the previous ancestor that touched
the specified <pathspec>, causing the patches for paths outside the
pathspec to show more than the single commit has changed.

Tweak "git reflog -p" for the same reason using the same mechanism.

* tr/log-full-diff-keep-true-parents:
  log: use true parents for diff when walking reflogs
  log: use true parents for diff even when rewriting

11 years agoMerge branch 'jk/cat-file-batch-optim'
Junio C Hamano [Mon, 9 Sep 2013 21:33:07 +0000 (14:33 -0700)]
Merge branch 'jk/cat-file-batch-optim'

Rework the reverted change to `cat-file --batch-check`.

* jk/cat-file-batch-optim:
  cat-file: only split on whitespace when %(rest) is used

11 years agoMerge branch 'es/blame-L-more'
Junio C Hamano [Mon, 9 Sep 2013 21:32:45 +0000 (14:32 -0700)]
Merge branch 'es/blame-L-more'

More fixes to the code to parse the "-L" option in "log" and "blame".

* es/blame-L-more:
  blame: reject empty ranges -L,+0 and -L,-0
  t8001/t8002: blame: demonstrate acceptance of bogus -L,+0 and -L,-0
  blame: reject empty ranges -LX,+0 and -LX,-0
  t8001/t8002: blame: demonstrate acceptance of bogus -LX,+0 and -LX,-0
  log: fix -L bounds checking bug
  t4211: retire soon-to-be unimplementable tests
  t4211: log: demonstrate -L bounds checking bug
  blame: fix -L bounds checking bug
  t8001/t8002: blame: add empty file & partial-line tests
  t8001/t8002: blame: demonstrate -L bounds checking bug
  t8001/t8002: blame: decompose overly-large test

11 years agoMerge branch 'db/http-savecookies'
Junio C Hamano [Mon, 9 Sep 2013 21:32:08 +0000 (14:32 -0700)]
Merge branch 'db/http-savecookies'

* db/http-savecookies:
  t5551: Remove header from curl cookie file
  http: add http.savecookies option to write out HTTP cookies

11 years agoMerge branch 'jc/push-cas'
Junio C Hamano [Mon, 9 Sep 2013 21:30:29 +0000 (14:30 -0700)]
Merge branch 'jc/push-cas'

Allow a safer "rewind of the remote tip" push than blind "--force",
by requiring that the overwritten remote ref to be unchanged since
the new history to replace it was prepared.

The machinery is more or less ready.  The "--force" option is again
the big red button to override any safety, thanks to J6t's sanity
(the original round allowed --lockref to defeat --force).

The logic to choose the default implemented here is fragile
(e.g. "git fetch" after seeing a failure will update the
remote-tracking branch and will make the next "push" pass,
defeating the safety pretty easily).  It is suitable only for the
simplest workflows, and it may hurt users more than it helps them.

* jc/push-cas:
  push: teach --force-with-lease to smart-http transport
  send-pack: fix parsing of --force-with-lease option
  t5540/5541: smart-http does not support "--force-with-lease"
  t5533: test "push --force-with-lease"
  push --force-with-lease: tie it all together
  push --force-with-lease: implement logic to populate old_sha1_expect[]
  remote.c: add command line option parser for "--force-with-lease"
  builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN
  cache.h: move remote/connect API out of it

11 years agoMerge branch 'nd/clone-connectivity-shortcut'
Junio C Hamano [Mon, 9 Sep 2013 21:30:01 +0000 (14:30 -0700)]
Merge branch 'nd/clone-connectivity-shortcut'

* nd/clone-connectivity-shortcut:
  smart http: use the same connectivity check on cloning

11 years agoMerge branch 'jc/diff-filter-negation'
Junio C Hamano [Mon, 9 Sep 2013 21:28:35 +0000 (14:28 -0700)]
Merge branch 'jc/diff-filter-negation'

Teach "git diff --diff-filter" to express "I do not want to see
these classes of changes" more directly by listing only the
unwanted ones in lowercase (e.g. "--diff-filter=d" will show
everything but deletion) and deprecate "diff-files -q" which did
the same thing as "--diff-filter=d".

* jc/diff-filter-negation:
  diff: deprecate -q option to diff-files
  diff: allow lowercase letter to specify what change class to exclude
  diff: reject unknown change class given to --diff-filter
  diff: preparse --diff-filter string argument
  diff: factor out match_filter()
  diff: pass the whole diff_options to diffcore_apply_filter()

11 years agoMerge branch 'ms/fetch-prune-configuration'
Junio C Hamano [Mon, 9 Sep 2013 21:27:11 +0000 (14:27 -0700)]
Merge branch 'ms/fetch-prune-configuration'

Allow fetch.prune and remote.*.prune configuration variables to be set,
and "git fetch" to behave as if "--prune" is given.

"git fetch" that honors remote.*.prune is fine, but I wonder if we
should somehow make "git push" aware of it as well.  Perhaps
remote.*.prune should not be just a boolean, but a 4-way "none",
"push", "fetch", "both"?

* ms/fetch-prune-configuration:
  fetch: make --prune configurable

11 years agoremote-bzr: reuse bzrlib transports when possible
Richard Hansen [Sun, 8 Sep 2013 05:47:49 +0000 (01:47 -0400)]
remote-bzr: reuse bzrlib transports when possible

Pass a list of open bzrlib.transport.Transport objects to each bzrlib
function that might create a transport.  This enables bzrlib to reuse
existing transports when possible, avoiding multiple concurrent
connections to the same remote server.

If the remote server is accessed via ssh, this fixes a couple of
problems:
  * If the user does not have keys loaded into an ssh agent, the user
    may be prompted for a password multiple times.
  * If the user is using OpenSSH and the ControlMaster setting is set
    to auto, git-remote-bzr might hang.  This is because bzrlib closes
    the multiple ssh sessions in an undefined order and might try to
    close the master ssh session before the other sessions.  The
    master ssh process will not exit until the other sessions have
    exited, causing a deadlock.  (The ssh sessions are closed in an
    undefined order because bzrlib relies on the Python garbage
    collector to trigger ssh session termination.)

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with maint
Junio C Hamano [Thu, 5 Sep 2013 21:41:40 +0000 (14:41 -0700)]
Sync with maint

* maint:
  Documentation/git-merge.txt: fix formatting of example block

11 years agoMerge branch 'nd/fetch-pack-shallow-fix' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:40:58 +0000 (14:40 -0700)]
Merge branch 'nd/fetch-pack-shallow-fix' into maint

The recent "short-cut clone connectivity check" topic broke a shallow
repository when a fetch operation tries to auto-follow tags.

* nd/fetch-pack-shallow-fix:
  fetch-pack: do not remove .git/shallow file when --depth is not specified

11 years agoMerge branch 'hv/config-from-blob' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:40:18 +0000 (14:40 -0700)]
Merge branch 'hv/config-from-blob' into maint

Compilation fix on platforms with fgetc() and friends defined as
macros.

* hv/config-from-blob:
  config: do not use C function names as struct members

11 years agoMerge branch 'maint-1.8.3' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:24:59 +0000 (14:24 -0700)]
Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
  Documentation/git-merge.txt: fix formatting of example block

11 years agoMerge branch 'maint-1.8.2' into maint-1.8.3
Junio C Hamano [Thu, 5 Sep 2013 21:24:52 +0000 (14:24 -0700)]
Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
  Documentation/git-merge.txt: fix formatting of example block

11 years agoadd: lift the pathspec magic restriction on "add -p"
Nguyễn Thái Ngọc Duy [Thu, 5 Sep 2013 03:40:39 +0000 (10:40 +0700)]
add: lift the pathspec magic restriction on "add -p"

Since 480ca64 (convert run_add_interactive to use struct pathspec -
2013-07-14), we have unconditionally passed :(prefix)xxx to
add-interactive.perl. It implies that all commands
add-interactive.perl calls must be aware of pathspec magic, or
:(prefix) is barfed. The restriction to :/ only becomes unnecessary.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopathspec: catch prepending :(prefix) on pathspec with short magic
Nguyễn Thái Ngọc Duy [Thu, 5 Sep 2013 03:40:38 +0000 (10:40 +0700)]
pathspec: catch prepending :(prefix) on pathspec with short magic

:(prefix) is in the long form. Suppose people pass :!foo with '!'
being the short form of magic 'bar', the code will happily turn it to
:(prefix..)!foo, which makes '!' part of the path and no longer a magic.

The correct form must be ':(prefix..,bar)foo', but as so far we
haven't had any magic in short form yet (*), the code to convert from
short form to long one will be inactive anyway. Let's postpone it
until a real short form magic appears.

(*) The short form magic '/' is a special case and won't be caught by
this die(), which is correct. When '/' magic is detected, prefixlen is
set back to 0 and the whole "if (prefixlen..)" block is skipped.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoDocumentation/git-merge.txt: fix formatting of example block
Andreas Schwab [Thu, 5 Sep 2013 15:12:45 +0000 (17:12 +0200)]
Documentation/git-merge.txt: fix formatting of example block

You need at least four dashes in a line to have it recognized as listing
block delimiter by asciidoc.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopull: allow pull to preserve merges when rebasing
Stephen Haberman [Tue, 13 Aug 2013 03:43:42 +0000 (22:43 -0500)]
pull: allow pull to preserve merges when rebasing

If a user is working on master, and has merged in their feature branch, but now
has to "git pull" because master moved, with pull.rebase their feature branch
will be flattened into master.

This is because "git pull" currently does not know about rebase's preserve
merges flag, which would avoid this behavior, as it would instead replay just
the merge commit of the feature branch onto the new master, and not replay each
individual commit in the feature branch.

Add a --rebase=preserve option, which will pass along --preserve-merges to
rebase.

Also add 'preserve' to the allowed values for the pull.rebase config setting.

Signed-off-by: Stephen Haberman <stephen@exigencecorp.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes after merging the first batch of topics
Junio C Hamano [Wed, 4 Sep 2013 19:41:05 +0000 (12:41 -0700)]
Update draft release notes after merging the first batch of topics

11 years agoMerge branch 'sb/parseopt-boolean-removal'
Junio C Hamano [Wed, 4 Sep 2013 19:39:02 +0000 (12:39 -0700)]
Merge branch 'sb/parseopt-boolean-removal'

Convert most uses of OPT_BOOLEAN/OPTION_BOOLEAN that can use
OPT_BOOL/OPTION_BOOLEAN which have much saner semantics, and turn
remaining ones into OPT_SET_INT, OPT_COUNTUP, etc. as necessary.

* sb/parseopt-boolean-removal:
  revert: use the OPT_CMDMODE for parsing, reducing code
  checkout-index: fix negations of even numbers of -n
  config parsing options: allow one flag multiple times
  hash-object: replace stdin parsing OPT_BOOLEAN by OPT_COUNTUP
  branch, commit, name-rev: ease up boolean conditions
  checkout: remove superfluous local variable
  log, format-patch: parsing uses OPT__QUIET
  Replace deprecated OPT_BOOLEAN by OPT_BOOL
  Remove deprecated OPTION_BOOLEAN for parsing arguments

11 years agoMerge branch 'jc/parseopt-command-modes'
Junio C Hamano [Wed, 4 Sep 2013 19:37:52 +0000 (12:37 -0700)]
Merge branch 'jc/parseopt-command-modes'

Many commands use --dashed-option as a operation mode selector
(e.g. "git tag --delete") that the user can use at most one
(e.g. "git tag --delete --verify" is a nonsense) and you cannot
negate (e.g. "git tag --no-delete" is a nonsense).  Make it easier
for users of parse_options() to enforce these restrictions.

* jc/parseopt-command-modes:
  tag: use OPT_CMDMODE
  parse-options: add OPT_CMDMODE()

11 years agoMerge branch 'jl/some-submodule-config-are-not-boolean'
Junio C Hamano [Wed, 4 Sep 2013 19:36:51 +0000 (12:36 -0700)]
Merge branch 'jl/some-submodule-config-are-not-boolean'

* jl/some-submodule-config-are-not-boolean:
  avoid segfault on submodule.*.path set to an empty "true"

11 years agoMerge branch 'sg/bash-prompt-lf-in-cwd-test'
Junio C Hamano [Wed, 4 Sep 2013 19:36:47 +0000 (12:36 -0700)]
Merge branch 'sg/bash-prompt-lf-in-cwd-test'

* sg/bash-prompt-lf-in-cwd-test:
  bash prompt: test the prompt with newline in repository path

11 years agoMerge branch 'sb/diff-delta-remove-needless-comparison'
Junio C Hamano [Wed, 4 Sep 2013 19:36:44 +0000 (12:36 -0700)]
Merge branch 'sb/diff-delta-remove-needless-comparison'

* sb/diff-delta-remove-needless-comparison:
  create_delta_index: simplify condition always evaluating to true

11 years agoMerge branch 'fc/unpack-trees-leakfix'
Junio C Hamano [Wed, 4 Sep 2013 19:36:41 +0000 (12:36 -0700)]
Merge branch 'fc/unpack-trees-leakfix'

* fc/unpack-trees-leakfix:
  unpack-trees: plug a memory leak

11 years agoMerge branch 'aj/p4-symlink-lose-nl'
Junio C Hamano [Wed, 4 Sep 2013 19:36:37 +0000 (12:36 -0700)]
Merge branch 'aj/p4-symlink-lose-nl'

* aj/p4-symlink-lose-nl:
  git-p4: Fix occasional truncation of symlink contents.

11 years agoMerge branch 'fc/remote-hg-shared-setup'
Junio C Hamano [Wed, 4 Sep 2013 19:36:32 +0000 (12:36 -0700)]
Merge branch 'fc/remote-hg-shared-setup'

* fc/remote-hg-shared-setup:
  remote-hg: add shared repo upgrade
  remote-hg: ensure shared repo is initialized

11 years agoMerge branch 'sb/misc-cleanup'
Junio C Hamano [Wed, 4 Sep 2013 19:36:30 +0000 (12:36 -0700)]
Merge branch 'sb/misc-cleanup'

* sb/misc-cleanup:
  rm: remove unneeded null pointer check
  diff: fix a possible null pointer dereference
  diff: remove ternary operator evaluating always to true

11 years agoMerge branch 'nd/gc-lock-against-each-other'
Junio C Hamano [Wed, 4 Sep 2013 19:35:34 +0000 (12:35 -0700)]
Merge branch 'nd/gc-lock-against-each-other'

* nd/gc-lock-against-each-other:
  gc: reject if another gc is running, unless --force is given

11 years agoMerge branch 'ap/remote-hg-tilde-is-home-directory'
Junio C Hamano [Wed, 4 Sep 2013 19:33:57 +0000 (12:33 -0700)]
Merge branch 'ap/remote-hg-tilde-is-home-directory'

* ap/remote-hg-tilde-is-home-directory:
  remote-hg: fix path when cloning with tilde expansion

11 years agoMerge branch 'mm/no-shell-escape-in-die-message'
Junio C Hamano [Wed, 4 Sep 2013 19:32:15 +0000 (12:32 -0700)]
Merge branch 'mm/no-shell-escape-in-die-message'

Fixes a minor bug in "git rebase -i" (there could be others, as the
root cause is pretty generic) where the code feeds a random, data
dependeant string to 'echo' and expects it to come out literally.

* mm/no-shell-escape-in-die-message:
  die_with_status: use "printf '%s\n'", not "echo"

11 years agoMerge branch 'tr/fd-gotcha-fixes'
Junio C Hamano [Wed, 4 Sep 2013 19:32:11 +0000 (12:32 -0700)]
Merge branch 'tr/fd-gotcha-fixes'

Finishing touches to an earlier fix already in 'master'.

* tr/fd-gotcha-fixes:
  t0070: test that git_mkstemps correctly checks return value of open()

11 years agoMerge branch 'bc/unuse-packfile'
Junio C Hamano [Wed, 4 Sep 2013 19:30:21 +0000 (12:30 -0700)]
Merge branch 'bc/unuse-packfile'

Handle memory pressure and file descriptor pressure separately when
deciding to release pack windows to honor resource limits.

* bc/unuse-packfile:
  Don't close pack fd when free'ing pack windows
  sha1_file: introduce close_one_pack() to close packs on fd pressure

11 years agoMerge branch 'da/darwin'
Junio C Hamano [Wed, 4 Sep 2013 19:28:15 +0000 (12:28 -0700)]
Merge branch 'da/darwin'

* da/darwin:
  OS X: Fix redeclaration of die warning
  Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1
  imap-send: use Apple's Security framework for base64 encoding

11 years agoMerge branch 'nd/sq-quote-buf'
Junio C Hamano [Wed, 4 Sep 2013 19:28:12 +0000 (12:28 -0700)]
Merge branch 'nd/sq-quote-buf'

Code simplification as a preparatory step to something larger.

* nd/sq-quote-buf:
  quote: remove sq_quote_print()
  tar-tree: remove dependency on sq_quote_print()
  for-each-ref, quote: convert *_quote_print -> *_quote_buf

11 years agoMerge branch 'rr/feed-real-path-to-editor'
Junio C Hamano [Wed, 4 Sep 2013 19:26:54 +0000 (12:26 -0700)]
Merge branch 'rr/feed-real-path-to-editor'

* rr/feed-real-path-to-editor:
  editor: use canonicalized absolute path

11 years agoMerge branch 'jk/fast-import-empty-ls'
Junio C Hamano [Wed, 4 Sep 2013 19:23:35 +0000 (12:23 -0700)]
Merge branch 'jk/fast-import-empty-ls'

* jk/fast-import-empty-ls:
  fast-import: allow moving the root tree
  fast-import: allow ls or filecopy of the root tree
  fast-import: set valid mode on root tree in "ls"
  t9300: document fast-import empty path issues

11 years agoMerge branch 'km/svn-1.8-serf-only'
Junio C Hamano [Wed, 4 Sep 2013 19:23:33 +0000 (12:23 -0700)]
Merge branch 'km/svn-1.8-serf-only'

Subversion 1.8.0 that was recently released breaks older subversion
clients coming over http/https in various ways.

* km/svn-1.8-serf-only:
  Git.pm: revert _temp_cache use of temp_is_locked
  git-svn: allow git-svn fetching to work using serf
  Git.pm: add new temp_is_locked function

11 years agoMerge branch 'jc/check-x-z'
Junio C Hamano [Wed, 4 Sep 2013 19:23:24 +0000 (12:23 -0700)]
Merge branch 'jc/check-x-z'

"git check-ignore -z" applied the NUL termination to both its input
(with --stdin) and its output, but "git check-attr -z" ignored the
option on the output side.

This is potentially a backward incompatible fix.  Let's see if
anybody screams before deciding if we want to do anything to help
existing users (there may be none).

* jc/check-x-z:
  check-attr -z: a single -z should apply to both input and output
  check-ignore -z: a single -z should apply to both input and output
  check-attr: the name of the character is NUL, not NULL
  check-ignore: the name of the character is NUL, not NULL

11 years agoMerge branch 'maint'
Junio C Hamano [Tue, 3 Sep 2013 20:58:16 +0000 (13:58 -0700)]
Merge branch 'maint'

* maint:
  fix shell syntax error in template
  l10n: fr.po: hotfix for commit 6b388fc

11 years agoMerge git://github.com/git-l10n/git-po into maint
Junio C Hamano [Tue, 3 Sep 2013 20:58:03 +0000 (13:58 -0700)]
Merge git://github.com/git-l10n/git-po into maint

* git://github.com/git-l10n/git-po:
  l10n: fr.po: hotfix for commit 6b388fc

11 years agoMerge branch 'maint-1.8.3' into maint
Junio C Hamano [Tue, 3 Sep 2013 20:54:32 +0000 (13:54 -0700)]
Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
  fix shell syntax error in template

11 years agoMerge branch 'maint-1.8.2' into maint-1.8.3
Junio C Hamano [Tue, 3 Sep 2013 20:54:26 +0000 (13:54 -0700)]
Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
  fix shell syntax error in template

11 years agoStart the post-1.8.4 cycle
Junio C Hamano [Fri, 30 Aug 2013 17:16:16 +0000 (10:16 -0700)]
Start the post-1.8.4 cycle

It is tentatively called 1.8.5, but it should be an easy matter of
renaming the release-notes file and RelNotes symlink to later call
it 1.9 near the end of the cycle if we wanted to.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'bc/completion-for-bash-3.0'
Junio C Hamano [Fri, 30 Aug 2013 17:10:55 +0000 (10:10 -0700)]
Merge branch 'bc/completion-for-bash-3.0'

Some people still use rather old versions of bash, which cannot
grok some constructs like 'printf -v varname' the prompt and
completion code started to use recently.

* bc/completion-for-bash-3.0:
  contrib/git-prompt.sh: handle missing 'printf -v' more gracefully
  t9902-completion.sh: old Bash still does not support array+=('') notation
  git-completion.bash: use correct Bash/Zsh array length syntax

11 years agoMerge branch 'sp/doc-smart-http'
Junio C Hamano [Fri, 30 Aug 2013 17:10:51 +0000 (10:10 -0700)]
Merge branch 'sp/doc-smart-http'

* sp/doc-smart-http:
  Document the HTTP transport protocols

11 years agoMerge branch 'mm/war-on-whatchanged'
Junio C Hamano [Fri, 30 Aug 2013 17:08:26 +0000 (10:08 -0700)]
Merge branch 'mm/war-on-whatchanged'

* mm/war-on-whatchanged:
  whatchanged: document its historical nature
  core-tutorial: trim the section on Inspecting Changes

11 years agoMerge branch 'rt/doc-merge-file-diff3'
Junio C Hamano [Fri, 30 Aug 2013 17:08:23 +0000 (10:08 -0700)]
Merge branch 'rt/doc-merge-file-diff3'

* rt/doc-merge-file-diff3:
  Documentation/git-merge-file: document option "--diff3"

11 years agoMerge branch 'mb/docs-favor-en-us'
Junio C Hamano [Fri, 30 Aug 2013 17:08:19 +0000 (10:08 -0700)]
Merge branch 'mb/docs-favor-en-us'

Declare that the official grammar & spelling of the source of this
project is en_US, but strongly discourage patches only to "fix"
existing en_UK strings to avoid unnecessary churns.

* mb/docs-favor-en-us:
  Provide some linguistic guidance for the documentation.

11 years agoMerge branch 'rj/doc-rev-parse'
Junio C Hamano [Fri, 30 Aug 2013 17:08:12 +0000 (10:08 -0700)]
Merge branch 'rj/doc-rev-parse'

* rj/doc-rev-parse:
  rev-parse(1): logically group options
  rev-parse: remove restrictions on some options

11 years agoMerge branch 'hv/config-from-blob'
Junio C Hamano [Fri, 30 Aug 2013 17:06:52 +0000 (10:06 -0700)]
Merge branch 'hv/config-from-blob'

Portability fix.

* hv/config-from-blob:
  config: do not use C function names as struct members

11 years agoMerge branch 'nd/fetch-pack-shallow-fix'
Junio C Hamano [Fri, 30 Aug 2013 17:05:55 +0000 (10:05 -0700)]
Merge branch 'nd/fetch-pack-shallow-fix'

The recent "short-cut clone connectivity check" topic broke a
shallow repository when a fetch operation tries to auto-follow tags.

* nd/fetch-pack-shallow-fix:
  fetch-pack: do not remove .git/shallow file when --depth is not specified

11 years agofix shell syntax error in template
Thorsten Glaser [Fri, 30 Aug 2013 10:40:30 +0000 (12:40 +0200)]
fix shell syntax error in template

An if clause must not be empty; add a "colon" command.

Signed-off-by: Thorsten Glaser <t.glaser@tarent.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agol10n: fr.po: hotfix for commit 6b388fc
Sebastien Helleu [Sun, 25 Aug 2013 09:45:13 +0000 (11:45 +0200)]
l10n: fr.po: hotfix for commit 6b388fc

Fix many typos and add some new translations (1277/2080 messages
translated).

Closes git-l10n/git-po/pull/63.

Signed-off-by: Sebastien Helleu <flashcode@flashtux.org>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
11 years agobuiltin/fetch.c: Fix a sparse warning
Ramsay Jones [Wed, 28 Aug 2013 18:56:17 +0000 (19:56 +0100)]
builtin/fetch.c: Fix a sparse warning

Sparse issues an "'prepare_transport' was not declared. Should it
be static?" warning. In order to suppress the warning, since this
symbol only requires file scope, we simply add the static modifier
to it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agomailmap: handle mailmap blobs without trailing newlines
Jeff King [Wed, 28 Aug 2013 01:41:39 +0000 (21:41 -0400)]
mailmap: handle mailmap blobs without trailing newlines

The read_mailmap_buf function reads each line of the mailmap
using strchrnul, like:

    const char *end = strchrnul(buf, '\n');
    unsigned long linelen = end - buf + 1;

But that's off-by-one when we actually hit the NUL byte; our
line does not have a terminator, and so is only "end - buf"
bytes long. As a result, when we subtract the linelen from
the total len, we end up with (unsigned long)-1 bytes left
in the buffer, and we start reading random junk from memory.

We could fix it with:

    unsigned long linelen = end - buf + !!*end;

but let's take a step back for a moment. It's questionable
in the first place for a function that takes a buffer and
length to be using strchrnul. But it works because we only
have one caller (and are only likely to ever have this one),
which is handing us data from read_sha1_file. Which means
that it's always NUL-terminated.

Instead of tightening the assumptions to make the
buffer/length pair work for a caller that doesn't actually
exist, let's let loosen the assumptions to what the real
caller has: a modifiable, NUL-terminated string.

This makes the code simpler and shorter (because we don't
have to correlate strchrnul with the length calculation),
correct (because the code with the off-by-one just goes
away), and more efficient (we can drop the extra allocation
we needed to create NUL-terminated strings for each line,
and just terminate in place).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoconfig: do not use C function names as struct members
Jeff King [Mon, 26 Aug 2013 21:57:18 +0000 (17:57 -0400)]
config: do not use C function names as struct members

According to C99, section 7.1.4:

  Any function declared in a header may be additionally
  implemented as a function-like macro defined in the
  header.

Therefore calling our struct member function pointer "fgetc"
may run afoul of unwanted macro expansion when we call:

  char c = cf->fgetc(cf);

This turned out to be a problem on uclibc, which defines
fgetc as a macro and causes compilation failure.

The standard suggests fixing this in a few ways:

  1. Using extra parentheses to inhibit the function-like
     macro expansion. E.g., "(cf->fgetc)(cf)". This is
     undesirable as it's ugly, and each call site needs to
     remember to use it (and on systems without the macro,
     forgetting will compile just fine).

  2. Using #undef (because a conforming implementation must
     also be providing fgetc as a function). This is
     undesirable because presumably the implementation was
     using the macro for a performance benefit, and we are
     dropping that optimization.

Instead, we can simply use non-colliding names.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofetch-pack: do not remove .git/shallow file when --depth is not specified
Nguyễn Thái Ngọc Duy [Mon, 26 Aug 2013 02:17:26 +0000 (09:17 +0700)]
fetch-pack: do not remove .git/shallow file when --depth is not specified

fetch_pack() can remove .git/shallow file when a shallow repository
becomes a full one again. This behavior is triggered incorrectly when
tags are also fetched because fetch_pack() will be called twice. At
the first fetch_pack() call:

 - shallow_lock is set up
 - alternate_shallow_file points to shallow_lock.filename, which is
   "shallow.lock"
 - commit_lock_file is called, which sets shallow_lock.filename to "".
   alternate_shallow_file also becomes "" because it points to the
   same memory.

At the second call, setup_alternate_shallow() is not called and
alternate_shallow_file remains "". It's mistaken as unshallow case and
.git/shallow is removed. The end result is a broken repository.

Fix this by always initializing alternate_shallow_file when
fetch_pack() is called. As an extra measure, check if args->depth > 0
before commit/rollback shallow file.

Reported-by: Kacper Kornet <kornet@camk.edu.pl>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.8.4 v1.8.4
Junio C Hamano [Fri, 23 Aug 2013 18:49:46 +0000 (11:49 -0700)]
Git 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocontrib/git-prompt.sh: handle missing 'printf -v' more gracefully
Brandon Casey [Thu, 22 Aug 2013 01:39:03 +0000 (18:39 -0700)]
contrib/git-prompt.sh: handle missing 'printf -v' more gracefully

Old Bash (3.0) which is distributed with RHEL 4.X and other ancient
platforms that are still in wide use, do not have a printf that
supports -v.  Neither does Zsh (which is already handled in the code).

As suggested by Junio, let's test whether printf supports the -v
option and store the result.  Then later, we can use it to
determine whether 'printf -v' can be used, or whether printf
must be called in a subshell.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot9902-completion.sh: old Bash still does not support array+=('') notation
Brandon Casey [Wed, 21 Aug 2013 20:49:32 +0000 (13:49 -0700)]
t9902-completion.sh: old Bash still does not support array+=('') notation

Old Bash (3.0) which is distributed with RHEL 4.X and other ancient
platforms that are still in wide use, does not understand the
array+=() notation.  Let's use an explicit assignment to the new array
element which works everywhere, like:

   array[${#array[@]}+1]=''

The right-hand side '' is not strictly necessary, but in this case
I think it is more clear.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-completion.bash: use correct Bash/Zsh array length syntax
Brandon Casey [Wed, 21 Aug 2013 20:49:31 +0000 (13:49 -0700)]
git-completion.bash: use correct Bash/Zsh array length syntax

The syntax for retrieving the number of elements in an array is:

   ${#name[@]}

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoTypofix draft release notes to 1.8.4
Junio C Hamano [Wed, 21 Aug 2013 22:30:04 +0000 (15:30 -0700)]
Typofix draft release notes to 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoDocument the HTTP transport protocols
Shawn O. Pearce [Wed, 21 Aug 2013 13:45:13 +0000 (20:45 +0700)]
Document the HTTP transport protocols

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Revised-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitweb: make search help link less ugly
Tony Finch [Tue, 20 Aug 2013 16:59:54 +0000 (17:59 +0100)]
gitweb: make search help link less ugly

The search help link was a superscript question mark right next to
a drop-down menu, which looks misaligned and is a cramped and
awkward click target. Remove the superscript tags and add some
spacing to fix these nits. Add a title attribute to provide an
explanatory mouseover.

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitweb: omit the repository owner when it is unset
Tony Finch [Tue, 20 Aug 2013 16:59:44 +0000 (17:59 +0100)]
gitweb: omit the repository owner when it is unset

On the repository summary page, leave the owner line out if the
repo does not have an owner, rather than displaying a labelled empty
field. This does not affect the owner column in the projects list
page, which is present unless $omit_owner is true.

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitweb: vertically centre contents of page footer
Tony Finch [Tue, 20 Aug 2013 16:59:03 +0000 (17:59 +0100)]
gitweb: vertically centre contents of page footer

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitweb: ensure OPML text fits inside its box
Tony Finch [Tue, 20 Aug 2013 16:59:02 +0000 (17:59 +0100)]
gitweb: ensure OPML text fits inside its box

The rss_logo CSS style has a fixed width which is too narrow for
the string "OPML". Replace the fixed width with horizontal padding
so the text fits with nice margins.

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoread-cache: use fixed width integer types
Thomas Gummerer [Sun, 18 Aug 2013 19:41:51 +0000 (21:41 +0200)]
read-cache: use fixed width integer types

Use the fixed width integer types uint16_t and uint32_t for on-disk
structures; unsigned short and unsigned int do not have a guaranteed
size.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agostream_to_pack: xread does not guarantee to read all requested bytes
Johannes Sixt [Tue, 20 Aug 2013 09:15:26 +0000 (11:15 +0200)]
stream_to_pack: xread does not guarantee to read all requested bytes

The deflate loop in bulk-checkin::stream_to_pack expects to get all bytes
from a file that it requests to read in a single function call. But it
used xread(), which does not give that guarantee. Replace it by
read_in_full().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoRevert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
Steffen Prohaska [Tue, 20 Aug 2013 06:43:55 +0000 (08:43 +0200)]
Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"

This reverts commit 6c642a878688adf46b226903858b53e2d31ac5c3.

The previous commit introduced a size limit on IO chunks on all
platforms.  The compat clipped_write() is not needed anymore.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoxread, xwrite: limit size of IO to 8MB
Steffen Prohaska [Tue, 20 Aug 2013 06:43:54 +0000 (08:43 +0200)]
xread, xwrite: limit size of IO to 8MB

Checking out 2GB or more through an external filter (see test) fails
on Mac OS X 10.8.4 (12E55) for a 64-bit executable with:

    error: read from external filter cat failed
    error: cannot feed the input to external filter cat
    error: cat died of signal 13
    error: external filter cat failed 141
    error: external filter cat failed

The reason is that read() immediately returns with EINVAL when asked
to read more than 2GB.  According to POSIX [1], if the value of
nbyte passed to read() is greater than SSIZE_MAX, the result is
implementation-defined.  The write function has the same restriction
[2].  Since OS X still supports running 32-bit executables, the
32-bit limit (SSIZE_MAX = INT_MAX = 2GB - 1) seems to be also
imposed on 64-bit executables under certain conditions.  For write,
the problem has been addressed earlier [6c642a].

Address the problem for read() and write() differently, by limiting
size of IO chunks unconditionally on all platforms in xread() and
xwrite().  Large chunks only cause problems, like causing latencies
when killing the process, even if OS X was not buggy.  Doing IO in
reasonably sized smaller chunks should have no negative impact on
performance.

The compat wrapper clipped_write() introduced earlier [6c642a] is
not needed anymore.  It will be reverted in a separate commit.  The
new test catches read and write problems.

Note that 'git add' exits with 0 even if it prints filtering errors
to stderr.  The test, therefore, checks stderr.  'git add' should
probably be changed (sometime in another commit) to exit with
nonzero if filtering fails.  The test could then be changed to use
test_must_fail.

Thanks to the following people for suggestions and testing:

    Johannes Sixt <j6t@kdbg.org>
    John Keeping <john@keeping.me.uk>
    Jonathan Nieder <jrnieder@gmail.com>
    Kyle J. McKay <mackyle@gmail.com>
    Linus Torvalds <torvalds@linux-foundation.org>
    Torsten Bögershausen <tboegi@web.de>

[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
[2] http://pubs.opengroup.org/onlinepubs/009695399/functions/write.html

[6c642a] commit 6c642a878688adf46b226903858b53e2d31ac5c3
    compate/clipped-write.c: large write(2) fails on Mac OS X/XNU

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agomailmap: remove redundant check for freeing memory
Stefan Beller [Tue, 20 Aug 2013 14:18:00 +0000 (16:18 +0200)]
mailmap: remove redundant check for freeing memory

The condition as it is written in that line has already been checked
in the beginning of the function, which was introduced in
8503ee4 (2007-05-01, Fix read_mailmap to handle a caller uninterested
in repo abbreviation)

Helped-by: Jeff King <peff@peff.net>
Helped-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoavoid segfault on submodule.*.path set to an empty "true"
Jharrod LaFon [Mon, 19 Aug 2013 16:26:56 +0000 (09:26 -0700)]
avoid segfault on submodule.*.path set to an empty "true"

Git fails due to a segmentation fault if a submodule path is empty.
Here is an example .gitmodules that will cause a segmentation fault:

    [submodule "foo-module"]
      path
      url = http://host/repo.git
    $ git status
    Segmentation fault (core dumped)

This is because the parsing of "submodule.*.path" is not prepared to
see a value-less "true" and assumes that the value is always
non-NULL (parsing of "ignore" has the same problem).

Fix it by checking the NULL-ness of value and complain with
config_error_nonbool().

Signed-off-by: Jharrod LaFon <jlafon@eyesopen.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.8.4-rc4 v1.8.4-rc4
Junio C Hamano [Mon, 19 Aug 2013 17:34:14 +0000 (10:34 -0700)]
Git 1.8.4-rc4

As we had to revert two topics at the last minute, let's have
another (hopefully short) round of rc to make sure the final release
will be sound.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agobash prompt: test the prompt with newline in repository path
SZEDER Gábor [Sat, 17 Aug 2013 09:01:58 +0000 (11:01 +0200)]
bash prompt: test the prompt with newline in repository path

Newlines in the path to a git repository were not an issue for the
git-specific bash prompt before commit efaa0c1532 (bash prompt:
combine 'git rev-parse' executions in the main code path, 2013-06-17),
because the path returned by 'git rev-parse --git-dir' was directly
stored in a variable, and this variable was later always accessed
inside double quotes.

Newlines are not an issue after commit efaa0c1532 either, but it's
more subtle.  Since efaa0c1532 we use the following single 'git
rev-parse' execution to query various info about the repository:

  git rev-parse --git-dir --is-inside-git-dir \
          --is-bare-repository --is-inside-work-tree

The results to these queries are separated by a newline character in
the output, e.g.:

  /home/szeder/src/git/.git
  false
  false
  true

A newline in the path to the git repository could potentially break
the parsing of these results and ultimately the bash prompt, unless
the parsing is done right.  Commit efaa0c1532 got it right, as I
consciously started parsing 'git rev-parse's output from the end,
where each record is a single line containing either 'true' or 'false'
or, after e3e0b9378b (bash prompt: combine 'git rev-parse' for
detached head, 2013-06-24), the abbreviated commit object name, and
all what remains at the beginning is the path to the git repository,
no matter how many lines it is.

This subtlety really warrants its own test, especially since I didn't
explain it in the log message or in an in-code comment back then, so
add a test to excercise the prompt with newline characters in the path
to the repository.  Guard this test with the FUNNYNAMES prerequisite,
because not all filesystems support newlines in filenames.  Note that
'git rev-parse --git-dir' prints '.git' or '.' when at the top of the
worktree or the repository, respectively, and only prints the full
path to the repository when in a subdirectory, hence the need for
changing into a subdir in the test.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agorebase -i: fix cases ignoring core.commentchar
Eric Sunshine [Fri, 16 Aug 2013 21:44:07 +0000 (17:44 -0400)]
rebase -i: fix cases ignoring core.commentchar

180bad3d (rebase -i: respect core.commentchar, 2013-02-11) updated
"rebase -i" to honor core.commentchar but missed one instance of
hard-coded '#' comment character in skip_unnecessary_picks().

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocreate_delta_index: simplify condition always evaluating to true
Stefan Beller [Fri, 16 Aug 2013 21:22:37 +0000 (23:22 +0200)]
create_delta_index: simplify condition always evaluating to true

The code sequence  ' (1u << i) < hsize && i < 31 ' is a multi step
process, whose first step requires that 'i' is already less that 31,
otherwise the result (1u << i)  is undefined (and  'undef_val < hsize'
can therefore be assumed to be 'false'), and so the later test  i < 31
can always be optimized away as dead code ('i' is already less than 31,
or the short circuit 'and' applies).

So we need to get rid of that code. One way would be to exchange the
order of the conditions, so the expression 'i < 31 && (1u << i) < hsize'
would remove that optimized unstable code already.

However when checking the previous lines in that function, we can deduce
that 'hsize' must always be smaller than (1u<<31), since 506049c7df2c6
(fix >4GiB source delta assertion failure), because 'entries' is
capped at an upper bound of 0xfffffffeU, so 'hsize' contains a maximum
value of 0x3fffffff, which is smaller than (1u<<31), so the value of
'i' will never be larger than 31 and we can remove that condition
entirely.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Acked-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoRevert "Add new @ shortcut for HEAD"
Junio C Hamano [Wed, 14 Aug 2013 17:57:24 +0000 (10:57 -0700)]
Revert "Add new @ shortcut for HEAD"

This reverts commit cdfd94837b27c220f70f032b596ea993d195488f, as it
does not just apply to "@" (and forms with modifiers like @{u}
applied to it), but also affects e.g. "refs/heads/@/foo", which it
shouldn't.

The basic idea of giving a short-hand might be good, and the topic
can be retried later, but let's revert to avoid affecting existing
use cases for now for the upcoming release.

11 years agoRevert "git stash: avoid data loss when "git stash save" kills a directory"
Junio C Hamano [Wed, 14 Aug 2013 16:53:43 +0000 (09:53 -0700)]
Revert "git stash: avoid data loss when "git stash save" kills a directory"

This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it
has been reported that "ls-files --killed" is too time-consuming in
a deep directory with too many untracked crufts (e.g. $HOME/.git
tracking only a few files).

We'd need to revisit it later but "ls-files --killed" needs to be
optimized before it happens.

11 years agounpack-trees: plug a memory leak
Felipe Contreras [Tue, 13 Aug 2013 18:27:58 +0000 (20:27 +0200)]
unpack-trees: plug a memory leak

Before overwriting the destination index, first let's discard its
contents.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Tested-by: Лежанкин Иван <abyss.7@gmail.com> wrote:
Reviewed-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.8.4-rc3 v1.8.4-rc3
Junio C Hamano [Tue, 13 Aug 2013 18:10:18 +0000 (11:10 -0700)]
Git 1.8.4-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge git://github.com/git-l10n/git-po
Junio C Hamano [Tue, 13 Aug 2013 17:50:01 +0000 (10:50 -0700)]
Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
  l10n: Add reference for french translation team
  l10n: fr.po: 821/2112 messages translated