summaryrefslogtreecommitdiff
path: root/Git.hs
Commit message (Collapse)AuthorAge
* init: Configure .git/info/attributes to use git-annex as a smudge filter.Gravatar Joey Hess2015-12-04
| | | | | | | | Note that this changes the default behavior of git add in a newly initialized repository; it will add files to the annex. Don't like that this could break workflows, but it's necessary in order for any pointer files in the repo to be handled by git-annex.
* removed all uses of undefined from code baseGravatar Joey Hess2015-04-19
| | | | It's a code smell, can lead to hard to diagnose error messages.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* Switch to using relative paths to the git repository.Gravatar Joey Hess2015-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the git repository to be moved while git-annex is running in it, with fewer problems. On Windows, this avoids some of the problems with the absurdly small MAX_PATH of 260 bytes. In particular, git-annex repositories should work in deeper/longer directory structures than before. See http://git-annex.branchable.com/bugs/__34__git-annex:_direct:_1_failed__34___on_Windows/ There are several possible ways this change could break git-annex: 1. If it changes its working directory while it's running, that would be Bad News. Good news everyone! git-annex never does so. It would also break thread safety, so all such things were stomped out long ago. 2. parentDir "." -> "" which is not a valid path. I had to fix one instace of this, and I should probably wipe all calls to parentDir out of the git-annex code base; it was never a good idea. 3. Things like relPathDirToFile require absolute input paths, and code assumes that the git repo path is absolute and passes it to it as-is. In the case of relPathDirToFile, I converted it to not make this assumption. Currently, the test suite has 16 failures.
* try to avoid Windows MAX_PATH limit, by using \\?\ prefix on git repo pathGravatar Joey Hess2015-01-06
|
* remove Read instance for RefGravatar Joey Hess2014-02-19
| | | | | | | | Removed instance, got it all to build using fromRef. (With a few things that really need to show something using a ref for debugging stubbed out.) Then added back Read instance, and made Logs.View use it for serialization. This changes the view log format.
* squash compiler warnings on WindowsGravatar Joey Hess2013-08-04
|
* missed some __WINDOWS__ definesGravatar Joey Hess2013-08-04
|
* fix permission damage (thanks, Windows)Gravatar Joey Hess2013-05-11
|
* git-annex now builds on Windows (doesn't work)Gravatar Joey Hess2013-05-11
|
* fixup #if 0 stubs to use #ifndef mingw32_HOST_OSGravatar Joey Hess2013-05-10
| | | | | | That's needed in files used to build the configure program. For the other files, I'm keeping my __WINDOWS__ define, as I find that much easier to type. I may search and replace it to use the mingw32_HOST_OS thing later.
* stub out POSIX stuffGravatar Joey Hess2013-05-10
|
* where indentingGravatar Joey Hess2012-11-11
|
* Avoid ugly failure mode when moving content from a local repository that is ↵Gravatar Joey Hess2012-06-26
| | | | | | | | | | | | | | | | | | | not available. Prelude.undefined error message was introduced by bb4f31a0ee496ffb83d31cc56f8827e47605d763. It seems best to filter out local repositories that cannot be accessed from the list of remotes, rather than keeping them in and making every thing that uses the list have to deal with remotes that may have an unknown location. Besides fixing the error message, this also makes unavailable local remotes' names not be shown in various messages, including in git annex status output. Also, move --to an unavailable local repository now avoids some ugly errors like "changeWorkingDirectory: does not exist".
* Clean up handling of git directory and git worktree.Gravatar Joey Hess2012-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Baked into the code was an assumption that a repository's git directory could be determined by adding ".git" to its work tree (or nothing for bare repos). That fails when core.worktree, or GIT_DIR and GIT_WORK_TREE are used to separate the two. This was attacked at the type level, by storing the gitdir and worktree separately, so Nothing for the worktree means a bare repo. A complication arose because we don't learn where a repository is bare until its configuration is read. So another Location type handles repositories that have not had their config read yet. I am not entirely happy with this being a Location type, rather than representing them entirely separate from the Git type. The new code is not worse than the old, but better types could enforce more safety. Added support for core.worktree. Overriding it with -c isn't supported because it's not really clear what to do if a git repo's config is read, is not bare, and is then overridden to bare. What is the right git directory in this case? I will worry about this if/when someone has a use case for overriding core.worktree with -c. (See Git.Config.updateLocation) Also removed and renamed some functions like gitDir and workTree that misused git's terminology. One minor regression is known: git annex add in a bare repository does not print a nice error message, but runs git ls-files in a way that fails earlier with a less nice error message. This is because before --work-tree was always passed to git commands, even in a bare repo, while now it's not.
* removed another 10 lines via ifMGravatar Joey Hess2012-03-16
|
* check hook executabilityGravatar Joey Hess2012-03-14
|
* git-annex-shell: Runs hooks/annex-content after content is received or dropped.Gravatar Joey Hess2012-03-14
|
* configure: Check if ssh connection caching is supported by the installed ↵Gravatar Joey Hess2012-02-25
| | | | version of ssh and default annex.sshcaching accordingly.
* Support unescaped repository urls, like git does.Gravatar Joey Hess2012-01-05
| | | | | | | | Turns out that git will accept a .git/config containing an url with eg, spaces in its name. Handle this by escaping the url if it's not valid. This also fixes support for urls containing escaped characters like %20 for space. Before, the path from the url was not unescaped properly.
* split out Git/Command.hsGravatar Joey Hess2011-12-14
|
* split more stuff out of Git.hsGravatar Joey Hess2011-12-14
|
* remove dead codeGravatar Joey Hess2011-12-13
|
* split out two more Git modulesGravatar Joey Hess2011-12-13
|
* move commit to Git.BranchGravatar Joey Hess2011-12-13
|
* split out three modules from GitGravatar Joey Hess2011-12-13
| | | | | Constructors and configuration make sense in separate modules. A separate Git.Types is needed to avoid cycles.
* split out Git/Ref.hsGravatar Joey Hess2011-12-12
|
* optimize index updatingGravatar Joey Hess2011-12-11
| | | | | | | | | | | The last branch ref that the index was updated to is stored in .git/annex/index.lck, and the index only updated when the current branch ref differs. (The .lck file should later be used for locking too.) Some more optimization is still needed, since there is some redundancy in calls to git show-ref.
* avoid some readGravatar Joey Hess2011-12-09
|
* some work on avoiding partial functionsGravatar Joey Hess2011-12-09
| | | | | There are still hundreds of places that use partial functions head, tail, init, and last.
* error handling cleanupGravatar Joey Hess2011-11-26
| | | | | | Use Control.Exception bracket_; want to catch all errors. System.Posix.Env.getEnv doesn't fail, no need to try it.
* improve type signatures with a Ref newtypeGravatar Joey Hess2011-11-16
| | | | | | | | | | | In git, a Ref can be a Sha, or a Branch, or a Tag. I added type aliases for those. Note that this does not prevent mixing up of eg, refs and branches at the type level. Since git really doesn't care, except rare cases like git update-ref, or git tag -d, that seems ok for now. There's also a tree-ish, but let's just use Ref for it. A given Sha or Ref may or may not be a tree-ish, depending on the object type, so there seems no point in trying to represent it at the type level.
* further insteadOf fixGravatar Joey Hess2011-11-15
|
* Fix support for insteadOf url remapping. Closes: #644278Gravatar Joey Hess2011-11-15
|
* factored out some useful error catching methodsGravatar Joey Hess2011-11-10
|
* reorder repo parameters lastGravatar Joey Hess2011-11-08
| | | | | | | | | | | | | Many functions took the repo as their first parameter. Changing it consistently to be the last parameter allows doing some useful things with currying, that reduce boilerplate. In particular, g <- gitRepo is almost never needed now, instead use inRepo to run an IO action in the repo, and fromRepo to get a value from the repo. This also provides more opportunities to use monadic and applicative combinators.
* reorganize log modulesGravatar Joey Hess2011-10-15
| | | | no code changes
* tweakGravatar Joey Hess2011-10-15
|
* A remote can have a annexUrl configured, that is used by git-annex instead ↵Gravatar Joey Hess2011-10-14
| | | | of its usual url. (Similar to pushUrl.)
* add comment about relative/absolute filenamesGravatar Joey Hess2011-10-11
|
* force files relativeGravatar Joey Hess2011-10-11
| | | | | | | Other code is currently depending on checkAttr forcing absolute filenames to relative, so keep it doing so. This is a quick fix, and should sometime be moved elsewhere.
* fix git 1.7.7 breakageGravatar Joey Hess2011-10-11
| | | | | | | | | | | | | | | | * This version of git-annex only works with git 1.7.7 and newer. The breakage with old versions is subtle, and affects annex.numcopies .gitattributes settings, so be sure to upgrade git to 1.7.7. (Debian package now depends on that version.) * Don't pass absolute paths to git show-attr, as it started following symlinks when that's done in 1.7.7. Instead, use relative paths, which show-attr only handles 100% correctly in 1.7.7. Closes: #645046 Unfortunatly I can find no way to work with the old and new gits, as the old had bugs that require absolute paths, while the new doesn't like them at all. And the behavior of git show-attr in 1.7.7. is the same as eg, git add of an absolute path to a symlink, so seems entirely intentional and not likely to change.
* Now supports git's insteadOf configuration, to modify the url used to access ↵Gravatar Joey Hess2011-10-09
| | | | a remote. Note that pushInsteadOf is not used; that and pushurl are reserved for actual git pushes. Closes: #644278
* factor out common importsGravatar Joey Hess2011-10-03
| | | | no code changes
* convert all git read/write functions to use ByteStringsGravatar Joey Hess2011-09-29
| | | | | | | | | | This yields a second or so speedup in unused, find, etc. Seems that even when the ByteString is immediately split and then converted to Strings, it's faster. I may try to push ByteStrings out into more of git-annex gradually, although I suspect most of the time-critical parts are already covered now, and many of the rest rely on libraries that only support Strings.
* use ByteStrings when reading content of filesGravatar Joey Hess2011-09-29
| | | | didn't bother to benchmark this
* Sped up unused.Gravatar Joey Hess2011-09-29
| | | | | | | | | | | | | Added Git.ByteString which replaces Git IO methods with ones using lazy ByteStrings. This can be more efficient when large quantities of data are being read from git. In Git.LsTree, parse git ls-tree output more efficiently, thanks to ByteString. This benchmarks 25% faster, in a benchmark that includes (probably predominately) the run time for git ls-tree itself. In real world numbers, this makes git annex unused 2 seconds faster for each branch it needs to check, in my usual large repo.
* refine new unused codeGravatar Joey Hess2011-09-28
| | | | | | | | | Fixed the laziness space leak, so it runs in 60 mb or so again. Slightly faster due to using Data.Set.difference now, although this also makes it use slightly more memory. Also added display of the refs being checked, and made unused --from also check all refs for things in the remote.
* golfGravatar Joey Hess2011-09-28
|
* go go gadget hlintGravatar Joey Hess2011-09-20
|