Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Diff.Compare overload to include untracked changes #359

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

Closed
wants to merge 1 commit into from

Conversation

mm201
Copy link
Contributor

@mm201 mm201 commented Mar 4, 2013

It seems odd to me that untracked changes aren't included by default when comparing the working tree against the index. The other ways I could find to obtain them were much more roundabout.

(I'm new to the project so please decline and tell me if there's a better way to do this already.)

@@ -201,11 +201,11 @@ public virtual TreeChanges Compare(Tree oldTree, DiffTargets diffTargets, IEnume
/// </summary>
/// <param name = "paths">The list of paths (either files or directories) that should be compared.</param>
/// <returns>A <see cref = "TreeChanges"/> containing the changes between the working directory and the index.</returns>
public virtual TreeChanges Compare(IEnumerable<string> paths = null)
public virtual TreeChanges Compare(IEnumerable<string> paths = null, bool includeUntracked = false)
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add some Xml documentation describing the new parameter?

@nulltoken
Copy link
Member

Nice addition!

Could you please squash the two commits together so the new feature and the covering test become part of the same commit?

@mm201
Copy link
Contributor Author

mm201 commented Mar 11, 2013

Thanks.
Before this is finished, I'd like to know what the chances are of the DiffOptions enum receiving more values and if it might be worth passing DiffOptions instead of bool here, before the API is locked in.

@nulltoken
Copy link
Member

before the API is locked in.

Don't worry, the API won't be locked in before version v1.0. Next official release will be v0.10

might be worth passing DiffOptions

Unless I'm wrong, I think the DiffOptions type is currently internal. FWIW, there's a WIP with @roend83's #278 PR in the same code area, also discussing API changes.

@nulltoken
Copy link
Member

Manually merged!

✨✨✨✨✨✨✨✨✨✨✨

@nulltoken nulltoken closed this Mar 11, 2013
@mm201
Copy link
Contributor Author

mm201 commented Mar 12, 2013

Thanks!

@yorah
Copy link
Contributor

yorah commented Mar 14, 2013

Could you consider deploying this on the other Compare overload TreeChanges Compare(Tree oldTree, DiffTargets diffTargets, IEnumerable<string> paths = null) ?

@yorah
Copy link
Contributor

yorah commented Mar 14, 2013

Forget my last comment, I will do it in #343 to avoid merge conflict at a later stage 😉

@yorah
Copy link
Contributor

yorah commented Mar 14, 2013

Even better, forget my last two comments: we already always include untracked files for this overload, when we are diffing between a Tree and the working directory (so that all not ignored files are taken into account).

My bad.

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