Skip to content

Conversation

gerhardol
Copy link
Member

@gerhardol gerhardol commented Jun 28, 2025

Proposed changes

Follow up to #12421 (comment)
Based on #12421

present removed submodules

  • Submodule presentation in the file tree and diff did not
    present removed submodules.

  • In diffs, detect if the path is a submodule also if the path
    does not exist.

To present submodules as diff or in file tree the submodule must be present.
By default is only the path and the commit sha known.

Previously these paths were in some scenarios presented as files, which raised error messages.

Screenshots

see also See #12421 for prev

removed submodule in commit, folder not available in worktree, .gitmodule contains the file
image
image

removed submodule, folder exists
image
image

added submodule, not in worktree
image
image

remove submodule is still like
image

Test methodology

manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@@ -0,0 +1,6 @@
namespace GitExtensions.Extensibility.Git;

public interface IObjectGitItem : INamedGitItem
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's "object git item"? Would ITypedGitItem work better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitItem <- IObjectGitItem <-INamedGitItem <-IGitItem
I want the "object fields": https://git-scm.com/docs/git-ls-files#_field_names
size, stage has some usages, but no implementation right now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non blocking comment, more like an exploratory discussion.

Do we need to create this hierarchy?

I know it'd be a breaking change (from an API perspective, but in reality, probably won't be significant?), any reason not to add the new properties to the INamedGitItem?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because INamedGitItems are used in other situations (GitRefs), where ObjectType is not relevant. It could sure be set as Unknown there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed changes to use INamedGitItem.
See src/app/GitCommands/Git/GitRef.cs for the limitation. objecttype for refs/ is not obvious
Could be retrieved with git cat-file -t refs/tags/v2.51.05 tag - annotated or git for-each-ref --format="%(objecttype)" refs/tags/v2.51.RC1 commit - lightweight

This could be implemented (or the throw in the testbranch is kept)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this and #12437 be merged?

Yes, since we have agreed to accept the minor API change.

If I get a second approval

Please!

I will merge and we could merge master to release/6.0

Then I will prepare the RC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging @gitextensions/git-extensions-team again
This and some other are blocking a RC for no reason for over two weeks now, for something that we agreed on. Please review
Some others here: https://github.com/gitextensions/gitextensions/milestone/78

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on vacation, traveling. Sorry, unable to help at the moment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question wasn't blocking. I trust your judgement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still would like to have a second approval, with or without a1d057c

@gerhardol gerhardol force-pushed the feature/removed-submodule branch from 71c963a to 6a08d1a Compare June 29, 2025 14:01
@mstv mstv added this to the v6.0.1 milestone Jun 29, 2025
@gerhardol gerhardol force-pushed the feature/removed-submodule branch from 24aedb9 to 4bda4d7 Compare June 29, 2025 21:08
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit on the test branch would be fine for me, too.

@gerhardol
Copy link
Member Author

Rebased on #12421 to resolve conflicts (these should be merged just after each other)

- Submodule presentation in the file tree and diff did not
present removed submodules.

- In diffs, detect if the path is a submodule also if the path
does not exist.
@gerhardol gerhardol force-pushed the feature/removed-submodule branch from 3023dff to bf1fcc0 Compare August 10, 2025 11:04
@gerhardol gerhardol merged commit 1bb9dad into gitextensions:master Aug 10, 2025
3 of 4 checks passed
@gerhardol gerhardol deleted the feature/removed-submodule branch August 10, 2025 16:06
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.

4 participants