]> Pileus Git - ~andy/git/log
~andy/git
11 years agoMerge branch 'maint'
Junio C Hamano [Mon, 1 Jul 2013 19:46:54 +0000 (12:46 -0700)]
Merge branch 'maint'

* maint:
  t7500: fix flipped actual/expect
  lib-rebase: document exec_ in FAKE_LINES

11 years agoUpdate draft release notes to 1.8.4
Junio C Hamano [Mon, 1 Jul 2013 19:46:41 +0000 (12:46 -0700)]
Update draft release notes to 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'rr/remote-branch-config-refresh'
Junio C Hamano [Mon, 1 Jul 2013 19:41:58 +0000 (12:41 -0700)]
Merge branch 'rr/remote-branch-config-refresh'

The original way to specify remote repository using .git/branches/
used to have a nifty feature.  The code to support the feature was
still in a function but the caller was changed not to call it 5
years ago, breaking that feature and leaving the supporting code
unreachable.

* rr/remote-branch-config-refresh:
  t/t5505-remote: test multiple push/pull in remotes-file
  ls-remote doc: don't encourage use of branches-file
  ls-remote doc: rewrite <repository> paragraph
  ls-remote doc: fix example invocation on git.git
  t/t5505-remote: test url-with-# in branches-file
  remote: remove dead code in read_branches_file()
  t/t5505-remote: use test_path_is_missing
  t/t5505-remote: test push-refspec in branches-file
  t/t5505-remote: modernize style

11 years agoMerge branch 'ed/color-prompt'
Junio C Hamano [Mon, 1 Jul 2013 19:41:55 +0000 (12:41 -0700)]
Merge branch 'ed/color-prompt'

Code clean-up for in-prompt status script (in contrib/).

* ed/color-prompt:
  git-prompt.sh: add missing information in comments
  git-prompt.sh: do not print duplicate clean color code
  t9903: remove redundant tests
  git-prompt.sh: refactor colored prompt code
  t9903: add tests for git-prompt pcmode

11 years agoMerge branch 'ap/rebase-multiple-fixups'
Junio C Hamano [Mon, 1 Jul 2013 19:41:52 +0000 (12:41 -0700)]
Merge branch 'ap/rebase-multiple-fixups'

Having multiple "fixup!" on a line in the rebase instruction sheet
did not work very well with "git rebase -i --autosquash".

* ap/rebase-multiple-fixups:
  lib-rebase: style: use write_script, <<-\EOF
  rebase -i: handle fixup! fixup! in --autosquash

11 years agoMerge branch 'kb/am-deprecate-resolved'
Junio C Hamano [Mon, 1 Jul 2013 19:41:48 +0000 (12:41 -0700)]
Merge branch 'kb/am-deprecate-resolved'

Promote "git am --continue" over "git am --resolved" for UI
consistency.

* kb/am-deprecate-resolved:
  am: replace uses of --resolved with --continue

11 years agoMerge branch 'rr/column-doc'
Junio C Hamano [Mon, 1 Jul 2013 19:41:46 +0000 (12:41 -0700)]
Merge branch 'rr/column-doc'

* rr/column-doc:
  column doc: rewrite documentation for column.ui

11 years agoMerge branch 'ft/doc-git-transport'
Junio C Hamano [Mon, 1 Jul 2013 19:41:43 +0000 (12:41 -0700)]
Merge branch 'ft/doc-git-transport'

* ft/doc-git-transport:
  documentation: add git:// transport security notice

11 years agoMerge branch 'sb/mailmap-merijn-brand'
Junio C Hamano [Mon, 1 Jul 2013 19:41:41 +0000 (12:41 -0700)]
Merge branch 'sb/mailmap-merijn-brand'

* sb/mailmap-merijn-brand:
  .mailmap: Map "H.Merijn Brand" to "H. Merijn Brand"

11 years agoMerge branch 'sg/bash-prompt'
Junio C Hamano [Mon, 1 Jul 2013 19:41:37 +0000 (12:41 -0700)]
Merge branch 'sg/bash-prompt'

* sg/bash-prompt:
  bash prompt: mention that PROMPT_COMMAND mode is faster
  bash prompt: avoid command substitution when finalizing gitstring
  bash prompt: avoid command substitution when checking for untracked files
  bash prompt: use bash builtins to check stash state
  bash prompt: use bash builtins to check for unborn branch for dirty state
  bash prompt: combine 'git rev-parse' for detached head
  bash prompt: combine 'git rev-parse' executions in the main code path
  bash prompt: use bash builtins to find out current branch
  bash prompt: use bash builtins to find out rebase state
  bash prompt: run 'git rev-parse --git-dir' directly instead of __gitdir()
  bash prompt: return early from __git_ps1() when not in a git repository
  bash prompt: print unique detached HEAD abbreviated object name
  bash prompt: add a test for symbolic link symbolic refs
  completion, bash prompt: move __gitdir() tests to completion test suite
  bash prompt: use 'write_script' helper in interactive rebase test
  bash prompt: fix redirection coding style in tests

11 years agoMerge branch 'wk/doc-in-linux-3.x-era'
Junio C Hamano [Mon, 1 Jul 2013 19:41:34 +0000 (12:41 -0700)]
Merge branch 'wk/doc-in-linux-3.x-era'

Update documentation to match more recent realities.

* wk/doc-in-linux-3.x-era:
  Documentation: Update 'linux-2.6.git' -> 'linux.git'
  Documentation: Update the NFS remote examples to use the staging repo
  doc/clone: Pick more compelling paths for the --reference example
  doc/clone: Remove the '--bare -l -s' example

11 years agoMerge branch 'jc/topo-author-date-sort'
Junio C Hamano [Mon, 1 Jul 2013 19:41:22 +0000 (12:41 -0700)]
Merge branch 'jc/topo-author-date-sort'

"git log" learned the "--author-date-order" option, with which the
output is topologically sorted and commits in parallel histories
are shown intermixed together based on the author timestamp.

