{"thread":{"id":"55113","subject":"Re: Specify resume point with git difftool?","startedAt":"2021-02-07T12:56:47Z","lastAt":"2021-02-07T12:56:47Z","messageCount":1,"participants":["胡哲宁"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"416351","messageId":"CAOLTT8S1xMS+MMiSbQNqpw+BVtu6V-TBSOCrWjJv-6pT4h5g1Q@mail.gmail.com","threadId":"55113","inReplyTo":null,"subject":"Re: Specify resume point with git difftool?","fromName":"胡哲宁","fromEmail":"adlternative@gmail.com","sentAt":"2021-02-07T12:57:56Z","receivedAt":"2021-02-07T12:56:47Z","isPatch":false,"sender":{"key":"adlternative@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58138461?v=4"},"body":"Hi,Junio,\n\nI try to reslove this issue,but there may be a little change\nin my approach:\n\n>  - At the beginning, see if $GIT_DIR/difftool-skip-to file exists.\n>\n>    - If exists, read its contents.\n>\nWhich have been read now we called it \"SAVE_POINT_NUM\".\n\nAnd then,divided into two situations:\nIf the index of the file($GIT_DIFF_PATH_COUNTER)we are\nviewing is 1,if $SAVE_POINT_NUM larger than\n$GIT_DIFF_PATH_COUNTER, ask users if they\nwant to skip to last time save point $SAVE_POINT_NUM:\nif the answer is no,we continue show difftool of first file;\nif the answer is yes,we `return`.\nIf the index of the file we are viewing is large than 1,we just check the\nif $SAVE_POINT_NUM large than $GIT_DIFF_PATH_COUNTER,if true,\n`return` ;if false,we continue show difftool of files.\n\nAnd everytime before we view the diff,we save the\n$GIT_DIFF_PATH_COUNTER to $GIT_DIR/difftool-skip-to.\n\n>    - Remove that file (we are at the 15th path and done skipping).\nfinally,when success viewed last file diff,we delete the\n`$GIT_DIR/difftool-skip-to`.\n>\n>  - Update the \"Viewing .../ Launch?\" prompt and offer another choice\n>    \"Skip to?\".\n>\n>  - Update the if/then/fi statement that processes the answer to the\n>    prompt (right now, it takes n as a sign to skip the file).  When\n>    the user says \"skip to 15th\", create $GIT_DIR/difftool-skip-to\n>    file and record \"15\" in it and 'return'.\nWhen we were at an index in the middle, I didn't think there was any\ngood way to go back to the previous index, so I didn't deal with random jumping.\n\nAfter all, this question focuses on the save point of the last exit.\n\nI have a question: If the user has two different `git difftool`\n(e.g. first time user call `git difftool HEAD~` and exits midway,\nsecond time call `git difftool HEAD~2`, the \"GIT_DIR/difftool-skip-to \"\nstill exists), I did not do the consistency check for the two.\n\nBut this is not a big hindrance, because the user can choose not to\nskip before viewing the first file.\n\nMy patch will send soon.\nIf there are errors or omissions in my thinking,please tell me,thanks.\n"}]}