Skip to content

Add Stash first implementation#352

Closed
Saaman wants to merge 2 commits into
libgit2:vNextfrom
Saaman:topic/stash-impl
Closed

Add Stash first implementation#352
Saaman wants to merge 2 commits into
libgit2:vNextfrom
Saaman:topic/stash-impl

Conversation

@Saaman

@Saaman Saaman commented Feb 22, 2013

Copy link
Copy Markdown
Contributor

I added the management of stashes into LibGit2Sharp.
For now, you can add an list stashes, (with bindings to git_stash_save and git_stash_foreach).
I took Repository.Tags as an example to manage the stashes collection.

I'll push to you the implementation of Removea little while later.

Comment thread LibGit2Sharp/Core/GitStashOptions.cs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about

/// <summary>
///   Options controlling Stash behavior.
/// </summary>

@nulltoken

Copy link
Copy Markdown
Member

Wow... Bringing Stash to LibGit2Sharp? Amazing! 💥

Few more tiny things:

  • It looks like Travis failed to build this PR. Could you please peek at the log?
  • The Stash is a complex object (cf. this helper). Maybe would it be useful to expose some additional properties to ease the access to the Worktree, Index, Untracked or Base commit? Or is it only an implementation detail that shoudn't be exposed? I'm not even sure there's a valid use case which requires direct access to those... Thoughts?

@Saaman

Saaman commented Feb 22, 2013

Copy link
Copy Markdown
Contributor Author

that's a lot of comments! 😄
Travis complains about the missing implementation of DebuggerDisplay. 😉
I'm about to push updated commited with most of your remarks taken into account, my code should now be more compliant with the coding guidelines.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could please assert, that the Message from the Tip is not empty nor null?

@jamill

jamill commented Feb 25, 2013

Copy link
Copy Markdown
Member

Awesome! I think the main thing I noticed was that message was not exposed on the Stash object (and not in tests, etc).

Also, do you want tests covering other StashOptions? This might be helpful in case the enumeration meaning changes in libgit2...

@nulltoken

Copy link
Copy Markdown
Member

Awesome!

@Saaman I concur with @jamill ‼️

Also, do you want tests covering other StashOptions? This might be helpful in case the enumeration meaning changes in libgit2...

👍 That makes perfect sense. @Saaman Could you please cover the including of Ignored files as well?

I noticed was that message was not exposed on the Stash object

Once again @jamill hit the 🎱 I completely overlooked this. How about a Message property returning the content of Stash.Target.Message?

@Saaman

Saaman commented Feb 26, 2013

Copy link
Copy Markdown
Contributor Author

I will push a new version of the stash, with :

  • The coverage of the different StashOptions
  • The Messageproperty
  • And renaming Tipas Targetthen

@Saaman

Saaman commented Feb 26, 2013

Copy link
Copy Markdown
Contributor Author

I just pushed my modifications. It turns out I saw something odd :
While testing the option StashOptions.IncludeIgnored, I was expecting any ignored file to be stashed but then deleted from the working directory. It is stashed correctly, but left in the working directory. Is it a bug or the normal behavior?

@nulltoken

Copy link
Copy Markdown
Member

While testing the option StashOptions.IncludeIgnored, I was expecting any ignored file to be stashed but then deleted from the working directory. It is stashed correctly, but left in the working directory. Is it a bug or the normal behavior?

That looks like a bug. However, after having thought a bit about this, I realize I don't really know how git.git does behave regarding the stashing of ignored files. Would this even make sense to remove them from the workdir?

I'm going to investigate this and will report about my findings.

Merged! 💥

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.

6 participants