git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] builtins: do not commit pager choice early

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 26, 2010, 20:03 UTC
Message-ID
<20100326200347.GA11395@progeny.tock>
In-Reply-To
<1269524295-24569-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
> Committing pager choice may require setting up the pager, which
> will need access to repository.
[...]
> Signed-off-by: Duy Nguyen <pclouds@gmail.com>
Tested-by: Jonathan Nieder <jrnieder@gmail.com>
Without this patch, I get
| * expecting success: 
|         test_terminal git --paginate rev-list HEAD &&
|         test -e paginated.out
| 
| fatal: internal error: access to .git/config without repo setup
| * FAIL 7: git --paginate rev-list uses a pager

and with it, t7006 passes again. I assume on your system that test was being skipped when running tests without -v (confusing, yes) because that test needs a tty but IO::Pty from CPAN is not present.

Show 11 quoted lines
> There are several possible code path after
> handle_options()/commit_pager_choice() is called:
> 
> 1. list_common_cmds_help()
> 2. run_argv()
> 3. help_unknown_cmd()
> 
> Case 2. will have commit_pager_choice() called inside run_builtin() if
> a command is found. Case 1. and 3. won't need a pager, it's short
> printout and should be fitted within a screen. So, removing
> commit_pager_choice() call after handle_options() is safe.
Makes sense.

Thanks, Jonathan

Previous: Jonathan Nieder
Message 4 of 4 in “builtins: do not commit pager choice early”
  1. 1/2 builtins: do not commit pager choice earlyNguyễn Thái Ngọc Duy, Mar 25, 2010
  2. 2/2 builtins: setup repository before print unknown command errorNguyễn Thái Ngọc Duy, Mar 25, 2010
  3. Jonathan NiederMar 26, 2010
  4. Jonathan NiederMar 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.