From 4fcf65cda3f86e5d796f0354afc176de550c00ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 13 Jan 2015 18:36:17 -0400 Subject: [PATCH] devblog --- Command/Sync.hs | 12 +++++++++--- debian/changelog | 1 + doc/devblog/day_246__old_todos.mdwn | 9 +++++++++ doc/git-annex.mdwn | 2 ++ .../wishlist:___96__git_annex_sync_-m__96__.mdwn | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 doc/devblog/day_246__old_todos.mdwn diff --git a/Command/Sync.hs b/Command/Sync.hs index 0433153b1c..5ecd0745a9 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -52,11 +52,17 @@ cmd = [withOptions syncOptions $ seek SectionCommon "synchronize local repository with remotes"] syncOptions :: [Option] -syncOptions = [ contentOption ] +syncOptions = + [ contentOption + , messageOption + ] contentOption :: Option contentOption = flagOption [] "content" "also transfer file contents" +messageOption :: Option +messageOption = fieldOption ['m'] "message" "MSG" "specify commit message" + seek :: CommandSeek seek rs = do prepMerge @@ -139,6 +145,8 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) commit :: CommandStart commit = next $ next $ do + commitmessage <- fromMaybe "git-annex automatic sync" + <$> Annex.getField (optionName messageOption) showStart "commit" "" Annex.Branch.commit "update" ifM isDirect @@ -154,8 +162,6 @@ commit = next $ next $ do ] return True ) - where - commitmessage = "git-annex automatic sync" commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool commitStaged commitmode commitmessage = go =<< inRepo Git.Branch.currentUnsafe diff --git a/debian/changelog b/debian/changelog index 0db52be879..a9b3ffb680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ git-annex (5.20150114) UNRELEASED; urgency=medium on the remote, and their size. This is rather expensive to calculate, so comes last and --fast will disable it. * Git remote info now includes the date of the last sync with the remote. + * sync: Added --message/-m option like git commit. -- Joey Hess Tue, 13 Jan 2015 17:03:39 -0400 diff --git a/doc/devblog/day_246__old_todos.mdwn b/doc/devblog/day_246__old_todos.mdwn new file mode 100644 index 0000000000..6957cff525 --- /dev/null +++ b/doc/devblog/day_246__old_todos.mdwn @@ -0,0 +1,9 @@ +Got a release out today. + +I'm feeling a little under the weather, so wanted something easy to do in +the rest of the day that would be nice and constructive. Ended up going +over the todo list. Old todos come in three groups; hard problems, already +solved, and easy changes that never got done. I left the first group alone, +closed many todos in the second group, and implemented a few easy changes. +Including `git annex sync -m` and adding some more info to `git annex info +remote`. diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 74ce72137d..b8ad6a1d64 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -174,6 +174,8 @@ subdirectories). This behavior can be overridden by configuring the preferred content of a repository. See see PREFERRED CONTENT below. + The `--message` or `-m` option can be used to specify a commit message. + * `merge` This performs the same merging (and merge conflict resolution) diff --git a/doc/todo/wishlist:___96__git_annex_sync_-m__96__.mdwn b/doc/todo/wishlist:___96__git_annex_sync_-m__96__.mdwn index 92b5dee270..c83d4db5c4 100644 --- a/doc/todo/wishlist:___96__git_annex_sync_-m__96__.mdwn +++ b/doc/todo/wishlist:___96__git_annex_sync_-m__96__.mdwn @@ -8,3 +8,4 @@ works, if I run git annex should use that commit message instead of the default ones. That way, I could use [[sync]] directly and not be forced to commit prior to syncing just to make sure I have a useful commit message. +> [[fixed|done]] --[[Joey]]