Commit graph

4034 commits

Author SHA1 Message Date
Jonathan Nieder 030149a4dc git --paginate: paginate external commands again
73e25e7c (git --paginate: do not commit pager choice too early,
2010-06-26) failed to take some cases into account.

1b. Builtins that do not use RUN_SETUP (like git config) do
    not find GIT_DIR set correctly when the pager is launched
    from run_builtin().  So the core.pager configuration is
    not honored from subdirectories of the toplevel for them.

4a. External git commands (like git request-pull) relied on the
    early pager launch to take care of handling the -p option.
    Ever since 73e25e7c, they do not honor the -p option at all.

4b. Commands invoked through ! aliases (like ls) were also relying
    on the early pager launch.

Fix (4a) by launching the pager (if requested) before running such a
“dashed external”.  For simplicity, this still does not search for a
.git directory before running the external command; when run from a
subdirectory of the toplevel, therefore, the “[core] pager”
configuration is still not honored.

Fix (4b) by launching pager if requested before carrying out such an
alias.  Actually doing this has no effect, since the pager (if any)
would have already been launched in a failed attempt to try a
dashed external first.  The choice-of-pager-not-honored-from-
subdirectory bug still applies here, too.

(1b) is not a regression.  There is no need to fix it yet.

Noticed by Junio.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 16:07:34 -07:00
Nguyễn Thái Ngọc Duy 73e25e7cc8 git --paginate: do not commit pager choice too early
When git is passed the --paginate option, starting up a pager requires
deciding what pager to start, which requires access to the core.pager
configuration.

At the relevant moment, the repository has not been searched for yet.
Attempting to access the configuration at this point results in
git_dir being set to .git [*], which is almost certainly not what was
wanted.  In particular, when run from a subdirectory of the toplevel,
git --paginate does not respect the core.pager setting from the
current repository.

[*] unless GIT_DIR or GIT_CONFIG is set

So delay the pager startup when possible:

1. run_argv() already commits pager choice inside run_builtin() if a
   command is found.  For commands that use RUN_SETUP, waiting until
   then fixes the problem described above: once git knows where to
   look, it happily respects the core.pager setting.

2. list_common_cmds_help() prints out 29 lines and exits.  This can
   benefit from pagination, so we need to commit the pager choice
   before writing this output.

   Luckily ‘git’ without subcommand has no other reason to access a
   repository, so it would be intuitive to ignore repository-local
   configuration in this case.  Simpler for now to choose a pager
   using the funny code that notices a repository that happens to be
   at .git.  That this accesses a repository when it is very
   convenient to is a bug but not an important one.

3. help_unknown_cmd() prints out a few lines to stderr.  It is not
   important to paginate this, so don’t.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 10:31:17 -07:00
Jonathan Nieder bce2c9ae9f tests: local config file should be honored from subdirs of toplevel
When git is passed the --paginate option, starting up a pager requires
deciding what pager to start, which requires access to the core.pager
configuration.  If --paginate is handled before searching for the
git dir, this configuration will be missed.

In other words, with --paginate and only with --paginate, any
repository-local core.pager setting is being ignored [*].

[*] unless the git directory is ./.git or GIT_DIR or GIT_CONFIG was
set explicitly.

Add a test to demonstrate this counterintuitive behavior.  Noticed
while reading over a patch by Duy that fixes it.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Improved-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 10:31:17 -07:00
Jonathan Nieder 8f81449e88 t7006: test pager configuration for several git commands
Test choice of pager at several stages of repository setup.  This
provides some (admittedly uninteresting) examples to keep in mind when
considering changes to the setup procedure.

Improved-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 10:31:17 -07:00
Jonathan Nieder 3c7406d4b5 t7006 (pager): introduce helper for parameterized tests
The current tests test pager configuration for ‘git log’, but other
commands use a different setup procedure and should therefore be
tested separately.  Add a helper to make this easier.

This patch introduces the helper and changes some existing tests to
use it.  The only functional change should be the introduction of ‘git
log - ’ to a few test descriptions.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 10:31:17 -07:00
Junio C Hamano cf4403a010 Merge branch 'cp/textconv-cat-file'
* cp/textconv-cat-file:
  git-cat-file.txt: Document --textconv
  t/t8007: test textconv support for cat-file
  textconv: support for cat_file
  sha1_name: add get_sha1_with_context()
2010-06-27 12:07:55 -07:00
Junio C Hamano a278aa61a4 Merge branch 'tr/send-email-8bit'
* tr/send-email-8bit:
  send-email: ask about and declare 8bit mails
2010-06-27 12:07:45 -07:00
Junio C Hamano bcdfb20ae9 Merge branch 'js/maint-am-rebase-invalid-author'
* js/maint-am-rebase-invalid-author:
  am: use get_author_ident_from_commit instead of mailinfo when rebasing
