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

Re: [PATCH 2/2] git-svn: get color config from --get-colorbool

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 12, 2007, 18:27 UTC
Message-ID
<20071212182734.GA28377@untitled>
In-Reply-To
<20071211062842.GB21768@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> git-config recently learned a --get-colorbool option. By
> using it, we will get the same color=auto behavior that
> other git commands have.
> 
> Specifically, this fixes the case where "color.diff = true"
> meant "always" in git-svn, but "auto" in other programs.
> 
> Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 60 quoted lines
> ---
>  git-svn.perl |   35 ++---------------------------------
>  1 files changed, 2 insertions(+), 33 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 9f884eb..1c42c55 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -3969,39 +3969,7 @@ sub cmt_showable {
>  }
>  
>  sub log_use_color {
> -	return 1 if $color;
> -	my ($dc, $dcvar);
> -	$dcvar = 'color.diff';
> -	$dc = `git-config --get $dcvar`;
> -	if ($dc eq '') {
> -		# nothing at all; fallback to "diff.color"
> -		$dcvar = 'diff.color';
> -		$dc = `git-config --get $dcvar`;
> -	}
> -	chomp($dc);
> -	if ($dc eq 'auto') {
> -		my $pc;
> -		$pc = `git-config --get color.pager`;
> -		if ($pc eq '') {
> -			# does not have it -- fallback to pager.color
> -			$pc = `git-config --bool --get pager.color`;
> -		}
> -		else {
> -			$pc = `git-config --bool --get color.pager`;
> -			if ($?) {
> -				$pc = 'false';
> -			}
> -		}
> -		chomp($pc);
> -		if (-t *STDOUT || (defined $pager && $pc eq 'true')) {
> -			return ($ENV{TERM} && $ENV{TERM} ne 'dumb');
> -		}
> -		return 0;
> -	}
> -	return 0 if $dc eq 'never';
> -	return 1 if $dc eq 'always';
> -	chomp($dc = `git-config --bool --get $dcvar`);
> -	return ($dc eq 'true');
> +	return $color || Git->repository->get_colorbool('color.diff');
>  }
>  
>  sub git_svn_log_cmd {
> @@ -4060,6 +4028,7 @@ sub config_pager {
>  	} elsif (length $pager == 0 || $pager eq 'cat') {
>  		$pager = undef;
>  	}
> +	$ENV{GIT_PAGER_IN_USE} = defined($pager);
>  }
>  
>  sub run_pager {
> -- 
> 1.5.3.7.2230.g796d07-dirty
> 
-- 
Eric Wong
Previous: Jeff KingNext: Jeff King
Message 27 of 72 in “What's in git/spearce.git (stable)”
  1. Shawn O. PearceOct 22, 2007
  2. What's in git.git (stable)Junio C Hamano, Nov 1, 2007
  3. What's in git.git (stable)Junio C Hamano, Nov 4, 2007
  4. What's in git.git (stable)Junio C Hamano, Nov 8, 2007
  5. Pierre HabouzitNov 8, 2007
  6. What's in git.git (stable)Junio C Hamano, Nov 12, 2007
  7. What's in git.git (stable)Junio C Hamano, Nov 15, 2007
  8. What's in git.git (stable)Junio C Hamano, Nov 17, 2007
  9. What's in git.git (stable)Junio C Hamano, Nov 25, 2007
  10. What's in git.git (stable)Junio C Hamano, Dec 1, 2007
  11. What's in git.git (stable)Junio C Hamano, Dec 4, 2007
  12. What's in git.git (stable)Junio C Hamano, Dec 5, 2007
  13. What's in git.git (stable)Junio C Hamano, Dec 7, 2007
  14. What's in git.git (stable)Junio C Hamano, Dec 9, 2007
  15. v1.5.4 plansJunio C Hamano, Dec 10, 2007
  16. Jeff KingDec 10, 2007
  17. Junio C HamanoDec 11, 2007
  18. Junio C HamanoDec 11, 2007
  19. Jeff KingDec 11, 2007
  20. Junio C HamanoDec 11, 2007
  21. Jeff KingDec 11, 2007
  22. Junio C HamanoDec 11, 2007
  23. Jeff KingDec 11, 2007
  24. Jeff KingDec 11, 2007
  25. Jeff KingDec 11, 2007
  26. 2/2 git-svn: get color config from --get-colorboolJeff King, Dec 11, 2007
  27. Eric WongDec 12, 2007
  28. Jeff KingDec 11, 2007
  29. Andreas EricssonDec 11, 2007
  30. Jeff KingDec 11, 2007
  31. Nicolas PitreDec 11, 2007
  32. Johannes SchindelinDec 11, 2007
  33. Nicolas PitreDec 11, 2007
  34. Kristian HøgsbergDec 11, 2007
  35. Junio C HamanoDec 11, 2007
  36. Eric WongDec 12, 2007
  37. Junio C HamanoDec 12, 2007
  38. David D. KilzerDec 12, 2007
  39. David D. KilzerDec 31, 2007
  40. Fix race condition in t9119-git-svn-info.shDavid D. Kilzer, Dec 31, 2007
  41. Junio C HamanoDec 31, 2007
  42. Remove duplication in t9119-git-svn-info.shDavid D. Kilzer, Dec 31, 2007
  43. Eric WongJan 2, 2008
  44. David D. KilzerJan 2, 2008
  45. Junio C HamanoJan 2, 2008
  46. Junio C HamanoJan 2, 2008
  47. What's in git.git (stable frozen)Junio C Hamano, Dec 13, 2007
  48. git-commit: squelch needless message during an empty mergeJunio C Hamano, Dec 13, 2007
  49. Jeff KingDec 13, 2007
  50. Johannes SixtDec 13, 2007
  51. What's in git.git (stable frozen)Junio C Hamano, Dec 17, 2007
  52. What's in git.git (stable frozen)Junio C Hamano, Dec 23, 2007
  53. What's in git.git (stable frozen)Junio C Hamano, Jan 5, 2008
  54. Dan McGeeJan 5, 2008
  55. Junio C HamanoJan 6, 2008
  56. Junio C HamanoJan 6, 2008
  57. Dan McGeeJan 6, 2008
  58. Junio C HamanoJan 6, 2008
  59. Jeff KingJan 6, 2008
  60. Jeff KingJan 6, 2008
  61. Junio C HamanoJan 6, 2008
  62. Jeff KingJan 6, 2008
  63. Junio C HamanoJan 6, 2008
  64. Jeff KingJan 6, 2008
  65. Junio C HamanoJan 6, 2008
  66. Jeff KingJan 7, 2008
  67. Junio C HamanoJan 7, 2008
  68. Paul MackerrasJan 7, 2008
  69. Christian StimmingJan 7, 2008
  70. Junio C HamanoJan 7, 2008
  71. Steffen ProhaskaDec 17, 2007
  72. Junio C HamanoJan 5, 2008

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.