Commit graph

32469 commits

Author SHA1 Message Date
Philip Oakley 65f98358c0 builtin/help.c: add --guide option
Logic, but no actions, included.

The --all commands option, if given, will display the list of
available commands.

The --guide option's list of guides will then be displayed.

The common commands list is only displayed if neither option, nor a
command or guide name, is given.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 18:01:31 -07:00
Philip Oakley 15f7d49438 builtin/help.c: split "-a" processing into two
"help -a" (help all) gives the list of available commands and then
further gives hints on the use of "git help".   Separate these into
two steps, because we will add "help -g" (help guides) that want to
also show the overall hints after it is done.

While at it, change the definition of the "-a" option to use OPT_BOOL,
not the deprecated OPT_BOOLEAN.  We do not behave differently when
the user gives the "-a" option multiple times, e.g. "git help -a -a".

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 17:58:24 -07:00
Junio C Hamano 961c5129d5 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 15:14:26 -07:00
Junio C Hamano 66bea733f3 Merge branch 'jk/config-with-empty-section'
Document that "git config --unset" does not remove an empty section
head after removing the last variable in a section, and adding a
new variable does not try to reuse a leftover empty section head.

* jk/config-with-empty-section:
  t1300: document some aesthetic failures of the config editor
2013-04-02 15:10:53 -07:00
Junio C Hamano 68ef16b848 Merge branch 'js/log-gpg'
Teach "show/log" honor gpg.program configuration just like other
parts of the code that use GnuPG.

* js/log-gpg:
  log: read gpg settings for signed commit verification
2013-04-02 15:10:49 -07:00
Junio C Hamano 48799d1c6b Merge branch 'tr/log-tree-optim'
Optimize "log" that shows the difference between the parent and the
child.

* tr/log-tree-optim:
  Avoid loading commits twice in log with diffs
2013-04-02 15:10:46 -07:00
Junio C Hamano 76d1ab30a3 Merge branch 'tb/cygwin-shared-repository'
Cygwin port has a faster-but-lying lstat(2) emulation whose
incorrectness does not matter in practice except for a few
codepaths, and setting permission bits to directories is a codepath
that needs to use a more correct one.

* tb/cygwin-shared-repository:
  Make core.sharedRepository work under cygwin 1.7
2013-04-02 15:09:54 -07:00
Junio C Hamano 37ba4c61d0 Merge branch 'sw/safe-create-leading-dir-race'
* sw/safe-create-leading-dir-race:
  safe_create_leading_directories: fix race that could give a false negative
2013-04-02 15:09:48 -07:00
Junio C Hamano c5f05b2356 Merge branch 'bk/document-commit-tree-S'
* bk/document-commit-tree-S:
  commit-tree: document -S option consistently
2013-04-02 15:09:43 -07:00
Junio C Hamano 5fb7b899fb Merge branch 'jk/no-more-self-assignment'
This started as a topic to reduce "type var = var" self assignment
tricks that were used to squelch "variable used uninitialized perhaps?"
warning from some compilers, but resulted in rewriting logic with
a version that is simpler and easier to understand for humans.

* jk/no-more-self-assignment:
  match-trees: simplify score_trees() using tree_entry()
  submodule: clarify logic in show_submodule_summary
2013-04-02 15:09:35 -07:00
Junio C Hamano cc3e4eba72 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 09:24:56 -07:00
Junio C Hamano b442731638 Merge branch 'maint'
* maint:
  Update draft release notes to 1.8.2.1
2013-04-01 09:23:30 -07:00
Junio C Hamano 40a0f842da Update draft release notes to 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 09:23:05 -07:00
Junio C Hamano b76a9e1648 Merge branch 'ap/maint-diff-rename-avoid-overlap' into maint
* ap/maint-diff-rename-avoid-overlap:
  tests: make sure rename pretty print works
  diff: prevent pprint_rename from underrunning input
  diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-01 09:19:47 -07:00
Junio C Hamano 5753e1709e Merge branch 'rr/tests-dedup-test-config' into maint
* rr/tests-dedup-test-config:
  t4018,7810,7811: remove test_config() redefinition
2013-04-01 09:19:42 -07:00
Junio C Hamano 432930bd33 Merge branch 'yd/doc-is-in-asciidoc' into maint
* yd/doc-is-in-asciidoc:
  CodingGuidelines: our documents are in AsciiDoc
2013-04-01 09:19:40 -07:00
Junio C Hamano ab24e7521c Merge branch 'yd/doc-merge-annotated-tag' into maint
* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-04-01 09:19:37 -07:00
Junio C Hamano fec274b01f Merge branch 'tb/document-status-u-tradeoff' into maint
* tb/document-status-u-tradeoff:
  status: advise to consider use of -u when read_directory takes too long
  git status: document trade-offs in choosing parameters to the -u option
2013-04-01 09:19:30 -07:00
Junio C Hamano 41e603af58 Merge branch 'da/downcase-u-in-usage' into maint
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-04-01 09:19:04 -07:00
Junio C Hamano 1d066c58ee Merge branch 'nd/index-pack-threaded-fixes'
"index-pack --verify-stat" used a few counters outside protection
of mutex, possibly showing incorrect numbers.

* nd/index-pack-threaded-fixes:
  index-pack: guard nr_resolved_deltas reads by lock
  index-pack: protect deepest_delta in multithread code
2013-04-01 09:06:23 -07:00
Junio C Hamano ed8852c286 Merge branch 'jk/index-pack-correct-depth-fix'
"index-pack --fix-thin" used uninitialize value to compute delta
depths of objects it appends to the resulting pack.

* jk/index-pack-correct-depth-fix:
  index-pack: always zero-initialize object_entry list
2013-04-01 09:06:19 -07:00
Junio C Hamano ca54e43cf2 Merge branch 'jn/push-tests'
Update t5516 with style fixes.

* jn/push-tests:
  push test: rely on &&-chaining instead of 'if bad; then echo Oops; fi'
  push test: simplify check of push result
  push test: use test_config when appropriate
2013-04-01 09:06:15 -07:00
Junio C Hamano afc2e81247 Merge branch 'nd/branch-show-rebase-bisect-state'
Add a bit more information to "git status" during a rebase/bisect
session.

* nd/branch-show-rebase-bisect-state:
  status, branch: fix the misleading "bisecting" message
  branch: show more information when HEAD is detached
  status: show more info than "currently not on any branch"
  wt-status: move wt_status_get_state() out to wt_status_print()
  wt-status: split wt_status_state parsing function out
  wt-status: move strbuf into read_and_strip_branch()
2013-04-01 09:05:45 -07:00
Junio C Hamano 6d37c162bb Merge branch 'jc/nobody-sets-src-peer-ref'
Dead code removal.

* jc/nobody-sets-src-peer-ref:
  match_push_refs(): nobody sets src->peer_ref anymore
2013-04-01 09:05:35 -07:00
Junio C Hamano b2fb3911ea Merge branch 'jc/remove-export-from-config-mak-in'
Stop exporting mandir that used to be exported only when
config.mak.autogen was used.  It would have broken installation of
manpages (but not other documentation formats).

* jc/remove-export-from-config-mak-in:
  Fix `make install` when configured with autoconf
  Makefile: do not export mandir/htmldir/infodir
  config.mak.in: remove unused definitions
2013-04-01 09:00:02 -07:00
Junio C Hamano c044bed8f0 Merge branch 'kb/name-hash'
The code to keep track of what directory names are known to Git on
platforms with case insensitive filesystems can get confused upon
a hash collision between these pathnames and looped forever.

* kb/name-hash:
  name-hash.c: fix endless loop with core.ignorecase=true
2013-04-01 08:59:53 -07:00
Junio C Hamano e81890548c Merge branch 'jk/common-make-variables-export-safety'
Make the three variables safer to be exported to submakes by
ensuring that they are full paths so that they can be used as
installation location.

