Skip to content
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

Add changed file information to snow log #144

Open
daniellanner opened this issue Apr 20, 2021 · 7 comments · May be fixed by #291
Open

Add changed file information to snow log #144

daniellanner opened this issue Apr 20, 2021 · 7 comments · May be fixed by #291
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@daniellanner
Copy link
Contributor

Limitation

Currently snow log --output=json returns the full snapshot of each commit. A typical view for plugins working with SnowFS will be to show the files modified for each commit. This means every plugin will reimplement a log-diff-view feature.

Proposed Solution

We can add this functionality natively and add an option to snow log to print all files per commit or only changed files, e.g.

snow log --changed-files --output=json
@daniellanner daniellanner changed the title Add Add changed file information to snow log Apr 20, 2021
@daniellanner daniellanner added enhancement New feature or request good first issue Good for newcomers labels Apr 20, 2021
@belkarx
Copy link

belkarx commented Oct 3, 2021

I'd like to take this issue (if it's still open)

@daniellanner
Copy link
Contributor Author

daniellanner commented Oct 3, 2021

Hi belkarx 👋

Any help is greatly appreciated! Thanks in advance! If you have any questions please reach out to @seb-mtl. He likes to talk.

@seb-mtl is the diff behaviour already in snowfs and the only thing missing is to link it with the --changed-files command?

@sebastianrath
Copy link
Contributor

sebastianrath commented Oct 3, 2021

@belkarx Awesome, let us know if you have any questions.
@daniellanner Yes, the diff class is available here

It's pretty simple, you pass two commits, and can query the results

const diff = new Diff(commit0, commit1, { includeDirs: true });
...
const addedItems = Array.from(diff.added());
const modifiedItems = Array.from(diff.modified());
...

Also check out 7.repo.diff.ts for more examples

@belkarx
Copy link

belkarx commented Oct 7, 2021

Hey, sorry for not getting on this earlier but I ran into some issues getting snow to work on my platform (Arch Linux). I submitted a bug report (#247) and in the meantime, I have a question: should I write a test for the --changed-files feature? Also, I'm kind of new to open source contributing and was wondering if I could have a bit more guidance on how to approach this?

@sebastianrath
Copy link
Contributor

if I could have a bit more guidance on how to approach this

Feel free to join us on Discord: https://discord.gg/cbrTXuYKR7 We are happy to help to get started

@daniellanner: Do you remember if --changed-files is covered?

@daniellanner
Copy link
Contributor Author

daniellanner commented Oct 7, 2021

Hi @belkarx,

No worries. EDIT: I'll try to reproduce your issue tomorrow evening after work. I see @seb-mtl already adressed the issue 😄.

Regarding open source contributions, you are already doing the right thing by just asking questions 👍

Usually, you find detailed instructions on how to contribute in a repositories CONTRBUTING.md. In our case we follow the "fork-and-pull" Git workflow.

  1. Fork the repository to your own Github account
  2. Clone the project to your machine
  3. Create a branch locally with a succinct but descriptive name
  4. Commit changes to the branch
  5. Following any formatting and testing guidelines specific to this repo
  6. Push changes to your fork
  7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes.

You can also see the first timer's guide on the auth0 blog for resources and tips on how to get started.

For tests, feel free to get inspired by already existing unit tests in the project. Generally try and stick to unit test best practices with set-up and tear-down. If you have any further questions feel free to ask them here or our Discord.

And once again a big thank you for contributing ❤️

@seb-mtl --changed-files does not exist yet but we have a set of tests at test/7.repo.diff.ts, covering also use cases on how to implement --changed-files.

@belkarx belkarx linked a pull request Jul 21, 2022 that will close this issue
@Asish-AP
Copy link

Hey @daniellanner @sebastianrath is any work still pending on this issue . I would like to take it from here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants