<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pager.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2012-10-29T07:08:30Z</updated>
<entry>
<title>Move setup_diff_pager to libgit.a</title>
<updated>2012-10-29T07:08:30Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-26T15:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4914c9629c046f7f5abf4109ad756040f9ebe2bf'/>
<id>urn:sha1:4914c9629c046f7f5abf4109ad756040f9ebe2bf</id>
<content type='text'>
This is used by diff-no-index.c, part of libgit.a while it stays in
builtin/diff.c. Move it to diff.c so that we won't get undefined
reference if a program that uses libgit.a happens to pull it in.

While at it, move check_pager from git.c to pager.c. It makes more
sense there and pager.c is also part of libgit.a

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>pager: drop "wait for output to run less" hack</title>
<updated>2012-06-05T16:38:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-06-05T08:56:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8320f350f523c3219ff8ec639663193941af57d'/>
<id>urn:sha1:e8320f350f523c3219ff8ec639663193941af57d</id>
<content type='text'>
Commit 35ce862 (pager: Work around window resizing bug in
'less', 2007-01-24) causes git's pager sub-process to wait
to receive input after forking but before exec-ing the
pager. To handle this, run-command had to grow a "pre-exec
callback" feature. Unfortunately, this feature does not work
at all on Windows (where we do not fork), and interacts
poorly with run-command's parent notification system. Its
use should be discouraged.

The bug in less was fixed in version 406, which was released
in June 2007. It is probably safe at this point to remove
our workaround. That lets us rip out the preexec_cb feature
entirely.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Stop starting pager recursively</title>
<updated>2012-04-27T16:26:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-04-13T10:54:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88e8f908f2b0c56f9ccf8134d8ff9f689af9cc84'/>
<id>urn:sha1:88e8f908f2b0c56f9ccf8134d8ff9f689af9cc84</id>
<content type='text'>
git-column can be used as a pager for other git commands, something
like this:

    GIT_PAGER="git -p column --mode='dense color'" git -p branch

The problem with this is that "git -p column" also has $GIT_PAGER set so
the pager runs itself again as another pager. The end result is an
infinite loop of forking. Other git commands have the same problem if
being abused this way.

Check if $GIT_PAGER is already set and stop launching another pager.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'zj/decimal-width'</title>
<updated>2012-02-20T08:15:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-02-20T08:15:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d9e079e826c9b51b610260564111fa8385f7581'/>
<id>urn:sha1:4d9e079e826c9b51b610260564111fa8385f7581</id>
<content type='text'>
* zj/decimal-width:
  make lineno_width() from blame reusable for others

Conflicts:
	cache.h
	pager.c
</content>
</entry>
<entry>
<title>make lineno_width() from blame reusable for others</title>
<updated>2012-02-15T00:16:19Z</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2012-02-12T14:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec7ff5ba272b565ed093a98dc13dd5cd26aeac92'/>
<id>urn:sha1:ec7ff5ba272b565ed093a98dc13dd5cd26aeac92</id>
<content type='text'>
builtin/blame.c has a helper function to compute how many columns
we need to show a line-number, whose implementation is reusable as
a more generic helper function to count the number of columns
necessary to show any cardinal number.

Rename it to decimal_width(), move it to pager.c and export it for
use by future callers.

Signed-off-by: Zbigniew Jędrzejewski-Szmek &lt;zbyszek@in.waw.pl&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pager: find out the terminal width before spawning the pager</title>
<updated>2012-02-13T23:08:47Z</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2012-02-12T14:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad6c3739a33586ba15a8c5c245dcd59e8a31cef1'/>
<id>urn:sha1:ad6c3739a33586ba15a8c5c245dcd59e8a31cef1</id>
<content type='text'>
term_columns() checks for terminal width via ioctl(2) on the standard
output, but we spawn the pager too early for this check to be useful.

The effect of this buglet can be observed by opening a wide terminal and
running "git -p help --all", which still shows 80-column output, while
"git help --all" uses the full terminal width. Run the check before we
spawn the pager to fix this.

While at it, move term_columns() to pager.c and export it from cache.h so
that callers other than the help subsystem can use it.

Signed-off-by: Zbigniew Jędrzejewski-Szmek &lt;zbyszek@in.waw.pl&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup_pager: set GIT_PAGER_IN_USE</title>
<updated>2011-08-18T21:17:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-08-18T05:02:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e6c012e10fd866eb3259de3a929e0296daabbaf'/>
<id>urn:sha1:2e6c012e10fd866eb3259de3a929e0296daabbaf</id>
<content type='text'>
We have always set a global "spawned_pager" variable when we
start the pager. This lets us make the auto-color decision
later in the program as as "we are outputting to a terminal,
or to a pager which can handle colors".

Commit 6e9af86 added support for the GIT_PAGER_IN_USE
environment variable. An external program calling git (e.g.,
git-svn) could set this variable to indicate that it had
already started the pager, and that the decision about
auto-coloring should take that into account.

However, 6e9af86 failed to do the reverse, which is to tell
external programs when git itself has started the pager.
Thus a git command implemented as an external script that
has the pager turned on (e.g., "git -p stash show") would
not realize it was going to a pager, and would suppress
colors.

This patch remedies that; we always set GIT_PAGER_IN_USE
when we start the pager, and the value is respected by both
this program and any spawned children.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make 'git var GIT_PAGER' always print the configured pager</title>
<updated>2010-02-15T02:23:17Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2010-02-14T11:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64778d24a93ad455e5883120aef350ede20061c4'/>
<id>urn:sha1:64778d24a93ad455e5883120aef350ede20061c4</id>
<content type='text'>
Scripted commands that want to use git’s configured pager know better
than ‘git var’ does whether stdout is going to be a tty at the
appropriate time.  Checking isatty(1) as git_pager() does now won’t
cut it, since the output of git var itself is almost never a terminal.
The symptom is that when used by humans, ‘git var GIT_PAGER’ behaves
as it should, but when used by scripts, it always returns ‘cat’!

So avoid tricks with isatty() and just always print the configured
pager.

This does not fix the callers to check isatty(1) themselves yet.
Nevertheless, this patch alone is enough to fix 'am --interactive'.

Thanks to Sebastian Celis for the report and Jeff King for the
analysis.

Reported-by: Sebastian Celis &lt;sebastian@sebastiancelis.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: convert simple callsites to use_shell</title>
<updated>2010-01-06T07:41:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2009-12-30T10:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac0ba18df0c58decfb128336bab51a172c77abc0'/>
<id>urn:sha1:ac0ba18df0c58decfb128336bab51a172c77abc0</id>
<content type='text'>
Now that we have the use_shell feature, these callsites can
all be converted with small changes.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Provide a build time default-pager setting</title>
<updated>2009-11-13T20:20:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-10-31T01:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3d023d0a3783612053f2149e784b43befceccad'/>
<id>urn:sha1:a3d023d0a3783612053f2149e784b43befceccad</id>
<content type='text'>
Provide a DEFAULT_PAGER knob so packagers can set the fallback
pager to something appropriate during the build.

Examples:

On (old) solaris systems, /usr/bin/less (typically the first less
found) doesn't understand the default arguments (FXRS), which
forces users to alter their environment (PATH, GIT_PAGER, LESS,
etc) or have a local or global gitconfig before paging works as
expected.

On Debian systems, by policy packages must fall back to the
'pager' command, so that changing the target of the
/usr/bin/pager symlink changes the default pager for all packages
at once.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Ben Walton &lt;bwalton@artsci.utoronto.ca&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
