From 46d38b002d50a696dd4f190d3ef550f8a141f80a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Feb 2025 12:37:36 -0400 Subject: [PATCH] remove the git-union-merge command This has never been built and shipped as part of git-annex, and including it as a pedagolical example in the source code doesn't have much benefit. The program was not currently buildable after recent OsPath changes. Of course, Git/UnionMerge.hs is still available and can be used. --- .gitignore | 2 - Makefile | 10 +---- doc/bugs/How_to_git_union-merge__63__.mdwn | 2 + doc/git-union-merge.mdwn | 38 ---------------- doc/internals.mdwn | 2 +- git-union-merge.hs | 50 ---------------------- 6 files changed, 5 insertions(+), 99 deletions(-) delete mode 100644 doc/git-union-merge.mdwn delete mode 100644 git-union-merge.hs diff --git a/.gitignore b/.gitignore index e21cbf9c80..125468c04f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ git-annex git-annex-shell git-remote-annex man -git-union-merge -git-union-merge.1 doc/.ikiwiki html *.tix diff --git a/Makefile b/Makefile index a0939a9e9b..b2ee54db83 100644 --- a/Makefile +++ b/Makefile @@ -74,12 +74,6 @@ git-annex-shell: git-annex git-remote-annex: git-annex ln -sf git-annex git-remote-annex -# These are not built normally. -git-union-merge.1: doc/git-union-merge.mdwn - ./Build/mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1 -git-union-merge: - $(GHC) --make -threaded $@ - install-mans: mans install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/man/man1 install -m 0644 man/*.1 $(DESTDIR)$(PREFIX)/$(SHAREDIR)/man/man1 @@ -146,7 +140,7 @@ clean: doc/.ikiwiki html dist tags Build/SysConfig Build/Version \ Setup Build/InstallDesktopFile Build/Standalone \ Build/DistributionUpdate Build/BuildVersion Build/MakeMans \ - git-annex-shell git-remote-annex git-union-merge .tasty-rerun-log + git-annex-shell git-remote-annex .tasty-rerun-log find . -name \*.o -exec rm {} \; find . -name \*.hi -exec rm {} \; @@ -241,4 +235,4 @@ distributionupdate: ghc -Wall -fno-warn-tabs --make Build/DistributionUpdate -XLambdaCase -XPackageImports ./Build/DistributionUpdate -.PHONY: git-annex git-union-merge tags +.PHONY: git-annex tags diff --git a/doc/bugs/How_to_git_union-merge__63__.mdwn b/doc/bugs/How_to_git_union-merge__63__.mdwn index 3272cd2508..d3beff71f2 100644 --- a/doc/bugs/How_to_git_union-merge__63__.mdwn +++ b/doc/bugs/How_to_git_union-merge__63__.mdwn @@ -22,3 +22,5 @@ Tried with (on a Manjaro box): git-annex rules and is a marvelous tool. I wanted to try the union merging to resolve merge conflicts on non-annexed files. It's not ideal, but might be better than repeated `git annex assist|sync` eventually adding the merge conflict markers `<<<<<<<<<` and the like to the files, breaking things like `.gitattributes` syntax which in turn has more devastating lockup consequences... + +> removed it, [[done]] --[[Joey]] diff --git a/doc/git-union-merge.mdwn b/doc/git-union-merge.mdwn deleted file mode 100644 index ca06d2f933..0000000000 --- a/doc/git-union-merge.mdwn +++ /dev/null @@ -1,38 +0,0 @@ -# NAME - -git-union-merge - Join branches together using a union merge - -# SYNOPSIS - -git union-merge ref ref newref - -# DESCRIPTION - -Does a union merge between two refs, storing the result in the -specified newref. - -The union merge will always succeed, but assumes that files can be merged -simply by concatenating together lines from all the oldrefs, in any order. -So, this is useful only for branches containing log-type data. - -Note that this does not touch the checked out working copy. It operates -entirely on git refs and branches. - -# EXAMPLE - - git union-merge git-annex origin/git-annex refs/heads/git-annex - -Merges the current git-annex branch, and a version from origin, -storing the result in the git-annex branch. - -# BUGS - -File modes are not currently merged. - -# AUTHOR - -Joey Hess - - - -Warning: Automatically converted into a man page by mdwn2man. Edit with care diff --git a/doc/internals.mdwn b/doc/internals.mdwn index 06a98e9559..5b9d7fbfb8 100644 --- a/doc/internals.mdwn +++ b/doc/internals.mdwn @@ -68,7 +68,7 @@ internal tracking of information about git-annex repositories and annexed objects. The files stored in this branch are all designed to be auto-merged -using git's [[union merge driver|git-union-merge]]. So each line +by simply concacenating them together. So each line has a timestamp, to allow the most recent information to be identified. ### `uuid.log` diff --git a/git-union-merge.hs b/git-union-merge.hs deleted file mode 100644 index c499c530df..0000000000 --- a/git-union-merge.hs +++ /dev/null @@ -1,50 +0,0 @@ -{- git-union-merge program - - - - Copyright 2011 Joey Hess - - - - Licensed under the GNU AGPL version 3 or higher. - -} - -import System.Environment - -import Common -import qualified Git.UnionMerge -import qualified Git.Config -import qualified Git.CurrentRepo -import qualified Git.Branch -import qualified Git.Index -import qualified Git -import Utility.FileSystemEncoding - -header :: String -header = "Usage: git-union-merge ref ref newref" - -usage :: IO a -usage = error $ "bad parameters\n\n" ++ header - -tmpIndex :: Git.Repo -> FilePath -tmpIndex g = Git.localGitDir g "index.git-union-merge" - -setup :: Git.Repo -> IO () -setup = cleanup -- idempotency - -cleanup :: Git.Repo -> IO () -cleanup g = nukeFile $ tmpIndex g - -parseArgs :: IO [String] -parseArgs = do - args <- getArgs - if length args /= 3 - then usage - else return args - -main :: IO () -main = do - useFileSystemEncoding - [aref, bref, newref] <- map Git.Ref <$> parseArgs - g <- Git.Config.read =<< Git.CurrentRepo.get - _ <- Git.Index.override (tmpIndex g) g - setup g - Git.UnionMerge.merge aref bref g - _ <- Git.Branch.commit Git.Branch.ManualCommit False "union merge" newref [aref, bref] g - cleanup g