1. 28 Jun, 2010 4 commits
    • Duy Nguyen's avatar
      git --paginate: do not commit pager choice too early · 73e25e7c
      Duy Nguyen authored
      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: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Acked-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      73e25e7c
    • Jonathan Nieder's avatar
      tests: local config file should be honored from subdirs of toplevel · bce2c9ae
      Jonathan Nieder authored
      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: default avatarJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Acked-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      bce2c9ae
    • Jonathan Nieder's avatar
      t7006: test pager configuration for several git commands · 8f81449e
      Jonathan Nieder authored
      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: default avatarJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
      Acked-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      8f81449e
    • Jonathan Nieder's avatar
      t7006 (pager): introduce helper for parameterized tests · 3c7406d4
      Jonathan Nieder authored
      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: default avatarJonathan Nieder <jrnieder@gmail.com>
      Acked-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      3c7406d4
  2. 27 Jun, 2010 7 commits
  3. 25 Jun, 2010 3 commits
  4. 24 Jun, 2010 2 commits
  5. 23 Jun, 2010 2 commits
  6. 22 Jun, 2010 22 commits