From 00986d19f47e14ed7e2031c72004678aa1d5d00d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 May 2014 14:43:40 -0400 Subject: [PATCH] group: When no groups are specified to set, lists the current groups of a repository. --- Command/Group.hs | 10 +++++++--- debian/changelog | 2 ++ doc/git-annex.mdwn | 2 ++ ...hlist:_git_annex_group_remote_return_the_group.mdwn | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Command/Group.hs b/Command/Group.hs index b0dbc14653..2b5cd2ec4e 100644 --- a/Command/Group.hs +++ b/Command/Group.hs @@ -26,10 +26,14 @@ start :: [String] -> CommandStart start (name:g:[]) = do showStart "group" name u <- Remote.nameToUUID name - next $ perform u g + next $ setGroup u g +start (name:[]) = do + u <- Remote.nameToUUID name + showRaw . unwords . S.toList =<< lookupGroups u + stop start _ = error "Specify a repository and a group." -perform :: UUID -> Group -> CommandPerform -perform uuid g = do +setGroup :: UUID -> Group -> CommandPerform +setGroup uuid g = do groupChange uuid (S.insert g) next $ return True diff --git a/debian/changelog b/debian/changelog index 98bb833571..fe14e8e79e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ git-annex (5.20140422) UNRELEASED; urgency=medium * Added ddar special remote. Thanks, Robie Basak. * webapp: Fixed drag and drop to reorder the list of remotes. + * group: When no groups are specified to set, lists the current groups + of a repository. -- Joey Hess Fri, 02 May 2014 15:28:53 -0300 diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index bb741810ce..e2f662e647 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -456,6 +456,8 @@ subdirectories). Adds a repository to a group, such as "archival", "enduser", or "transfer". The groupname must be a single word. + Omit the groupname to show the current groups that a repository is in. + * `ungroup repository groupname` Removes a repository from a group. diff --git a/doc/todo/wishlist:_git_annex_group_remote_return_the_group.mdwn b/doc/todo/wishlist:_git_annex_group_remote_return_the_group.mdwn index ace9842ee7..5c8d8b0110 100644 --- a/doc/todo/wishlist:_git_annex_group_remote_return_the_group.mdwn +++ b/doc/todo/wishlist:_git_annex_group_remote_return_the_group.mdwn @@ -7,3 +7,5 @@ It would be good if the command returned the current list of groups the repository belongs to...(can it belong to more than one?) Currently the command requires an additional parameter to set the group. + +> [[done]] --[[Joey]]