* jc/topo-author-date-sort:
  t6003: add --author-date-order test
  topology tests: teach a helper to set author dates as well
  t6003: add --date-order test
  topology tests: teach a helper to take abbreviated timestamps
  t/lib-t6000: style fixes
  log: --author-date-order
  sort-in-topological-order: use prio-queue
  prio-queue: priority queue of pointers to structs
  toposort: rename "lifo" field

11 years agoMerge branch 'jk/commit-info-slab'
Junio C Hamano [Mon, 1 Jul 2013 19:41:19 +0000 (12:41 -0700)]
Merge branch 'jk/commit-info-slab'

Allow adding custom information to commit objects in order to
represent unbound number of flag bits etc.

* jk/commit-info-slab:
  commit-slab: introduce a macro to define a slab for new type
  commit-slab: avoid large realloc
  commit: allow associating auxiliary info on-demand

11 years agolib-rebase: style: use write_script, <<-\EOF
Andrew Pimlott [Mon, 1 Jul 2013 16:23:38 +0000 (09:23 -0700)]
lib-rebase: style: use write_script, <<-\EOF

Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot7500: fix flipped actual/expect
Andrew Pimlott [Mon, 1 Jul 2013 16:20:36 +0000 (09:20 -0700)]
t7500: fix flipped actual/expect

Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agolib-rebase: document exec_ in FAKE_LINES
Andrew Pimlott [Mon, 1 Jul 2013 16:20:35 +0000 (09:20 -0700)]
lib-rebase: document exec_ in FAKE_LINES

Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint'
Junio C Hamano [Sun, 30 Jun 2013 22:45:43 +0000 (15:45 -0700)]
Merge branch 'maint'

* maint:
  Start preparing for 1.8.3.3
  check-ignore doc: fix broken link to ls-files page
  test: spell 'ls-files --delete' option correctly in test descriptions

11 years agoUpdate draft release notes to 1.8.4
Junio C Hamano [Sun, 30 Jun 2013 22:45:26 +0000 (15:45 -0700)]
Update draft release notes to 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'mh/ref-races'
Junio C Hamano [Sun, 30 Jun 2013 22:40:01 +0000 (15:40 -0700)]
Merge branch 'mh/ref-races'

"git pack-refs" that races with new ref creation or deletion have
been susceptible to lossage of refs under right conditions, which
has been tightened up.

* mh/ref-races:
  for_each_ref: load all loose refs before packed refs
  get_packed_ref_cache: reload packed-refs file when it changes
  add a stat_validity struct
  Extract a struct stat_data from cache_entry
  packed_ref_cache: increment refcount when locked
  do_for_each_entry(): increment the packed refs cache refcount
  refs: manage lifetime of packed refs cache via reference counting
  refs: implement simple transactions for the packed-refs file
  refs: wrap the packed refs cache in a level of indirection
  pack_refs(): split creation of packed refs and entry writing
  repack_without_ref(): split list curation and entry writing

11 years agoMerge branch 'ap/diff-ignore-blank-lines'
Junio C Hamano [Sun, 30 Jun 2013 22:39:53 +0000 (15:39 -0700)]
Merge branch 'ap/diff-ignore-blank-lines'

"git diff" learned a mode that ignores hunks whose change consists
only of additions and removals of blank lines, which is the same as
"diff -B" (ignore blank lines) of GNU diff.

* ap/diff-ignore-blank-lines:
  diff: add --ignore-blank-lines option

11 years agoMerge branch 'mh/loose-refs-race-with-pack-ref'
Junio C Hamano [Sun, 30 Jun 2013 22:39:47 +0000 (15:39 -0700)]
Merge branch 'mh/loose-refs-race-with-pack-ref'

We read loose and packed rerferences in two steps, but after
deciding to read a loose ref but before actually opening it to read
it, another process racing with us can unlink it, which would cause
us to barf. Update the codepath to retry when such a race is
detected.

* mh/loose-refs-race-with-pack-ref:
  resolve_ref_unsafe(): close race condition reading loose refs
  resolve_ref_unsafe(): handle the case of an SHA-1 within loop
  resolve_ref_unsafe(): extract function handle_missing_loose_ref()

11 years agoMerge branch 'nk/name-rev-abbreviated-refs'
Junio C Hamano [Sun, 30 Jun 2013 22:39:41 +0000 (15:39 -0700)]
Merge branch 'nk/name-rev-abbreviated-refs'

"git name-rev --refs=tags/v*" were forbidden, which was a bit
inconvenient (you had to give a pattern to match refs fully, like
--refs=refs/tags/v*).

* nk/name-rev-abbreviated-refs:
  name-rev: allow to specify a subpath for --refs option

11 years agoMerge branch 'jk/submodule-subdirectory-ok'
Junio C Hamano [Sun, 30 Jun 2013 22:39:35 +0000 (15:39 -0700)]
Merge branch 'jk/submodule-subdirectory-ok'

Allow various subcommands of "git submodule" to be run not from the
top of the working tree of the superproject.

* jk/submodule-subdirectory-ok:
  submodule: drop the top-level requirement
  rev-parse: add --prefix option
  submodule: show full path in error message
  t7403: add missing && chaining
  t7403: modernize style
  t7401: make indentation consistent

11 years agoStart preparing for 1.8.3.3
Junio C Hamano [Sun, 30 Jun 2013 22:36:03 +0000 (15:36 -0700)]
Start preparing for 1.8.3.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'fc/macos-x-clipped-write' into maint
Junio C Hamano [Sun, 30 Jun 2013 22:33:40 +0000 (15:33 -0700)]
Merge branch 'fc/macos-x-clipped-write' into maint

Mac OS X does not like to write(2) more than INT_MAX number of
bytes; work it around by chopping write(2) into smaller pieces.

* fc/macos-x-clipped-write:
  compate/clipped-write.c: large write(2) fails on Mac OS X/XNU

