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

forget: group-by-tags-only #1196

Merged
merged 4 commits into from
Sep 10, 2017
Merged

Conversation

mungomat
Copy link
Contributor

This is not complete - what if "restic forget --group-by-tags --group-by-tags-only" is given?

@fawick
Copy link
Member

fawick commented Aug 31, 2017

Travis fails because the manpage is not up-to-date in the PR. In your branch, could you please call restic manpage --output-dir doc/man and add this to the PR? Thanks!

@fd0
Copy link
Member

fd0 commented Sep 3, 2017

And it needs a rebase, just like the other PR. Let us know if you need help with the rebase.

@middelink
Copy link
Member

middelink commented Sep 5, 2017

Can I suggest to resolve this in a different way? Instead of adding --group-by-tags-only and possibly --group-by-path-only or --group-by-host-only, make a flag specifying what your ordering needs to be --group-by=[host,path,tags]. Default to "host,path,tags" to keep functionality the same.

@fd0
Copy link
Member

fd0 commented Sep 5, 2017

@middelink that is an excellent idea, thank you very much! We can just fill the JSON key according to what's present in --group-by.

@mungomat Do you think you can tackle this? Or shall I do that?

@fd0
Copy link
Member

fd0 commented Sep 7, 2017

The CI test fail because cmd_forget.go is not properly formatted. May I suggest installing the script
fmt-check from https://github.com/edsrzf/gofmt-git-hook locally as a
pre-commit hook? It checks formatting before committing automatically, just copy
this script to .git/hooks/pre-commit.

var GroupByHost bool
var GroupByPath bool

GroupByTag = strings.Contains( opts.GroupBy, "tag" )
Copy link
Member

Choose a reason for hiding this comment

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

That is very vague. I'd go for splitting opts.GroupBy by ,, then iterate over the results, and use a switch statement that reacts on the strings tag, host and path and returns an error if the string is unknown.

What do you think?

@codecov-io
Copy link

codecov-io commented Sep 9, 2017

Codecov Report

Merging #1196 into master will decrease coverage by 5.78%.
The diff coverage is 22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1196      +/-   ##
==========================================
- Coverage    52.9%   47.12%   -5.79%     
==========================================
  Files         123      126       +3     
  Lines       12170    12230      +60     
==========================================
- Hits         6439     5763     -676     
- Misses       4975     5765     +790     
+ Partials      756      702      -54
Impacted Files Coverage Δ
cmd/restic/cmd_forget.go 33.33% <22%> (-3.47%) ⬇️
internal/backend/b2/b2.go 0% <0%> (-79.32%) ⬇️
internal/backend/swift/swift.go 0% <0%> (-73.9%) ⬇️
internal/backend/azure/azure.go 0% <0%> (-61.93%) ⬇️
internal/backend/gs/gs.go 0% <0%> (-59.85%) ⬇️
internal/backend/swift/config.go 34.37% <0%> (-56.25%) ⬇️
internal/restic/node_darwin.go 100% <0%> (ø)
internal/restic/progress_unix_with_siginfo.go 55.55% <0%> (ø)
cmd/restic/background.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c75a98...ed30bd7. Read the comment docs.

@fd0
Copy link
Member

fd0 commented Sep 10, 2017

Good work, thanks!

@fd0 fd0 merged commit ed30bd7 into restic:master Sep 10, 2017
fd0 added a commit that referenced this pull request Sep 10, 2017
@mungomat mungomat deleted the forget_groupByTagsOnly branch September 17, 2017 15:57
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.

5 participants