summaryrefslogtreecommitdiff
path: root/Git
Commit message (Collapse)AuthorAge
...
* comment typoGravatar Joey Hess2012-02-13
|
* wordingGravatar Joey Hess2012-02-09
|
* use fileEncoding for git-update-index input handleGravatar Joey Hess2012-02-04
|
* fix file encoding of HashObjectGravatar Joey Hess2012-02-04
|
* support all filename encodings with ghc 7.4Gravatar Joey Hess2012-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under ghc 7.4, this seems to be able to handle all filename encodings again. Including filename encodings that do not match the LANG setting. I think this will not work with earlier versions of ghc, it uses some ghc internals. Turns out that ghc 7.4 has a special filesystem encoding that it uses when reading/writing filenames (as FilePaths). This encoding is documented to allow "arbitrary undecodable bytes to be round-tripped through it". So, to get FilePaths from eg, git ls-files, set the Handle that is reading from git to use this encoding. Then things basically just work. However, I have not found a way to make Text read using this encoding. Text really does assume unicode. So I had to switch back to using String when reading/writing data to git. Which is a pity, because it's some percent slower, but at least it works. Note that stdout and stderr also have to be set to this encoding, or printing out filenames that contain undecodable bytes causes a crash. IMHO this is a misfeature in ghc, that the user can pass you a filename, which you can readFile, etc, but that default, putStr of filename may cause a crash! Git.CheckAttr gave me special trouble, because the filenames I got back from git, after feeding them in, had further encoding breakage. Rather than try to deal with that, I just zip up the input filenames with the attributes. Which must be returned in the same order queried for this to work. Also of note is an apparent GHC bug I worked around in Git.CheckAttr. It used to forkProcess and feed git from the child process. Unfortunatly, after this forkProcess, accessing the `files` variable from the parent returns []. Not the value that was passed into the function. This screams of a bad bug, that's clobbering a variable, but for now I just avoid forkProcess there to work around it. That forkProcess was itself only added because of a ghc bug, #624389. I've confirmed that the test case for that bug doesn't reproduce it with ghc 7.4. So that's ok, except for the new ghc bug I have not isolated and reported. Why does this simple bit of code magnet the ghc bugs? :) Also, the symlink touching code is currently broken, when used on utf-8 filenames in a non-utf-8 locale, or probably on any filename containing undecodable bytes, and I temporarily commented it out.
* attempt at a quick, utf-8 only fix to the ghc 7.4 problemGravatar Joey Hess2012-02-01
| | | | | If you have only utf-8 filenames, and need to build git-annex with ghc 7.4, this will work. But, it will crash on non-utf-8 filenames.
* switch to the strict state monadGravatar Joey Hess2012-01-29
| | | | | | | | | | I had not realized what a memory leak the lazy state monad could be, although I have not seen much evidence of actual leaking in git-annex. However, if running git-annex on a great many files, this could matter. The additional Utility.State.changeState adds even more strictness, avoiding a problem I saw in github-backup where repeatedly modifying state built up a huge pile of thunks.
* fix error messageGravatar Joey Hess2012-01-25
|
* export fromPathGravatar Joey Hess2012-01-25
| | | | Not used in git-annex, but I am using it in git-backup
* remove Utility.Conditional and use IfElseGravatar Joey Hess2012-01-24
| | | | | | | This drops the >>! and >>? with the nice low fixity. IfElse does have undocumented >>=>>! and >>=>>? operators, but I deem that too fishy. Anyway, using whenM and unlessM is easier; I sometimes mixed the operators up.
* rename readMaybe to readishGravatar Joey Hess2012-01-23
| | | | a stricter (but also partial) readMaybe is getting added to base
* avoid unnecessary stats when traversing to parentGravatar Joey Hess2012-01-14
|
* avoid unnecessary chdirGravatar Joey Hess2012-01-14
|
* optimize away 3 statsGravatar Joey Hess2012-01-14
|
* tweakGravatar Joey Hess2012-01-13
|
* support relative GIT_DIRGravatar Joey Hess2012-01-13
|
* git-annex, git-union-merge: Support GIT_DIR and GIT_WORK_TREE.Gravatar Joey Hess2012-01-13
| | | | | Note that GIT_WORK_TREE cannot influence GIT_DIR; that is necessary for git-fake-bare and vcsh type things to work.
* Add annex-trustlevel configuration settings, which can be used to override ↵Gravatar Joey Hess2012-01-09
| | | | | | | | | | | | | the trust level of a remote. This overrides the trust.log, and is overridden by the command-line trust parameters. It would have been nicer to have Logs.Trust.trustMap just look up the configuration for all remotes, but a dependency loop prevented that (Remotes depends on Logs.Trust in several ways). So instead, look up the configuration when building remotes, storing it in the same forcetrust field used for the command-line trust parameters.
* log --after=dateGravatar Joey Hess2012-01-06
|
* 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.
* skip local remotes that are not available (ie, not mounted)Gravatar Joey Hess2011-12-31
| | | | | | | With --fast, unavailable local remotes are filtered out of the fast set. This way, if there are local remotes, --fast always acts only on them, and if none are mounted, acts on nothing. This consistency is better than --fast acting on different remotes depending on what's mounted.
* refactor and check for a detached HEADGravatar Joey Hess2011-12-31
|
* refactorGravatar Joey Hess2011-12-30
|
* add base, underGravatar Joey Hess2011-12-30
| | | | | | | | | The describe function was only intended to generate a human-visible description of a branch, but taking the base of a branch is a useful operation to be able to do no matter the human-visible representation. Converting a branch like refs/heads/master to refs/heads/origin/master is also a useful operation, and under can do that.
* fixed behavior when multiple insteadOf configs are provided for the same url ↵Gravatar Joey Hess2011-12-30
| | | | | | | | | | | | | | | | | | | | | | | base Consider this git config --list case: url.git+ssh://git@example.com/.insteadOf=gl url.git+ssh://git@example.com/.insteadOf=shared Since config is stored in a Map, only the last of the values for this key was stored and available for use by the insteadOf code. But that is wrong; git allows either "gl" or "shared" to be used in an url and the insteadOf value to be substituted in. To support this, it seems best to keep the existing config map as-is, and add a second map that accumulates a list of multiple values for config keys. This new fullconfig map can be used in the rare places where multiple values for a key make sense, without needing to complicate everything else. Haskell's laziness and data sharing keep the overhead of adding this second map low.
* handle C-style escapes in FormatGravatar Joey Hess2011-12-23
| | | | | | | | | | | I was happily able to repurpose some code from Git.Filename to handle this. I remember writing that code... a whole afternoon at a coffee shop, after which I felt I'd struggled with Haskell and git, and sorta lost, in needing to write this nasty peice of code. But was also pleased at the use of a pair of functions and quickcheck that allowed me to get it 100% right. So, turns out I not only got it right, but the code wasn't as special-purpose as I'd feared. Yay!
* Can now be built with older git versions (before 1.7.7); the resulting ↵Gravatar Joey Hess2011-12-22
| | | | | | | binary should only be used with old git. Remove git old version check from configure, and use the git version it was built against in the git check-attr code.
* Add --include, which is the same as --not --exclude.Gravatar Joey Hess2011-12-22
|
* use Common in a few more modulesGravatar Joey Hess2011-12-20
|
* more partial function removalGravatar Joey Hess2011-12-15
| | | | | Left a few Prelude.head's in where it was checked not null and too hard to remove, etc.
* avoid partial function, and parse git-ref output betterGravatar Joey Hess2011-12-15
| | | | | It's possible that a ref name might contain a space, this properly preserves the space.
* avoid partial head functionGravatar Joey Hess2011-12-15
| | | | (although it was used safely)
* avoid partial functions, and added check for correct sha contentGravatar Joey Hess2011-12-15
|
* refactorGravatar Joey Hess2011-12-15
|
* Properly handle multiline git config values.Gravatar Joey Hess2011-12-15
| | | | | | | | | | A crash on parsing was fixed a while ago. This adds support for fully correctly parsing multiline git config values, using git config --null. Since git-annex-shell configlist uses normal git config output, I left in support for that too; the two forms of config output can be easily identified by the parser. Since configlist only prints the annex.uuid config, there's no risk of multiline values there, so no need to change it.
* split out Git/Command.hsGravatar Joey Hess2011-12-14
|
* split more stuff out of Git.hsGravatar Joey Hess2011-12-14
|
* 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.
* avoid closing pipe before all the shas are read from itGravatar Joey Hess2011-12-12
| | | | | | | Could have just used hGetContentsStrict here, but that would require storing all the shas in memory. Since this is called at the end of a git-annex run, it may have created a *lot* of shas, so I avoid that memory use and stream them out like before.
* broke out Git/HashObject.hsGravatar Joey Hess2011-12-12
|
* broke out Git/Branch.hs and reorganizedGravatar Joey Hess2011-12-12
|
* split out Git/Ref.hsGravatar Joey Hess2011-12-12
|
* always find optimal mergeGravatar Joey Hess2011-12-12
| | | | | | | | | | Testing b9ac5854549636493449fea6830364a01159fbf6, it didn't find the optimal union merge, the second sha was the one to use, at least in the case I tried. Let's just try all shas to see if any can be reused. I stopped using the expensive nub, so despite the use of sets to sort/uniq file contents, this is probably as fast or faster than it was before.
* refactorGravatar Joey Hess2011-12-12
|
* more efficient union mergesGravatar Joey Hess2011-12-11
| | | | | | | | | | | | | | Tries to avoid generating a new object when the merged content has the same lines that were in the old object. I've noticed some merge commits that only move lines around, like this: - 1323478057.181191s 1 be23c3ac-0ee5-11e0-b185-3b0f9b5b00c5 1323204972.062151s 1 87e06c7a-7388-11e0-ba07-03cdf300bd87 ++1323478057.181191s 1 be23c3ac-0ee5-11e0-b185-3b0f9b5b00c5 Unsure if this will really save anything in practice, since it only looks at one of the two old objects, and maybe I didn't pick the best one.
* hslintGravatar Joey Hess2011-12-09
|
* 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.
* better nameGravatar Joey Hess2011-11-16
|