11 years agoMerge branch 'da/darwin' into maint
Junio C Hamano [Sun, 30 Jun 2013 22:33:13 +0000 (15:33 -0700)]
Merge branch 'da/darwin' into maint

Newer MacOS X encourages the programs to compile and link with their
CommonCrypto, not with OpenSSL.

* da/darwin:
  imap-send: eliminate HMAC deprecation warnings on Mac OS X
  cache.h: eliminate SHA-1 deprecation warnings on Mac OS X
  Makefile: add support for Apple CommonCrypto facility
  Makefile: fix default regex settings on Darwin

11 years agocheck-ignore doc: fix broken link to ls-files page
Ramkumar Ramachandra [Sun, 30 Jun 2013 12:05:28 +0000 (17:35 +0530)]
check-ignore doc: fix broken link to ls-files page

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agotest: spell 'ls-files --delete' option correctly in test descriptions
SZEDER Gábor [Sun, 30 Jun 2013 10:45:25 +0000 (12:45 +0200)]
test: spell 'ls-files --delete' option correctly in test descriptions

The option is spelled '--deleted'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with 1.8.3.2
Junio C Hamano [Fri, 28 Jun 2013 21:57:09 +0000 (14:57 -0700)]
Sync with 1.8.3.2

11 years agoGit 1.8.3.2
Junio C Hamano [Fri, 28 Jun 2013 21:56:30 +0000 (14:56 -0700)]
Git 1.8.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoconfigure: fix option help message for --disable-pthreads
Stefano Lattarini [Fri, 28 Jun 2013 17:19:42 +0000 (19:19 +0200)]
configure: fix option help message for --disable-pthreads

The configure option to disable threading is '--disable-pthreads',
not '--without-pthreads'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nd/clone-connectivity-shortcut' (early part) into maint
Junio C Hamano [Fri, 28 Jun 2013 17:00:00 +0000 (10:00 -0700)]
Merge branch 'nd/clone-connectivity-shortcut' (early part) into maint

Cloning with "git clone --depth N" while fetch.fsckobjects (or
transfer.fsckobjects) is set to true did not tell the cut-off points
of the shallow history to the process that validates the objects and
the history received, causing the validation to fail.

* 'nd/clone-connectivity-shortcut' (early part):
  fetch-pack: prepare updated shallow file before fetching the pack
  clone: let the user know when check_everything_connected is run

11 years agoMerge branch 'maint'
Junio C Hamano [Thu, 27 Jun 2013 21:48:54 +0000 (14:48 -0700)]
Merge branch 'maint'

* maint:
  Start preparing for 1.8.3.2

11 years agoStart preparing for 1.8.3.2
Junio C Hamano [Thu, 27 Jun 2013 21:48:14 +0000 (14:48 -0700)]
Start preparing for 1.8.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'ks/difftool-dir-diff-copy-fix' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:22 +0000 (14:38 -0700)]
Merge branch 'ks/difftool-dir-diff-copy-fix' into maint

* ks/difftool-dir-diff-copy-fix:
  difftool --dir-diff: allow changing any clean working tree file

11 years agoMerge branch 'rr/push-head' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:17 +0000 (14:38 -0700)]
Merge branch 'rr/push-head' into maint

* rr/push-head:
  push: make push.default = current use resolved HEAD
  push: fail early with detached HEAD and current
  push: factor out the detached HEAD error message

11 years agoMerge branch 'fc/show-branch-in-rebase-am' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:16 +0000 (14:38 -0700)]
Merge branch 'fc/show-branch-in-rebase-am' into maint

* fc/show-branch-in-rebase-am:
  prompt: fix for simple rebase

11 years agoMerge branch 'tg/maint-zsh-svn-remote-prompt' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:14 +0000 (14:38 -0700)]
Merge branch 'tg/maint-zsh-svn-remote-prompt' into maint

* tg/maint-zsh-svn-remote-prompt:
  prompt: fix show upstream with svn and zsh

11 years agoMerge branch 'nd/urls-doc-no-file-hyperlink-fix' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:12 +0000 (14:38 -0700)]
Merge branch 'nd/urls-doc-no-file-hyperlink-fix' into maint

* nd/urls-doc-no-file-hyperlink-fix:
  urls.txt: avoid auto converting to hyperlink

11 years agoMerge branch 'tr/push-no-verify-doc' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:09 +0000 (14:38 -0700)]
Merge branch 'tr/push-no-verify-doc' into maint

* tr/push-no-verify-doc:
  Document push --no-verify

11 years agoMerge branch 'rs/commit-m-no-edit' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:07 +0000 (14:38 -0700)]
Merge branch 'rs/commit-m-no-edit' into maint

* rs/commit-m-no-edit:
  commit: don't start editor if empty message is given with -m

11 years agoMerge branch 'jc/strbuf-branchname-fix' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:38:02 +0000 (14:38 -0700)]
Merge branch 'jc/strbuf-branchname-fix' into maint

* jc/strbuf-branchname-fix:
  strbuf_branchname(): do not double-expand @{-1}~22

11 years agoMerge branch 'mk/combine-diff-context-horizon-fix' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:37:55 +0000 (14:37 -0700)]
Merge branch 'mk/combine-diff-context-horizon-fix' into maint

* mk/combine-diff-context-horizon-fix:
  combine-diff.c: Fix output when changes are exactly 3 lines apart

11 years agoMerge branch 'kb/ancestry-path-threedots' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:37:52 +0000 (14:37 -0700)]
Merge branch 'kb/ancestry-path-threedots' into maint

* kb/ancestry-path-threedots:
  revision.c: treat A...B merge bases as if manually specified
  t6019: demonstrate --ancestry-path A...B breakage

11 years agoMerge branch 'jk/subtree-do-not-push-if-split-fails' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:37:44 +0000 (14:37 -0700)]
Merge branch 'jk/subtree-do-not-push-if-split-fails' into maint

