-
Notifications
You must be signed in to change notification settings - Fork 520
update to allow removing pending changes #856
Conversation
|
Seems like the |
cmd/notary/tuf.go
Outdated
|
|
||
| cmd.AddCommand(cmdTUFStatusTemplate.ToCommand(t.tufStatus)) | ||
| cmdStatus := cmdTUFStatusTemplate.ToCommand(t.tufStatus) | ||
| cmdStatus.Flags().IntSliceVarP(&t.changes, "unstage", "u", nil, "Numbers of changes to delete, as show in status list") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/show/shown
|
took this out for a spin and the functionality is great! Just a couple of small nits, can't wait for when tests are ready :) |
client/changelist/file_changelist.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
| sort.Sort(fileChanges(fileInfos)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we factor out the first few lines of this function and List into a helper for getting back a sorted list of []os.FileInfo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just make list and the iterator getFileNames return in a deterministic (sorted) order
d98d195 to
677cb1f
Compare
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
…change can't be applied before aborting Signed-off-by: David Lawrence <[email protected]> (github: endophage)
| } | ||
|
|
||
| // Remove deletes the changes found at the given indices | ||
| func (cl *memChangelist) Remove(idxs []int) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test for this method? I think the cmd functions only use file changelists which is why it isn't covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Signed-off-by: David Lawrence <[email protected]> (github: endophage)
677cb1f to
57379e8
Compare
|
LGTM pending CI |
| } | ||
|
|
||
| cmd.Printf("Unpublished changes for %s:\n\n", gun) | ||
| cmd.Printf("%-10s%-10s%-12s%s\n", "action", "scope", "type", "path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for fixing this formatting! It looks much nicer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big fan of tabwriter now that I've discovered it :-)
|
LGTM pending CI! |
Needs tests
Partially addresses #596
Adds
--resetand--unstageflags tonotary status.resetremoves all pending changes for the GUN,unstageallows specific changes to be removed based on their # as shown innotary statusSigned-off-by: David Lawrence [email protected] (github: endophage)