diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2025-07-13 22:19:43 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2025-07-13 22:19:43 +0200 |
| commit | 60a08808b920e938418dead74f55ae48b2f0f9c2 (patch) | |
| tree | cbd6170d995ac348e18e94a26ac990a177d98e10 /Opts.hs | |
| parent | bc5d7a6915af2774f17f31641ed249d20311f9ee (diff) | |
| download | werge-60a08808b920e938418dead74f55ae48b2f0f9c2.tar.gz werge-60a08808b920e938418dead74f55ae48b2f0f9c2.tar.bz2 | |
git merging works
Diffstat (limited to 'Opts.hs')
| -rw-r--r-- | Opts.hs | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -143,9 +143,9 @@ data Command , d3old :: FilePath , d3your :: FilePath } - | CmdGitMergetool - { gmtFiles :: Maybe [FilePath] - , gmtDoAdd :: Bool + | CmdGitMerge + { gmFiles :: Maybe [FilePath] + , gmDoAdd :: Bool } deriving (Show) @@ -156,31 +156,33 @@ cmdDiff3 = do strArgument $ metavar "YOURFILE" <> help "version with other people's edits" pure CmdDiff3 {..} -cmdGitMergetool = do - gmtFiles <- +cmdGitMerge = do + gmFiles <- asum - [ fmap Just . many + [ fmap Just . some $ strArgument $ metavar "UNMERGED" - <> help "unmerged git file (can be specified repeatedly" + <> help "unmerged git file (can be specified repeatedly)" , flag' Nothing (long "unmerged" <> short 'u' <> help "process all files marked as unmerged by git") ] - gmtDoAdd <- + gmDoAdd <- asum [ flag' - False + True (long "add" <> short 'a' <> help "run `git add' for fully merged files") - , flag' True (long "no-add" <> help "prevent running `git add'") + , flag' False (long "no-add" <> help "prevent running `git add'") , pure False ] - pure CmdGitMergetool {..} + pure CmdGitMerge {..} +-- TODO have some option to output the (partially merged) my/old/your files so +-- that folks can continue with external program or so (such as meld) cmd = hsubparser $ mconcat @@ -188,7 +190,7 @@ cmd = $ info cmdDiff3 $ progDesc "diff3-style merge of changes" , command "git" - $ info cmdGitMergetool + $ info cmdGitMerge $ progDesc "try to merge unmerged git tree" ] |