2010-06-27 12:07:44 -07:00
Junio C Hamano 4af574dbdc Merge branch 'ab/blame-textconv'
* ab/blame-textconv:
  t/t8006: test textconv support for blame
  textconv: support for blame
  textconv: make the API public

Conflicts:
	diff.h
2010-06-27 12:07:44 -07:00
Junio C Hamano 6bead0c320 Merge branch 'sb/format-patch-signature'
* sb/format-patch-signature:
  completion: Add --signature and format.signature
  format-patch: Add a signature option (--signature)
2010-06-22 09:45:22 -07:00
Junio C Hamano 223a923c37 Merge branch 'mg/pretty-magic-space'
* mg/pretty-magic-space:
  pretty: Introduce ' ' modifier to add space if non-empty

Conflicts:
	pretty.c
2010-06-22 09:45:22 -07:00
Junio C Hamano 8c7da8690d Merge branch 'cc/cherry-pick-series'
* cc/cherry-pick-series:
  Documentation/revert: describe passing more than one commit
  Documentation/cherry-pick: describe passing more than one commit
  revert: add tests to check cherry-picking many commits
  revert: allow cherry-picking more than one commit
  revert: change help_msg() to take no argument
  revert: refactor code into a do_pick_commit() function
  revert: use run_command_v_opt() instead of execv_git_cmd()
  revert: cleanup code for -x option
2010-06-22 09:45:21 -07:00
Junio C Hamano a214afd25b Merge branch 'jc/rev-list-ancestry-path'
* jc/rev-list-ancestry-path:
  revision: Turn off history simplification in --ancestry-path mode
  revision: Fix typo in --ancestry-path error message
  Documentation/rev-list-options.txt: Explain --ancestry-path
  Documentation/rev-list-options.txt: Fix missing line in example history graph
  revision: --ancestry-path
2010-06-22 09:45:21 -07:00
Junio C Hamano 262657dce6 Merge branch 'maint'
* maint:
  Update draft release notes to 1.7.1.1
  tests: remove unnecessary '^' from 'expr' regular expression

Conflicts:
	diff.c
2010-06-22 09:35:36 -07:00
Junio C Hamano b2ebbd8f13 Merge branch 'ic/maint-rebase-i-abort' into maint
* ic/maint-rebase-i-abort:
  rebase -i: Abort cleanly if new base cannot be checked out
2010-06-22 09:31:48 -07:00
Junio C Hamano 81b43b54b2 Merge branch 'cc/maint-commit-reflog-msg' into maint
* cc/maint-commit-reflog-msg:
  commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-22 09:31:48 -07:00
Junio C Hamano b2a6095308 Merge branch 'tc/commit-abbrev-fix' into maint
* tc/commit-abbrev-fix:
  commit::print_summary(): don't use format_commit_message()
  t7502-commit: add summary output tests for empty and merge commits
  t7502-commit: add tests for summary output
2010-06-22 09:31:47 -07:00
Junio C Hamano a7e664fc2a Merge branch 'jn/document-rebase-i-p-limitation' into maint
* jn/document-rebase-i-p-limitation:
  rebase -i -p: document shortcomings
2010-06-22 09:31:47 -07:00
Junio C Hamano 3c656899cd Merge branch 'cc/maint-diff-CC-binary' into maint
* cc/maint-diff-CC-binary:
  diff: fix "git show -C -C" output when renaming a binary file

Conflicts:
	diff.c
2010-06-22 09:27:07 -07:00
Junio C Hamano a8c4d925ca Merge branch 'jc/t9129-any-utf8' into maint
* jc/t9129-any-utf8:
  t9129: fix UTF-8 locale detection
2010-06-22 08:31:53 -07:00
Junio C Hamano 4b2405ce19 Merge branch 'cb/ls-files-cdup' into maint
* cb/ls-files-cdup:
  ls-files: allow relative pathspec
  quote.c: separate quoting and relative path generation
2010-06-22 08:31:46 -07:00
Junio C Hamano e3ed7f721c Merge branch 'tc/merge-m-log' into maint
* tc/merge-m-log:
  merge: --log appends shortlog to message if specified
  fmt-merge-msg: add function to append shortlog only
  fmt-merge-msg: refactor merge title formatting
  fmt-merge-msg: minor refactor of fmt_merge_msg()
  merge: rename variable
  merge: update comment
  t7604-merge-custom-message: show that --log doesn't append to -m
  t7604-merge-custom-message: shift expected output creation
2010-06-22 08:31:25 -07:00
Junio C Hamano 0d2416e060 Merge branch 'jn/maint-amend-missing-name' into maint
* jn/maint-amend-missing-name:
  commit --amend: cope with missing display name