* jk/common-make-variables-export-safety:
  Makefile: make mandir, htmldir and infodir absolute
2013-04-01 08:59:47 -07:00
Junio C Hamano e013bdab0f Merge branch 'jk/pkt-line-cleanup'
Clean up pkt-line API, implementation and its callers to make them
more robust.

* jk/pkt-line-cleanup:
  do not use GIT_TRACE_PACKET=3 in tests
  remote-curl: always parse incoming refs
  remote-curl: move ref-parsing code up in file
  remote-curl: pass buffer straight to get_remote_heads
  teach get_remote_heads to read from a memory buffer
  pkt-line: share buffer/descriptor reading implementation
  pkt-line: provide a LARGE_PACKET_MAX static buffer
  pkt-line: move LARGE_PACKET_MAX definition from sideband
  pkt-line: teach packet_read_line to chomp newlines
  pkt-line: provide a generic reading function with options
  pkt-line: drop safe_write function
  pkt-line: move a misplaced comment
  write_or_die: raise SIGPIPE when we get EPIPE
  upload-archive: use argv_array to store client arguments
  upload-archive: do not copy repo name
  send-pack: prefer prefixcmp over memcmp in receive_status
  fetch-pack: fix out-of-bounds buffer offset in get_ack
  upload-pack: remove packet debugging harness
  upload-pack: do not add duplicate objects to shallow list
  upload-pack: use get_sha1_hex to parse "shallow" lines
2013-04-01 08:59:37 -07:00
Junio C Hamano 900c8ecb5c Merge branch 'bc/append-signed-off-by'
Consolidate codepaths that inspect log-message-to-be and decide to
add a new Signed-off-by line in various commands.

* bc/append-signed-off-by:
  git-commit: populate the edit buffer with 2 blank lines before s-o-b
  Unify appending signoff in format-patch, commit and sequencer
  format-patch: update append_signoff prototype
  t4014: more tests about appending s-o-b lines
  sequencer.c: teach append_signoff to avoid adding a duplicate newline
  sequencer.c: teach append_signoff how to detect duplicate s-o-b
  sequencer.c: always separate "(cherry picked from" from commit body
  sequencer.c: require a conforming footer to be preceded by a blank line
  sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
  t/t3511: add some tests of 'cherry-pick -s' functionality
  t/test-lib-functions.sh: allow to specify the tag name to test_commit
  commit, cherry-pick -s: remove broken support for multiline rfc2822 fields
  sequencer.c: rework search for start of footer to improve clarity
2013-04-01 08:59:24 -07:00
Junio C Hamano f161fb041e Merge branch 'sr/am-show-final-message-in-applying-indicator'
In addition to the case where the user edits the log message with
the "e)dit" option of "am -i", replace the "Applying: this patch"
message with the final log message contents after applymsg hook
munges it.

* sr/am-show-final-message-in-applying-indicator:
  git-am: show the final log message on "Applying:" indicator
2013-04-01 08:59:18 -07:00
Junio C Hamano 0cb24fe86e Merge branch 'rr/test-3200-style'
Churns.

* rr/test-3200-style:
  t3200 (branch): modernize style
2013-04-01 08:59:14 -07:00
Junio C Hamano a32a0c29df Merge branch 'maint'
* maint:
  cat-file: Fix an gcc -Wuninitialized warning
  fast-import: Fix an gcc -Wuninitialized warning
2013-03-31 19:27:54 -07:00
Ramsay Jones 803a777942 cat-file: Fix an gcc -Wuninitialized warning
After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning
hacks", 21-03-2013) removed a gcc specific hack, older versions of
gcc now issue an "'contents' might be used uninitialized" warning.
In order to suppress the warning, we simply initialize the variable
to NULL in it's declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29 23:47:00 -07:00
Ramsay Jones 0a34594c83 fast-import: Fix an gcc -Wuninitialized warning
Commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks",
21-03-2013) removed a gcc hack that suppressed an "might be used
uninitialized" warning issued by older versions of gcc.

