git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: 胡哲宁 <adlternative@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>, rtzoeller@rtzoeller.com
Subject: Re: Specify resume point with git difftool?
Date: Sun, 7 Feb 2021 20:57:56 +0800	[thread overview]
Message-ID: <CAOLTT8S1xMS+MMiSbQNqpw+BVtu6V-TBSOCrWjJv-6pT4h5g1Q@mail.gmail.com> (raw)

Hi,Junio,

I try to reslove this issue,but there may be a little change
in my approach:

>  - At the beginning, see if $GIT_DIR/difftool-skip-to file exists.
>
>    - If exists, read its contents.
>
Which have been read now we called it "SAVE_POINT_NUM".

And then,divided into two situations:
If the index of the file($GIT_DIFF_PATH_COUNTER)we are
viewing is 1,if $SAVE_POINT_NUM larger than
$GIT_DIFF_PATH_COUNTER, ask users if they
want to skip to last time save point $SAVE_POINT_NUM:
if the answer is no,we continue show difftool of first file;
if the answer is yes,we `return`.
If the index of the file we are viewing is large than 1,we just check the
if $SAVE_POINT_NUM large than $GIT_DIFF_PATH_COUNTER,if true,
`return` ;if false,we continue show difftool of files.

And everytime before we view the diff,we save the
$GIT_DIFF_PATH_COUNTER to $GIT_DIR/difftool-skip-to.

>    - Remove that file (we are at the 15th path and done skipping).
finally,when success viewed last file diff,we delete the
`$GIT_DIR/difftool-skip-to`.
>
>  - Update the "Viewing .../ Launch?" prompt and offer another choice
>    "Skip to?".
>
>  - Update the if/then/fi statement that processes the answer to the
>    prompt (right now, it takes n as a sign to skip the file).  When
>    the user says "skip to 15th", create $GIT_DIR/difftool-skip-to
>    file and record "15" in it and 'return'.
When we were at an index in the middle, I didn't think there was any
good way to go back to the previous index, so I didn't deal with random jumping.

After all, this question focuses on the save point of the last exit.

I have a question: If the user has two different `git difftool`
(e.g. first time user call `git difftool HEAD~` and exits midway,
second time call `git difftool HEAD~2`, the "GIT_DIR/difftool-skip-to "
still exists), I did not do the consistency check for the two.

But this is not a big hindrance, because the user can choose not to
skip before viewing the first file.

My patch will send soon.
If there are errors or omissions in my thinking,please tell me,thanks.

             reply	other threads:[~2021-02-07 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 12:57 胡哲宁 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-16 16:45 Specify resume point with git difftool? Ryan Zoeller
2020-11-16 19:26 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOLTT8S1xMS+MMiSbQNqpw+BVtu6V-TBSOCrWjJv-6pT4h5g1Q@mail.gmail.com \
    --to=adlternative@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rtzoeller@rtzoeller.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).