2010-06-22 08:30:44 -07:00
Junio C Hamano 21919d396a Merge branch 'pc/remove-warn' into maint
* pc/remove-warn:
  Remove a redundant errno test in a usage of remove_path
  Introduce remove_or_warn function
  Implement the rmdir_or_warn function
  Generalise the unlink_or_warn function
2010-06-22 08:30:38 -07:00
Junio C Hamano e0ae1e6f4d tests: remove unnecessary '^' from 'expr' regular expression
As Brandon noticed, a regular expression match given to 'expr' is already
anchored at the beginning.  Some versions of expr even complain about this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-21 11:18:54 -07:00
Junio C Hamano 6cd52edbbd Merge branch 'cc/maint-commit-reflog-msg'
* cc/maint-commit-reflog-msg:
  commit: use value of GIT_REFLOG_ACTION env variable as reflog message
2010-06-21 06:02:50 -07:00
Junio C Hamano 9cb16a92d7 Merge branch 'ic/maint-rebase-i-abort'
* ic/maint-rebase-i-abort:
  rebase -i: Abort cleanly if new base cannot be checked out
2010-06-21 06:02:50 -07:00
Junio C Hamano d5cff17eda Merge branch 'eb/core-eol'
* eb/core-eol:
  Add "core.eol" config variable
  Rename the "crlf" attribute "text"
  Add per-repository eol normalization
  Add tests for per-repository eol normalization

Conflicts:
	Documentation/config.txt
	Makefile
2010-06-21 06:02:49 -07:00
Junio C Hamano d249515f29 Merge branch 'fg/autocrlf'
* fg/autocrlf:
  autocrlf: Make it work also for un-normalized repositories
2010-06-21 06:02:47 -07:00
Junio C Hamano d4f8f74bc6 Merge branch 'jn/document-rebase-i-p-limitation'
* jn/document-rebase-i-p-limitation:
  rebase -i -p: document shortcomings
2010-06-21 06:02:47 -07:00
Junio C Hamano 1a5296cb92 Merge branch 'tc/commit-abbrev-fix'
* tc/commit-abbrev-fix:
  commit::print_summary(): don't use format_commit_message()
  t7502-commit: add summary output tests for empty and merge commits
  t7502-commit: add tests for summary output
2010-06-21 06:02:46 -07:00
Junio C Hamano 632d3f4b5b Merge branch 'gs/usage-to-stdout'
* gs/usage-to-stdout:
  parseopt: wrap rev-parse --parseopt usage for eval consumption
  print the usage string on stdout instead of stderr

Conflicts:
	parse-options.h
2010-06-21 06:02:45 -07:00
Junio C Hamano 762655010d Merge branch 'js/async-thread'
* js/async-thread:
  fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f)
  Enable threaded async procedures whenever pthreads is available
  Dying in an async procedure should only exit the thread, not the process.
  Reimplement async procedures using pthreads
  Windows: more pthreads functions
  Fix signature of fcntl() compatibility dummy
  Make report() from usage.c public as vreportf() and use it.
  Modernize t5530-upload-pack-error.

Conflicts:
	http-backend.c
2010-06-21 06:02:45 -07:00
Junio C Hamano 8d676d85f7 Merge branch 'gv/portable'
* gv/portable:
  test-lib: use DIFF definition from GIT-BUILD-OPTIONS
  build: propagate $DIFF to scripts
  Makefile: Tru64 portability fix
  Makefile: HP-UX 10.20 portability fixes
  Makefile: HPUX11 portability fixes
  Makefile: SunOS 5.6 portability fix
  inline declaration does not work on AIX
  Allow disabling "inline"
  Some platforms lack socklen_t type
  Make NO_{INET_NTOP,INET_PTON} configured independently
  Makefile: some platforms do not have hstrerror anywhere
  git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition
  test_cmp: do not use "diff -u" on platforms that lack one
  fixup: do not unconditionally disable "diff -u"
  tests: use "test_cmp", not "diff", when verifying the result
  Do not use "diff" found on PATH while building and installing
  enums: omit trailing comma for portability
  Makefile: -lpthread may still be necessary when libc has only pthread stubs
  Rewrite dynamic structure initializations to runtime assignment
  Makefile: pass CPPFLAGS through to fllow customization

Conflicts:
	Makefile
	wt-status.h
2010-06-21 06:02:44 -07:00
Junio C Hamano 919e06b228 Merge branch 'bc/portable'
* bc/portable:
  Remove python 2.5'isms
  Makefile: add PYTHON_PATH to GIT-BUILD-OPTIONS
  t/aggregate-results: accomodate systems with small max argument list length
  t/t7006: ignore return status of shell's unset builtin
  t/t5150: remove space from sed script
  git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh
  t/t5800: skip if python version is older than 2.5