* jk/subtree-do-not-push-if-split-fails:
  contrib/subtree: don't delete remote branches if split fails

11 years agoMerge branch 'mh/fetch-into-shallow' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:37:41 +0000 (14:37 -0700)]
Merge branch 'mh/fetch-into-shallow' into maint

* mh/fetch-into-shallow:
  t5500: add test for fetching with an unknown 'shallow'
  upload-pack: ignore 'shallow' lines with unknown obj-ids

11 years agoMerge branch 'jh/checkout-auto-tracking' into maint
Junio C Hamano [Thu, 27 Jun 2013 21:37:21 +0000 (14:37 -0700)]
Merge branch 'jh/checkout-auto-tracking' into maint

* jh/checkout-auto-tracking:
  glossary: Update and rephrase the definition of a remote-tracking branch
  branch.c: Validate tracking branches with refspecs instead of refs/remotes/*
  t9114.2: Don't use --track option against "svn-remote"-tracking branches
  t7201.24: Add refspec to keep --track working
  t3200.39: tracking setup should fail if there is no matching refspec.
  checkout: Use remote refspecs when DWIMming tracking branches
  t2024: Show failure to use refspec when DWIMming remote branch names
  t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'

11 years agoUpdate draft release notes to 1.8.4
Junio C Hamano [Thu, 27 Jun 2013 21:32:59 +0000 (14:32 -0700)]
Update draft release notes to 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jk/add-i-custom-diff-algo'
Junio C Hamano [Thu, 27 Jun 2013 21:30:07 +0000 (14:30 -0700)]
Merge branch 'jk/add-i-custom-diff-algo'

* jk/add-i-custom-diff-algo:
  add -i: add extra options at the right place in "diff" command line
  add--interactive: respect diff.algorithm

11 years agoMerge branch 'rr/cherry-pick-fast-forward-reflog-message'
Junio C Hamano [Thu, 27 Jun 2013 21:29:59 +0000 (14:29 -0700)]
Merge branch 'rr/cherry-pick-fast-forward-reflog-message'

The reflog message created when "git cherry-pick" fast-forwarded
did not say anything but "cherry-pick", but it now says
"cherry-pick: fast-forward".

* rr/cherry-pick-fast-forward-reflog-message:
  sequencer: write useful reflog message for fast-forward

11 years agoMerge branch 'mt/send-email-cc-match-fix'
Junio C Hamano [Thu, 27 Jun 2013 21:29:57 +0000 (14:29 -0700)]
Merge branch 'mt/send-email-cc-match-fix'

Logic used by git-send-email to suppress cc mishandled names that
need RFC2047 quoting.

* mt/send-email-cc-match-fix:
  send-email: sanitize author when writing From line
  send-email: add test for duplicate utf8 name

11 years agoMerge branch 'jk/pull-into-dirty-unborn'
Junio C Hamano [Thu, 27 Jun 2013 21:29:52 +0000 (14:29 -0700)]
Merge branch 'jk/pull-into-dirty-unborn'

"git pull" into nothing trashed "local changes" that were in the
index, and this avoids it.

* jk/pull-into-dirty-unborn:
  pull: merge into unborn by fast-forwarding from empty tree
  pull: update unborn branch tip after index

11 years agoMerge branch 'bc/http-keep-memory-given-to-curl'
Junio C Hamano [Thu, 27 Jun 2013 21:29:49 +0000 (14:29 -0700)]
Merge branch 'bc/http-keep-memory-given-to-curl'

Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.

* bc/http-keep-memory-given-to-curl:
  http.c: don't rewrite the user:passwd string multiple times

11 years agoMerge branch 'bc/checkout-tracking-name-plug-leak'
Junio C Hamano [Thu, 27 Jun 2013 21:29:46 +0000 (14:29 -0700)]
Merge branch 'bc/checkout-tracking-name-plug-leak'

Plug a small leak in checkout.

* bc/checkout-tracking-name-plug-leak:
  t/t9802: explicitly name the upstream branch to use as a base
  builtin/checkout.c: don't leak memory in check_tracking_name

11 years agoMerge branch 'rr/rebase-stash-store'
Junio C Hamano [Thu, 27 Jun 2013 21:29:41 +0000 (14:29 -0700)]
Merge branch 'rr/rebase-stash-store'

Finishing touches for the "git rebase --autostash" feature
introduced earlier.

* rr/rebase-stash-store:
  rebase: use 'git stash store' to simplify logic
  stash: introduce 'git stash store'
  stash: simplify option parser for create
  stash doc: document short form -p in synopsis
  stash doc: add a warning about using create

11 years agorebase -i: handle fixup! fixup! in --autosquash
Andrew Pimlott [Thu, 27 Jun 2013 19:26:31 +0000 (12:26 -0700)]
rebase -i: handle fixup! fixup! in --autosquash

In rebase -i --autosquash, ignore all "fixup! " or "squash! " after the
first.  This supports the case when a git commit --fixup/--squash referred
to an earlier fixup/squash instead of the original commit (whether
intentionally, as when the user expressly meant to note that the commit
fixes an earlier fixup; or inadvertently, as when the user meant to refer to
the original commit with :/msg; or out of laziness, as when the user could
remember how to refer to the fixup but not the original).

In the todo list, the full commit message is preserved, in case it provides
useful cues to the user.  A test helper set_cat_todo_editor is introduced to
check this.

Helped-by: Thomas Rast <trast@inf.ethz.ch>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoam: replace uses of --resolved with --continue
Kevin Bracey [Wed, 26 Jun 2013 20:06:41 +0000 (23:06 +0300)]
am: replace uses of --resolved with --continue

git am was previously modified to provide --continue for consistency
with rebase, merge etc, and the documentation changed to showing
--continue as the primary form.

Complete the work by replacing remaining uses of --resolved by
--continue, most notably in suggested command reminders.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.4
Junio C Hamano [Wed, 26 Jun 2013 22:10:17 +0000 (15:10 -0700)]
Update draft release notes to 1.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'tr/maint-apply-non-git-patch-parsefix'
Junio C Hamano [Wed, 26 Jun 2013 22:08:09 +0000 (15:08 -0700)]
Merge branch 'tr/maint-apply-non-git-patch-parsefix'

Fix for the codepath to parse patches that add new files, generated
by programs other than Git.  THis is an old breakage in v1.7.11 and
will need to be merged down to the maintanance tracks.

* tr/maint-apply-non-git-patch-parsefix:
  apply: carefully strdup a possibly-NULL name

11 years agoMerge branch 'ys/cygstart'
Junio C Hamano [Wed, 26 Jun 2013 22:08:01 +0000 (15:08 -0700)]
Merge branch 'ys/cygstart'

On Cygwin, recognize "cygstart" as a possible way to start a web
browser (used in "help -w" and "instaweb" among others).

* ys/cygstart:
  web--browse: support /usr/bin/cygstart on Cygwin

11 years agoMerge branch 'wk/doc-git-has-grown'
Junio C Hamano [Wed, 26 Jun 2013 22:07:55 +0000 (15:07 -0700)]
Merge branch 'wk/doc-git-has-grown'

* wk/doc-git-has-grown:
  user-manual: Update download size for Git and the kernel

11 years agoMerge branch 'vl/typofix'
Junio C Hamano [Wed, 26 Jun 2013 22:07:52 +0000 (15:07 -0700)]
Merge branch 'vl/typofix'

* vl/typofix:
  random typofixes (committed missing a 't', successful missing an 's')

11 years agoMerge branch 'ph/builtin-srcs-are-in-subdir-these-days'
Junio C Hamano [Wed, 26 Jun 2013 22:07:48 +0000 (15:07 -0700)]
Merge branch 'ph/builtin-srcs-are-in-subdir-these-days'

* ph/builtin-srcs-are-in-subdir-these-days:
  fix "builtin-*" references to be "builtin/*"

11 years agoMerge branch 'mm/merge-in-dirty-worktree-doc'
Junio C Hamano [Wed, 26 Jun 2013 22:07:43 +0000 (15:07 -0700)]
Merge branch 'mm/merge-in-dirty-worktree-doc'

* mm/merge-in-dirty-worktree-doc:
  Documentation/git-merge.txt: weaken warning about uncommited changes

11 years agoMerge branch 'kb/diff-blob-blob-doc'
Junio C Hamano [Wed, 26 Jun 2013 22:07:41 +0000 (15:07 -0700)]
Merge branch 'kb/diff-blob-blob-doc'

* kb/diff-blob-blob-doc:
  Documentation: Move "git diff <blob> <blob>"

11 years agoMerge branch 'mm/push-force-is-dangerous'
Junio C Hamano [Wed, 26 Jun 2013 22:07:38 +0000 (15:07 -0700)]
Merge branch 'mm/push-force-is-dangerous'

* mm/push-force-is-dangerous:
  Documentation/git-push.txt: explain better cases where --force is dangerous

11 years agoMerge branch 'fg/submodule-non-ascii-path'
Junio C Hamano [Wed, 26 Jun 2013 22:07:35 +0000 (15:07 -0700)]
Merge branch 'fg/submodule-non-ascii-path'

Many "git submodule" operations do not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
  t7400: test of UTF-8 submodule names pass under Mac OS
  handle multibyte characters in name

11 years agodocumentation: add git:// transport security notice
Fraser Tweedale [Wed, 26 Jun 2013 05:53:59 +0000 (15:53 +1000)]
documentation: add git:// transport security notice

The fact that the git:// transport does no authentication is easily
overlooked.  For example, DNS poisoning may result in fetching from
somewhere that was not intended.

Add a brief security notice to the "GIT URLS" section
of the documentation stating that the git transport should be used
with caution on unsecured networks.

Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-prompt.sh: add missing information in comments
Eduardo R. D'Avila [Wed, 26 Jun 2013 03:05:17 +0000 (00:05 -0300)]
git-prompt.sh: add missing information in comments

Mention that the command below is needed for prompt
in ZSH with PS1:
  setopt PROMPT_SUBST

Rephrase some parts that mention only the "current branch name"
being displayed in the prompt. Replace it by stating that
the "repository status" is displayed.

Make it clear that colored prompt is only available
in PROMPT_COMMAND/precmd mode.

With-suggestions-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-prompt.sh: do not print duplicate clean color code
Eduardo R. D'Avila [Wed, 26 Jun 2013 03:05:16 +0000 (00:05 -0300)]
git-prompt.sh: do not print duplicate clean color code

Do not print a duplicate clean color code when there
is no other indicators other than the current branch
in colored prompt.

Acked-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot9903: remove redundant tests
Eduardo R. D'Avila [Wed, 26 Jun 2013 03:05:15 +0000 (00:05 -0300)]
t9903: remove redundant tests

After refactoring __git_ps1_colorize_gitstring, codepaths for bash and zsh
became mostly common and tests for bash and zsh became redundant.

Remove tests for zsh. Keep one minimal test that stress the difference
in codepaths for bash and zsh.

Suggested-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-prompt.sh: refactor colored prompt code
Eduardo R. D'Avila [Wed, 26 Jun 2013 03:05:14 +0000 (00:05 -0300)]
git-prompt.sh: refactor colored prompt code

__git_ps1_colorize_gitstring() sets color codes and
builds the prompt gitstring. It has duplicated code
to handle color codes for bash and zsh shells.
__git_ps1() also has duplicated logic to build the
prompt gitstring.

Remove duplication of logic to build gitstring in
__git_ps1_colorize_gitstring() and __git_ps1().

Leave in __git_ps1_colorize_gitstring() only logic
to set color codes.

Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot9903: add tests for git-prompt pcmode
Eduardo R. D'Avila [Wed, 26 Jun 2013 03:05:13 +0000 (00:05 -0300)]
t9903: add tests for git-prompt pcmode

git-prompt.sh lacks tests for PROMPT_COMMAND mode.

Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh

Having these tests enables an upcoming refactor in
a safe way.

Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocolumn doc: rewrite documentation for column.ui
Ramkumar Ramachandra [Tue, 25 Jun 2013 15:54:36 +0000 (21:24 +0530)]
column doc: rewrite documentation for column.ui

The configuration option column.ui is very poorly documented, and it is
unclear what the defaults are, and what option can be combined with
what.  Rewrite it by splitting up the options into three sections
clearly showing how COL_ENABLED, COL_LAYOUT_MASK, and COL_DENSE work.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years ago.mailmap: Map "H.Merijn Brand" to "H. Merijn Brand"
Stefan Beller [Tue, 25 Jun 2013 16:39:15 +0000 (18:39 +0200)]
.mailmap: Map "H.Merijn Brand" to "H. Merijn Brand"

This patch was created by searching for duplicates of email addresses
in the shortlog by
    git shortlog -sne |awk '{ print $NF }' |sort |uniq -d

This will yield all email addresses, which are found multiple times within
the shortlog. We can assume that commiters having the same email address
are indeed the same person.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.4
Junio C Hamano [Mon, 24 Jun 2013 20:53:03 +0000 (13:53 -0700)]
Update draft release notes to 1.8.4

For now, comment out the description on two "git status" UI
configuration, until the reverted topic can be resurrected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'rr/am-quit-empty-then-abort-fix'
Junio C Hamano [Mon, 24 Jun 2013 20:49:00 +0000 (13:49 -0700)]
Merge branch 'rr/am-quit-empty-then-abort-fix'

Recent "rebase --autostash" update made it impossible to recover
with "git am --abort" from a repository where "git am" without mbox
was run by mistake and then was killed with "^C".

* rr/am-quit-empty-then-abort-fix:
  t/am: use test_path_is_missing() where appropriate
  am: handle stray $dotest directory

11 years agoMerge branch 'rt/cherry-pick-continue-advice-in-status'
Junio C Hamano [Mon, 24 Jun 2013 20:48:57 +0000 (13:48 -0700)]
Merge branch 'rt/cherry-pick-continue-advice-in-status'

* rt/cherry-pick-continue-advice-in-status:
  wt-status: give better advice when cherry-pick is in progress

11 years agoMerge branch 'nk/config-local-doc'
Junio C Hamano [Mon, 24 Jun 2013 20:48:55 +0000 (13:48 -0700)]
Merge branch 'nk/config-local-doc'

* nk/config-local-doc:
  config: Add description of --local option

11 years agoMerge branch 'jk/mergetool-lib-refactor'
Junio C Hamano [Mon, 24 Jun 2013 20:48:53 +0000 (13:48 -0700)]
Merge branch 'jk/mergetool-lib-refactor'

Code cleanup.

* jk/mergetool-lib-refactor:
  mergetool--lib: refactor {diff,merge}_cmd logic

11 years agoMerge branch 'jk/doc-build-move-infordir-def'
Junio C Hamano [Mon, 24 Jun 2013 20:48:51 +0000 (13:48 -0700)]
Merge branch 'jk/doc-build-move-infordir-def'

Makefile cleanup.

* jk/doc-build-move-infordir-def:
  Documentation/Makefile: move infodir to be with other '*dir's
  Documentation/Makefile: fix spaces around assignments

11 years agoMerge branch 'fg/submodule-fixup'
Junio C Hamano [Mon, 24 Jun 2013 20:48:50 +0000 (13:48 -0700)]
Merge branch 'fg/submodule-fixup'

Code cleanup.

* fg/submodule-fixup:
  git-submodule.sh: remove duplicate call to set_rev_name

11 years agoMerge branch 'dk/version-gen-gitdir'
Junio C Hamano [Mon, 24 Jun 2013 20:48:48 +0000 (13:48 -0700)]
Merge branch 'dk/version-gen-gitdir'

Allow packaging a tarball in a working tree with $GIT_DIR set elsewhere.

* dk/version-gen-gitdir:
  GIT-VERSION-GEN: support non-standard $GIT_DIR path

11 years agoMerge branch 'dk/maint-t5150-dirname'
Junio C Hamano [Mon, 24 Jun 2013 20:48:46 +0000 (13:48 -0700)]
Merge branch 'dk/maint-t5150-dirname'

Fix a test script.

* dk/maint-t5150-dirname:
  tests: allow sha1's as part of the path

11 years agoMerge branch 'rs/unpack-trees-tree-walk-conflict-field'
Junio C Hamano [Mon, 24 Jun 2013 20:48:44 +0000 (13:48 -0700)]
Merge branch 'rs/unpack-trees-tree-walk-conflict-field'

Code clean-up.

* rs/unpack-trees-tree-walk-conflict-field:
  unpack-trees: don't shift conflicts left and right

11 years agoMerge branch 'rr/rebase-sha1-by-string-query'
Junio C Hamano [Mon, 24 Jun 2013 20:48:40 +0000 (13:48 -0700)]
Merge branch 'rr/rebase-sha1-by-string-query'

Allow various commit objects to be given to "git rebase" by ':/look
for this string' syntax, e.g. "git rebase --onto ':/there'".

* rr/rebase-sha1-by-string-query:
  rebase: use peel_committish() where appropriate
  sh-setup: add new peel_committish() helper
  t/rebase: add failing tests for a peculiar revision

11 years agoMerge branch 'mm/rm-coalesce-errors'
Junio C Hamano [Mon, 24 Jun 2013 20:48:35 +0000 (13:48 -0700)]
Merge branch 'mm/rm-coalesce-errors'

Give a single message followed by list of paths from "git rm" to
report multiple paths that cannot be removed.

* mm/rm-coalesce-errors:
  rm: introduce advice.rmHints to shorten messages
  rm: better error message on failure for multiple files

11 years agoMerge branch 'jh/libify-note-handling'
Junio C Hamano [Mon, 24 Jun 2013 20:48:30 +0000 (13:48 -0700)]
Merge branch 'jh/libify-note-handling'

Make it possible to call into copy-notes API from the sequencer code.

* jh/libify-note-handling:
  Move create_notes_commit() from notes-merge.c into notes-utils.c
  Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c
  finish_copy_notes_for_rewrite(): Let caller provide commit message

11 years agoMerge branch 'fc/sequencer-plug-leak'
Junio C Hamano [Mon, 24 Jun 2013 20:48:28 +0000 (13:48 -0700)]
Merge branch 'fc/sequencer-plug-leak'

Plug a small leak in an error codepath.

* fc/sequencer-plug-leak:
  sequencer: avoid leaking message buffer when refusing to create an empty commit
  sequencer: remove useless indentation

11 years agobash prompt: mention that PROMPT_COMMAND mode is faster
SZEDER Gábor [Mon, 24 Jun 2013 00:28:02 +0000 (02:28 +0200)]
bash prompt: mention that PROMPT_COMMAND mode is faster

__git_ps1() is usually added to the prompt inside a command
substitution, imposing the overhead of fork()ing a subshell.  Using
__git_ps1() for $PROMPT_COMMAND is slightly faster, because it avoids
that command substitution.

Mention this in the comments about setting up the git prompt.

The whole series speeds up the bash prompt on Windows/MSysGit
considerably.  Here are some timing results in three scenarios, each
repeated 10 times:

At the top of the work tree, before:

    $ time for i in {0..9} ; do prompt="$(__git_ps1)" ; done

    real    0m1.716s
    user    0m0.301s
    sys     0m0.772s

  After:

    real    0m0.687s
    user    0m0.075s
    sys     0m0.396s

  After, from $PROMPT_COMMAND:

    $ time for i in {0..9} ; do __git_ps1 '\h:\w' '$ ' ; done

    real    0m0.546s
    user    0m0.075s
    sys     0m0.181s

At the top of the work tree, detached head, before:

    real    0m2.574s
    user    0m0.376s
    sys     0m1.207s

  After:

    real    0m1.139s
    user    0m0.151s
    sys     0m0.500s

  After, from $PROMPT_COMMAND:

    real    0m1.030s
    user    0m0.245s
    sys     0m0.336s

In a subdirectory, during rebase, stash status indicator enabled,
before:

    real    0m3.557s
    user    0m0.495s
    sys     0m1.767s

  After:

    real    0m0.717s
    user    0m0.120s
    sys     0m0.300s

  After, from $PROMPT_COMMAND:

    real    0m0.577s
    user    0m0.047s
    sys     0m0.258s

On Linux the speedup ratio is comparable to Windows, but overall it
was about an order of magnitude faster to begin with.  The last case
from above, repeated 100 times, before:

    $ time for i in {0..99} ; do prompt="$(__git_ps1)" ; done

    real    0m2.806s
    user    0m0.180s
    sys     0m0.264s

  After:

    real    0m0.857s
    user    0m0.020s
    sys     0m0.028s

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: avoid command substitution when finalizing gitstring
SZEDER Gábor [Mon, 17 Jun 2013 19:42:55 +0000 (21:42 +0200)]
bash prompt: avoid command substitution when finalizing gitstring

Before setting $PS1, __git_ps1() uses a command substitution to
redirect the output from a printf into a variable.  Spare the overhead
of fork()ing a subshell by using 'printf -v <var>' to directly assign
the output to that variable.

zsh's printf doesn't support the '-v <var>' option, so stick with the
command substitution when under zsh.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: avoid command substitution when checking for untracked files
SZEDER Gábor [Fri, 12 Aug 2011 12:17:12 +0000 (14:17 +0200)]
bash prompt: avoid command substitution when checking for untracked files

When enabled, the bash prompt can indicate the presence of untracked
files with a '%' sign.  __git_ps1() checks for untracked files by running the
'$(git ls-files --others --exclude-standard)' command substitution,
and displays the indicator when there is no output.

Avoid this command substitution by additionally passing
'--error-unmatch *', and checking the command's return value.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: use bash builtins to check stash state
SZEDER Gábor [Fri, 1 Apr 2011 15:47:37 +0000 (17:47 +0200)]
bash prompt: use bash builtins to check stash state

When the environment variable $GIT_PS1_SHOWSTASHSTATE is set
__git_ps1() checks the presence of stashes by running 'git rev-parse
--verify refs/stash'.  This command not only checks that the
'refs/stash' ref exists but also, well, verifies that it's a valid
ref.

However, we don't need to be that thorough for the bash prompt.  We
can omit that verification and only check whether 'refs/stash' exists
or not.  Since 'git pack-refs' never packs 'refs/stash', it's a matter
of checking the existence of a ref file.  Perform this check using
only bash builtins to spare the overhead of fork()+exec()ing a git
process.

Also run 'git pack-refs --all' in the corresponding test to document
that the prompt script depends on 'git pack-refs' not packing
'refs/stash' and to catch possible breakages should this behavior ever
change.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: use bash builtins to check for unborn branch for dirty state
SZEDER Gábor [Mon, 24 Jun 2013 10:49:19 +0000 (12:49 +0200)]
bash prompt: use bash builtins to check for unborn branch for dirty state

When the dirty work tree and index status indicator is enabled,
__git_ps1() checks for changes in the index by running 'git diff-index
--cached --quiet HEAD --' and looking at its exit code.  However, that
makes sense only when HEAD points to a valid commit: on an unborn
branch the failure of said command would be caused by the invalid
HEAD, not by changes in the index.  Therefore, __git_ps1() first
checks for a valid HEAD by running 'git rev-parse --quiet --verify
HEAD'.

Since the previous patch we implicitly check HEAD's validity by
running 'git rev-parse ... --short HEAD', making the dirty status
indicator's 'git rev-parse' check redundant.  It's sufficient to check
for non-emptyness of the variable holding the abbreviated commit
object name, thereby sparing the overhead of fork()+exec()ing a git
process.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: combine 'git rev-parse' for detached head
SZEDER Gábor [Mon, 24 Jun 2013 00:16:02 +0000 (02:16 +0200)]
bash prompt: combine 'git rev-parse' for detached head

When describing a detached HEAD according to the $GIT_PS1_DESCRIBE
environment variable fails, __git_ps1() now runs the '$(git rev-parse
--short HEAD)' command substitution to get the abbreviated detached
HEAD commit object name.  This imposes the overhead of fork()ing a
subshell and fork()+exec()ing a git process.

Avoid this overhead by combining this command substitution with the
"main" 'git rev-parse' execution for getting the path to the .git
directory & co.  This means that we'll look for the abbreviated commit
object name even when it's not necessary, because we're on a branch or
the detached HEAD can be described.  It doesn't matter, however,
because once 'git rev-parse' is up and running to fulfill all those
other queries, the additional overhead of looking for the abbreviated
commit object name is not measurable because it's lost in the noise.

There is a caveat, however, when we are on an unborn branch, because
in that case HEAD doesn't point to a valid commit, hence the query for
the abbreviated commit object name fails.  Therefore, '--short HEAD'
must be the last options to 'git rev-parse' in order to get all the
other necessary information for the prompt even on an unborn branch.
Furthermore, in that case, and in that case only, 'git rev-parse'
doesn't output the last line containing the abbreviated commit object
name, obviously, so we have to take care to only parse it if 'git
rev-parse' exited without any error.

Although there are tests already excercising __git_ps1() on unborn
branches, they all do so implicitly.  Add a test that checks this
explicitly.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: combine 'git rev-parse' executions in the main code path
SZEDER Gábor [Mon, 17 Jun 2013 20:58:42 +0000 (22:58 +0200)]
bash prompt: combine 'git rev-parse' executions in the main code path

There are a couple of '$(git rev-parse --<opt>)' command substitutions
in __git_ps1() and three of them are executed in the main code path:

 - the first to get the path to the .git directory ('--git-dir'),
 - the second to check whether we're inside the .git directory
   ('--is-inside-git-dir'),
 - and the last, depending on the results of the second, either
   * to check whether it's a bare repo ('--is-bare-repository'), or
   * to check whether inside a work tree ('--is-inside-work-tree').

Naturally, this imposes the overhead of fork()ing three subshells and
fork()+exec()ing three git commands.

Combine these four 'git rev-parse' queries into a single one and use
bash parameter expansions to parse the combined output, i.e. to
separate the path to the .git directory from the true/false of
'--is-inside-git-dir', etc.  This way we can eliminate two of the
three subshells and git commands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: use bash builtins to find out current branch
SZEDER Gábor [Thu, 31 Mar 2011 21:41:18 +0000 (23:41 +0200)]
bash prompt: use bash builtins to find out current branch

__git_ps1() runs the '$(git symbolic-ref HEAD)' command substitution
to find out whether we are on a branch and to find out the name of
that branch.  This imposes the overhead of fork()ing a subshell and
fork()+exec()ing a git process.

Since HEAD is in most cases a single-line file and the symbolic ref
format is quite simple to recognize and parse, read and parse it using
only bash builtins, thereby sparing all that fork()+exec() overhead.
Don't display the git prompt if reading HEAD fails, because a readable
HEAD is required for a git repository.  HEAD can also be a symlink
symbolic ref (due to 'core.preferSymlinkRefs'), so use bash builtins
for reading HEAD only when HEAD is not a symlink.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: use bash builtins to find out rebase state
SZEDER Gábor [Thu, 31 Mar 2011 22:25:16 +0000 (00:25 +0200)]
bash prompt: use bash builtins to find out rebase state

During an ongoing interactive rebase __git_ps1() finds out the name of
the rebased branch, the total number of patches and the number of the
current patch by executing a '$(cat .git/rebase-merge/<FILE>)' command
substitution for each.  That is not quite the most efficient way to
read single line single word files, because it imposes the overhead of
fork()ing a subshell and fork()+exec()ing 'cat' several times.

Use the 'read' bash builtin instead to avoid those overheads.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: run 'git rev-parse --git-dir' directly instead of __gitdir()
SZEDER Gábor [Mon, 17 Jun 2013 21:55:16 +0000 (23:55 +0200)]
bash prompt: run 'git rev-parse --git-dir' directly instead of __gitdir()

__git_ps1() finds out the path to the repository by using the
__gitdir() helper function.  __gitdir() is basically just a wrapper
around 'git rev-parse --git-dir', extended with support for
recognizing a remote repository given as argument, to use the path
given on the command line, and with a few shortcuts to recognize a git
repository in cwd or at $GIT_DIR quickly without actually running 'git
rev-parse'.  However, the former two is only necessary for the
completion script but makes no sense for the bash prompt, while the
latter shortcuts are performance optimizations __git_ps1() can do
without (they just avoid the overhead of fork()+exec()ing a git
process).

Run 'git rev-parse --git-dir' directly in __git_ps1(), because it will
allow this patch series to combine several $(git rev-parse ...)
command substitutions in the main code path, and the overall
performance benefit will far outweigh the loss of those few shortcuts
in __gitdir().  Furthermore, since __gitdir() is not needed anymore
for the prompt, remove it from the prompt script finally eliminating
its duplication between the prompt and completion scripts.  Also
remove the comment from the completion script warning about this code
duplication.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
11 years agobash prompt: return early from __git_ps1() when not in a git repository
SZEDER Gábor [Mon, 5 Sep 2011 18:53:37 +0000 (20:53 +0200)]
bash prompt: return early from __git_ps1() when not in a git repository

... to gain one level of indentation for the bulk of the function.

(The patch looks quite unreadable, you'd better check it with 'git
diff -w'.)

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>