Skip to content

status: use DiffIndexScanner to populate results - #2042

Merged
ttaylorr merged 6 commits into
masterfrom
status-diff-scanner
Mar 22, 2017
Merged

ttaylorr merged 6 commits into
masterfrom
status-diff-scanner

Conversation

@ttaylorr

Copy link
Copy Markdown
Contributor

This pull-request brings us another step closer to adding additional information to the output of the status command by using the new *lfs.DiffIndexScanner instead of the gitscanner.

By doing so, we give the status command direct access to the *lfs.DiffIndexScanner instance, which will eventually receive methods that can answer and provide additional information about why certain files are modified.


/cc @git-lfs/core

@ttaylorr ttaylorr added this to the v2.1.0 milestone Mar 16, 2017
@ttaylorr
ttaylorr requested a review from technoweenie March 16, 2017 21:25
Comment thread commands/command_status.go Outdated
Print("")
}

func scanIndex(ref string) (<-chan *lfs.DiffIndexEntry, <-chan error, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this really need to return 2 channels? It means every caller has to setup a complex select with a goto to use it. What do you think about returning two slices of diff entries instead? The non-porcelain status calls are collecting them into two slices anyway. Also, scanIndex() would be a convenient spot to do any post-scan operations, such as sorting, or bulk cat-file calls if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@technoweenie good call. My original intent was that this could be consumed asynchronously in case the number of diff-index entries was large, but since they get collected into a slice anyway, I don't think it matters.

I went ahead and made this change in 0fb059d, and I think that this PR is now ready to merge. 👍

@technoweenie technoweenie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for making the change 🤘

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.

2 participants