Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Show the list of children in the commit details #710

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

Merged
love-linger merged 7 commits into sourcegit-scm:develop from czarkoff:children-rev-list
Nov 20, 2024

Conversation

Copy link
Contributor

@czarkoff czarkoff commented Nov 17, 2024
edited
Loading

This is an updated version of a previously merged and reverted #673.

The general case remains almost as slow as it was, with the following optimizations:

  • The tree is walked one commit less for each ref which contains the commit.
  • Git is doing slightly less work as the search is based on parents, not on children. As the output is filtered by us anyway, this should be more efficient, though I didn't measure to be frank.

Additionally, the git command now respects:

  • Filter settings. The refs that are not visible are not searched, which should eliminate a certain amount of commits for git to chew through. The impact should not really be worthwhile, as either most of the time is spent on the references that don't contain the searched commit, or the searched commit is far enough from the refs for git to take time to reach it anyway.
  • Preference.Instance.MaxHistoryCommits. This might provide a positive impact in cases when not all of the common ancestors made it to the graph, which in practice should not be the case.

I don't see any further optimization opportunities.

That said, I've tried to address the performance problem by loading children asynchronously. In the repos that I commonly use this produces no effect whatsoever as the children are found before the view is actually drawn. I don't have access to the UnrealEngine repo, so I used Torvalds' Linux tree as my test stand, and indeed for the commits that are further up the tree the commit details get drawn first without children, and then shortly children blink into the view; the further I go down the tree, the longer it takes for the commit details to get rendered, so that at some point children tasks starts producing results before the view is rendered. In my testing I only saw times above 0.5 seconds when GC was running; though performance issues are IO-bound in this case, so I am not sure whether this figure is representative.

TL;DR: in my testing this iteration is usable with big repos.

Copy link
Contributor Author

@love-linger, just wanted to ask for your feedback. Is this still not good enough in your opinion? Or do you have some other concerns?

Copy link
Collaborator

I am currently testing this PR. And is reviewing the GIT documentation to see if there is a more efficient way.

Here, I need to clarify that I have never seen this feature in any other Git clients. I have not encountered corresponding requirements in my own use.

Copy link
Collaborator

  • I really didn't expect this to happen.
    截图20241119160446

  • I recommanded you using Filters and Check refs that contains this commit instead.

Copy link
Contributor Author

To the second point: Filters are already used. I considered doing Check refs that contains this commit, but it would walk the tree another time, so the end result will be slower. I can give it a shot though.

I'll check the first point, I didn't see such things happening in my testing.

Copy link
Collaborator

love-linger commented Nov 19, 2024
edited
Loading

If you really need this feature, I suggest you implement it in another way since it is not commonly used.

For example: like Check refs that contains this commit function, add a button after the commit's SHA.
When user clicks it, a popup will show the direct children of that commit.

Copy link
Contributor Author

You see, the point is to be able to navigate relatively quickly up and down the branch. This is something I normally do several times a day, and it was the reason I've used gitk, and is the reason why I still use it despite this project being so incredibly better in so many ways.

Would you accept this change with either repo or project configuration option to show the children? If the option is unset, the command is not run, the list is not populated, and no UIThread callback happens. The view would not need any changes compared to what was already done, the widgets in the grid raw would just remain constantly hidden.

P.S.: I've checked the image, and either I don't understand your point or everything is actually fine. This commit just has all those children.

The first commit is always the immediate child, so take only 40 initial characters of the line
Copy link
Contributor Author

I actually went ahead and added a preference. I've also tried checking refs containing the comment, but that makes the operation significantly slower indeed. I've also made the lists of parents and children scrollable. And I've fixed an issue that I've introduced in this iteration which broke navigation the child when it is clicked in some cases.

Now, if it has to be a button, I suppose I can live with the button as well. Still, inline list is much more useful to me, so I still want you to consider this option.

@love-linger love-linger added the enhancement New feature or request label Nov 20, 2024
@love-linger love-linger merged commit cc5bb5f into sourcegit-scm:develop Nov 20, 2024
13 checks passed
love-linger added a commit that referenced this pull request Nov 20, 2024
* SourceGit.Commands.* should not reference SourceGit.ViewModels.*
* remove unused namespace using
* update translations for zh_CN and zh_TW
* use WrapPanel instead of inner ScrollViewer
* some other UI/UX changes
Signed-off-by: leo <longshuang@msn.cn>
Copy link
Collaborator

I have merged this PR and made some modifications:

  • Since the entire commit details panel already uses ScrollViewer, WrapPannel is used to display CHILDREN, as shown in the figure:
    image
  • Modified Commands.QueryCommitChildren based on the code style in the project
  • Other UI/UX modifications
czarkoff reacted with heart emoji

love-linger added a commit that referenced this pull request Nov 20, 2024
@czarkoff czarkoff deleted the children-rev-list branch November 20, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
enhancement New feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /