Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't barf on duplicate recent repo list entries, nor a full list #10

Merged
merged 4 commits into from
Mar 18, 2017

Conversation

PhilipOakley
Copy link
Contributor

git-for-windows/git#1014 highlighted this problem which I had addressed at the end of 2015, but got lost over the Christmas.

This resurects and improves my old code, so that no matter how created dulicate entries in the recent repo list do not crash the Git-gui.

Philip Oakley added 4 commits January 20, 2017 20:55
The git gui's recent repo list may become contaminated with duplicate
entries. The git gui would barf when attempting to remove one entry.
Remove them all - there is no option within 'git config' to selectively
remove one of the entries.

This issue was reported on the 'Git User' list
(https://groups.google.com/forum/#!topic/git-users/msev4KsQGFc,
Warning: gui.recentrepo has multiply values while executing).

And also by zosrothko as a Git-for-Windows issue
git-for-windows/git#1014.

On startup the gui checks that entries in the recentrepo list are still
valid repos and deletes thoses that are not. If duplicate entries are
present the 'git config --unset' will barf and this prevents the gui
from starting.

Subsequent patches fix other parts of recentrepo logic used for syncing
internal lists with the external .gitconfig.

Reported-by: Alexey Astakhov <[email protected]>
Signed-off-by: Philip Oakley <[email protected]>
_get_recentrepo will fail if duplicate invalid entries are present
in the recentrepo config list. The previous commit fixed the
'git config' limitations in _unset_recentrepo by unsetting all config
entries, however this code would fail on the second attempt to unset it.

Refactor the code to pre-sort and de-duplicate the recentrepo list to
avoid a potential second unset attempt.

Signed-off-by: Philip Oakley <[email protected]>
When the gui/user selects a repo for display, that repo is brought to
the end of the recentrepo config list. The logic can fail if there are
duplicate old entries for the repo (you cannot unset a single config
entry when duplicates are present).

Similarly, the maxrecentrepo logic could fail if older duplicate entries
are present.

The first commit of this series ({this}~2) fixed the config unsetting
issue. Rather than manipulating a local copy of the $recent list (one
cannot know how many entries were removed), simply re-read it.

We must also catch the error when the attempt to remove the second copy
from the re-read list is performed.

Signed-off-by: Philip Oakley <[email protected]>
The gui.recentrepo list may be longer than the maxrecent setting.
Allow extra space to show any extra entries.

In an ideal world, the git gui would limit the number of entries
to the maxrecent setting, however the recentrepo config list may
have been extended outwith the gui, or the maxrecent setting changed
to a reduced value. Further, when testing the gui's recentrepo
logic it is useful to show these extra, but valid, entries.

Signed-off-by: Philip Oakley <[email protected]>
@dscho
Copy link
Contributor

dscho commented Feb 7, 2017

@PhilipOakley seeing as @patthoyts is probably too busy to have a look at this any time soon, do you think we should go ahead and merge it into Git for Windows to unblock our users?

@PhilipOakley
Copy link
Contributor Author

Yes.

I was also going to comment on the upstream Git list that this hadn't been picked up their either. There is a comment there about some gitk issues as well that haven't been picked up

dscho added a commit to git-for-windows/git that referenced this pull request Feb 23, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/build-extra that referenced this pull request Feb 24, 2017
A couple of Git GUI bugs regarding the list of recent repositories
[have been fixed](patthoyts/git-gui#10).

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Feb 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Mar 1, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Mar 1, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 1, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 2, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 3, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Mar 6, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 8, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 8, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 9, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 11, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 11, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 11, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 12, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 13, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Mar 13, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jun 21, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Jun 26, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 5, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Jul 13, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 14, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 14, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 14, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 14, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 21, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Jul 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this pull request Jul 25, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 27, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 31, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 1, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 1, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 2, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 4, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Aug 5, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Aug 8, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to git-for-windows/git that referenced this pull request Aug 10, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 10, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 10, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Aug 15, 2017
This resolves a couple of Git GUI issues that seem not to have been
picked up from patthoyts/git-gui#10 yet.

Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants