Subject: bug#25737: 25.1.91; vc-git-log-{incoming,outgoing} fixes

From: Tom Tromey <[email-masked]>
Date: Thu, 16 Feb 2017 21:01:34 -0700

>>>>> "Dmitry" == Dmitry Gutov <[email-masked]> writes:

>> First, vc-git-log-incoming and vc-git-log-outgoing can be called with a
>> nil value for remote-location.  In this case nothing shows up in the
>> log.  Changing the code to treat nil the same as the empty string makes
>> the commands show the data I would expect.

Dmitry> Do you know when they get called with ""?

vc-log-outgoing does:

  (interactive
   (when current-prefix-arg
     (list (read-string "Remote location (empty for default): "))))

So a prefix argument followed by pressing enter.

Dmitry> Should we maybe just change the callers to always use one or the other
Dmitry> value?

Seems reasonable, I'll change vc-log-outgoing.

>> Next, these commands move point to the end of the new buffer.  However,
>> that is weird, because then the buffer is shrunk to fit; for me this
>> ends up making it look like I have just a single outgoing patch, even
>> when I have several.

Dmitry> Any ideas why that happens? I can see point ending up at eob when the
Dmitry> call is synchronous, but that doesn't affect the shrinking behavior
Dmitry> much (e.g. I have 13 lines, the window shrinks correctly but hides the
Dmitry> first line because the cursor is after the last line, and it has to be
Dmitry> visible).

Dmitry> I've only tested this in vc-log-incoming, however.

There are two pieces.

As you say, point ends up at eob due to vc-do-command using process-file
in the synchronous case; whereas for the async case, vc-process-filter
uses save-excursion.

The other behavior seems to be a problem in
shrink-window-if-larger-than-buffer.  I can reproduce it easily just
with any buffer by moving point to the end.  I didn't debug this any
further than finding that.

Tom