2010-06-21 06:02:42 -07:00
Junio C Hamano 5bebcd4ecb Merge branch 'em/checkout-orphan'
* em/checkout-orphan:
  log_ref_setup: don't return stack-allocated array
  bash completion: add --orphan to 'git checkout'
  t3200: test -l with core.logAllRefUpdates options
  checkout --orphan: respect -l option always
  refs: split log_ref_write logic into log_ref_setup
  Documentation: alter checkout --orphan description
2010-06-21 06:02:41 -07:00
Junio C Hamano 443f26cbca Merge branch 'cb/assume-unchanged-fix' into maint
* cb/assume-unchanged-fix:
  Documentation: git-add does not update files marked "assume unchanged"
  do not overwrite files marked "assume unchanged"
2010-06-21 05:39:23 -07:00
Junio C Hamano 1b9fa0e811 Merge branch 'jn/notes-doc' into maint
* jn/notes-doc:
  Documentation/notes: nitpicks
  Documentation/notes: clean up description of rewriting configuration
  Documentation/notes: simplify treatment of default display refs
  Documentation/log: add a CONFIGURATION section
  Documentation/notes: simplify treatment of default notes ref
  Documentation/notes: add configuration section
  Documentation/notes: describe content of notes blobs
  Documentation/notes: document format of notes trees
2010-06-21 05:39:16 -07:00
Junio C Hamano 6f79d66891 Merge branch 'ab/test-cleanup' into maint
* ab/test-cleanup:
  Turn setup code in t2007-checkout-symlink.sh into a test
  Move t6000lib.sh to lib-*
2010-06-21 05:39:02 -07:00
Junio C Hamano e1ba0f6340 Merge branch 'bg/apply-blank-trailing-context' into maint
* bg/apply-blank-trailing-context:
  apply: Allow blank *trailing* context lines to match beyond EOF
2010-06-21 05:38:36 -07:00
Clément Poulain 34bb92eca4 t/t8007: test textconv support for cat-file
Test the correct functionning of textconv with cat-file <sha1:blob>
and cat-file HEAD^ <file>. Test the case when no driver is specified

Signed-off-by: Clément Poulain <clement.poulain@ensimag.imag.fr>
Signed-off-by: Diane Gasselin <diane.gasselin@ensimag.imag.fr>
Signed-off-by: Axel Bonnet <axel.bonnet@ensimag.imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-18 12:57:47 -07:00
Junio C Hamano 5977744d04 Merge branch 'cc/maint-diff-CC-binary'
* cc/maint-diff-CC-binary:
  diff: fix "git show -C -C" output when renaming a binary file

Conflicts:
	diff.c
2010-06-18 11:16:57 -07:00
Junio C Hamano e09151281d Merge branch 'cb/ls-files-cdup'
* cb/ls-files-cdup:
  ls-files: allow relative pathspec
  quote.c: separate quoting and relative path generation
2010-06-18 11:16:56 -07:00
Junio C Hamano f159bdd48d Merge branch 'jc/t9129-any-utf8'
* jc/t9129-any-utf8:
  t9129: fix UTF-8 locale detection
2010-06-18 11:16:56 -07:00
Junio C Hamano 0f0169d153 Merge branch 'jn/rebase-cmdline-fix'
* jn/rebase-cmdline-fix:
  rebase: improve error message when upstream argument is missing
2010-06-18 11:16:56 -07:00
Junio C Hamano 18fd805583 Merge branch 'jh/diff-index-line-abbrev'
* jh/diff-index-line-abbrev:
  diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s

Conflicts:
	diff.c
2010-06-18 11:16:56 -07:00
Junio C Hamano 880bd9d080 Merge branch 'mg/status-b'
* mg/status-b:
  Documentation+t5708: document and test status -s -b
  Show branch information in short output of git status
2010-06-18 11:16:55 -07:00
Junio C Hamano 7c1b228d26 Merge branch 'jn/gitweb-plackup'
* jn/gitweb-plackup:
  git-instaweb: Add support for running gitweb via 'plackup'
  git-instaweb: Wait for server to start before running web browser
  git-instaweb: Remove pidfile after stopping web server
  git-instaweb: Configure it to work with new gitweb structure
  git-instaweb: Put httpd logs in a "$httpd_only" subdirectory
  gitweb: Set default destination directory for installing gitweb in Makefile
  gitweb: Move static files into seperate subdirectory
2010-06-18 11:16:55 -07:00
Junio C Hamano bcacc0ebdb Merge branch 'jk/url-decode'
* jk/url-decode:
  decode file:// and ssh:// URLs
  make url-related functions reusable
2010-06-18 11:16:55 -07:00
Junio C Hamano 1c5d6b2a40 Merge branch 'jn/remote-set-branches'
* jn/remote-set-branches:
  Add git remote set-branches

Conflicts:
	builtin/remote.c
2010-06-18 11:16:55 -07:00