This commit is contained in:
Joey Hess 2015-01-13 18:36:17 -04:00
parent ead09207ca
commit 4fcf65cda3
5 changed files with 22 additions and 3 deletions

View file

@ -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

1
debian/changelog vendored
View file

@ -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 <id@joeyh.name> Tue, 13 Jan 2015 17:03:39 -0400

View file

@ -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`.

View file

@ -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)

View file

@ -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]]