However, commit 3aa99df8 ('fast-import: clarify "inline" logic in
file_change_m', 21-03-2013) addresses an (almost) identical issue
(with very similar code), but includes additional code in it's
resolution. The solution used by this commit, unlike that used by
commit cbfd5e1c, also suppresses the -Wuninitialized warning on
older versions of gcc.

In order to suppress the warning (against the 'oe' symbol) in the
note_change_n() function, we adopt the same solution used by commit
3aa99df8.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29 23:46:55 -07:00
Jeff King 53ca053b30 t1300: document some aesthetic failures of the config editor
The config-editing code used by "git config var value" is
built around the regular config callback parser, whose only
triggerable item is an actual key. As a result, it does not
know anything about section headers, which can result in
unnecessarily ugly output:

  1. When we delete the last key in a section, we should be
     able to delete the section header.

  2. When we add a key into a section, we should be able to
     reuse the same section header, even if that section did
     not have any keys in it already.

Unfortunately, fixing these is not trivial with the current
code. It would involve the config parser recording and
passing back information on each item it finds, including
headers, keys, and even comments (or even better, generating
an actual in-memory parse-tree).

Since these behaviors do not cause any functional problems
(i.e., the resulting config parses as expected, it is just
uglier than one would like), fixing them can wait until
somebody feels like substantially refactoring the parsing
code. In the meantime, let's document them as known issues
with some tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-29 15:13:53 -07:00
Junio C Hamano 631bc94e67 Merge branch 'yd/use-test-config-unconfig'
Bulk-update of the test suite.

* yd/use-test-config-unconfig:
  t5520: use test_config to set/unset git config variables (leftover bits)
  t7600: use test_config to set/unset git config variables
  t7502: remove clear_config
  t7502: use test_config to set/unset git config variables
  t9500: use test_config to set/unset git config variables
  t7508: use test_config to set/unset git config variables
  t7500: use test_config to set/unset git config variables
  t5541: use test_config to set/unset git config variables
  t5520: use test_config to set/unset git config variables
  t4202: use test_config/test_unconfig to set/unset git config variables
  t4034: use test_config/test_unconfig to set/unset git config variables
  t4304: use test_config to set/unset git config variables
  t3400: use test_config to set/unset git config variables
2013-03-28 14:38:27 -07:00
Junio C Hamano 74bd52681d Merge branch 'kk/revwalk-slop-too-many-commit-within-a-second'
Allow the revision "slop" code to look deeper while commits with
exactly the same timestamps come next to each other (which can
often happen after a large "am" and "rebase" session).

* kk/revwalk-slop-too-many-commit-within-a-second:
  Fix revision walk for commits with the same dates
2013-03-28 14:38:25 -07:00
Junio C Hamano 4806c8c5ca Merge branch 'rr/tests-dedup-test-config'
* rr/tests-dedup-test-config:
  t4018,7810,7811: remove test_config() redefinition
2013-03-28 14:38:23 -07:00
Junio C Hamano f893be2712 Merge branch 'yd/doc-is-in-asciidoc'
* yd/doc-is-in-asciidoc:
  CodingGuidelines: our documents are in AsciiDoc
2013-03-28 14:38:20 -07:00
Junio C Hamano f1c8d8338f Merge branch 'yd/doc-merge-annotated-tag'
Document the 1.7.9 feature to merge a signed tag and keep that in
the mergetag header in the resulting commit better.

* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-03-28 14:38:17 -07:00
Junio C Hamano 436b60ce7a Merge branch 'jc/remove-treesame-parent-in-simplify-merges'
The --simplify-merges logic did not cull irrelevant parents from a
merge that is otherwise not interesting with respect to the paths
we are following.

This touches a fairly core part of the revision traversal
infrastructure; even though I think this change is correct, please
report immediately if you find any unintended side effect.

* jc/remove-treesame-parent-in-simplify-merges:
  simplify-merges: drop merge from irrelevant side branch
2013-03-28 14:37:53 -07:00
Junio C Hamano 39c5835dd6 Merge branch 'jk/checkout-attribute-lookup'
Codepath to stream blob object contents directly from the object
store to filesystem did not use the correct path to find conversion
filters when writing to temporary files.

* jk/checkout-attribute-lookup:
  t2003: work around path mangling issue on Windows
  entry: fix filter lookup
  t2003: modernize style
2013-03-28 14:37:46 -07:00
Junio C Hamano 18973d8ac9 Merge branch 'jk/difftool-dir-diff-edit-fix'
"git difftool --dir-diff" made symlinks to working tree files when
preparing a temporary directory structure, so that accidental edits
of these files in the difftool are reflected back to the working
tree, but the logic to decide when to do so was not quite right.

* jk/difftool-dir-diff-edit-fix:
  difftool --dir-diff: symlink all files matching the working tree
  difftool: avoid double slashes in symlink targets
  git-difftool(1): fix formatting of --symlink description
2013-03-28 14:37:22 -07:00
Junio C Hamano d8355e5eae Merge branch 'maint'
* maint:
  git help config: s/insn/instruction/
2013-03-28 14:34:55 -07:00
Junio C Hamano 5e950c2199 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  git help config: s/insn/instruction/
2013-03-28 14:34:07 -07:00
Matthias Krüger 3322ad4284 git help config: s/insn/instruction/
"insn" appears to be an in-code abbreviation and should not appear
in manual/help pages.

Signed-off-by: Matthias Krüger <matthias.krueger@famsik.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 08:53:47 -07:00
Ramkumar Ramachandra 790f282737 t5520: use test_config to set/unset git config variables (leftover bits)
Configuration from test_config does not last beyond the end of the
current test assertion, making each test easier to think about in
isolation.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 08:16:07 -07:00
Thomas Rast d1b9b76734 Avoid loading commits twice in log with diffs
If you run a log with diffs (such as -p, --raw, --stat etc.) the
current code ends up loading many objects twice.  For example, for
'log -3000 -p' my instrumentation said the objects loaded more than
once are distributed as follows:

  2008 blob
  2103 commit
  2678 tree

Fixing blobs and trees will be harder, because those are really used
within the diff engine and need some form of caching.

However, fixing the commits is easy at least at the band-aid level.
They are triggered by log_tree_diff() invoking diff_tree_sha1() on
commits, which duly loads the specified object to dereference it to a
tree.  Since log_tree_diff() knows that it works with commits and they
must have trees, we can simply pass through the trees.

We add some parse_commit() calls.  The ones for the parents are
required; we do not know at this stage if they have been looked at.
The one for the commit itself is pure paranoia, but has about the same
cost as an assertion on commit->object.parsed.

This has a quite dramatic effect on log --raw, though only a
negligible impact on log -p:

Test                      this tree         HEAD
--------------------------------------------------------------------
4000.2: log --raw -3000   0.50(0.43+0.06)   0.54(0.46+0.06) +7.0%***
4000.3: log -p -3000      2.34(2.20+0.13)   2.37(2.22+0.13) +1.2%
--------------------------------------------------------------------
Significance hints:  '.' 0.1  '*' 0.05  '**' 0.01  '***' 0.001

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 07:45:21 -07:00
Jacob Sarvis 6005dbb9bf log: read gpg settings for signed commit verification
"show --show-signature" and "log --show-signature" do not read the
gpg.program setting from git config, even though, commit signing,
tag signing, and tag verification honor it.

Signed-off-by: Jacob Sarvis <jsarvis@openspan.com>
Signed-off-by: Hans Brigman <hbrigman@openspan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 13:57:12 -07:00
Junio C Hamano 8617715cc0 Merge branch 'maint'
* maint:
  More fixes for 1.8.2.1
  merge-tree: fix typo in merge-tree.c::unresolved
  git-commit doc: describe use of multiple `-m` options
  git-pull doc: fix grammo ("conflicts" is plural)
2013-03-27 10:58:07 -07:00