aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/git.pm
Commit message (Collapse)AuthorAge
* git: don't redundantly pass "--" to git_sha1Simon McVittie2017-01-09
| | | | | | | | | | | | | | | git_sha1 already puts "--" before its arguments, so git_sha1_file($dir, 'doc/index.mdwn') would have incorrectly invoked git rev-list --max-count=1 HEAD -- -- doc/index.mdwn If there is no file in the wiki named "--", that's harmless, because it merely names the latest revision in which either "--" or "doc/index.mdwn" changed. However, it could return incorrect results if there is somehow a file named "--".
* git: use parameters, not global state, to swap working directorySimon McVittie2017-01-09
|
* Revert "git: Turn $git_dir into a stack"Simon McVittie2017-01-09
| | | | | | | Now that we have avoided using in_git_dir recursively, we don't need the stack any more. This reverts commit 39b8931ad31fe6b48afdc570caa459a0996c2092.
* git: do not mix in_git_dir with eval{}Simon McVittie2017-01-09
| | | | | | | | If we throw an exception (usually from run_or_die), in_git_dir won't unshift the current directory from the stack. That's usually fine, but in rcs_preprevert we catch exceptions and do some cleanup before returning, for which we need the git directory to be the root and not the temporary working tree.
* git: Do not disable commit hook for temporary working treeSimon McVittie2016-12-29
| | | | | | | | We exclude .git/hooks from symlinking into the temporary working tree, which avoids the commit hook being run for the temporary branch anyway. This avoids the wiki not being updated if an orthogonal change is received in process A, while process B prepares a revert that is subsequently cancelled.
* git: Attribute reverts to the user doing the revert, not the wiki itselfSimon McVittie2016-12-29
|
* git: write proposed attachment to temp file without going via system()Simon McVittie2016-12-28
|
* git: change calling convention of safe_git to have named argumentsSimon McVittie2016-12-28
|
* git: Do the revert operation in a secondary working treeSimon McVittie2016-12-28
| | | | | This avoids leaving the git directory in an inconsistent state if the host system is rebooted while we are processing a revert.
* git: Turn $git_dir into a stackSimon McVittie2016-12-28
| | | | | | This will be necessary when we use a secondary working tree to do reverts without leaving the primary working tree in an inconsistent state.
* Try revert operations (on a branch) before approving themSimon McVittie2016-12-28
| | | | | | | | | | | | | | | | | Otherwise, we have a time-of-check/time-of-use vulnerability: rcs_preprevert previously looked at what changed in the commit we are reverting, not at what would result from reverting it now. In particular, if some files were renamed since the commit we are reverting, a revert of changes that were within the designated subdirectory and allowed by check_canchange() might now affect files that are outside the designated subdirectory or disallowed by check_canchange(). It is not sufficient to disable rename detection, since git older than 2.8.0rc0 (in particular the version in Debian stable) silently accepts and ignores the relevant options. OVE-20161226-0002
* Revert "Tell `git revert` not to follow renames"Simon McVittie2016-12-28
| | | | | | | This doesn't work prior to git 2.8: `git revert` silently ignores the option and succeeds. We will have to fix CVE-2016-10026 some other way. This reverts commit 9cada49ed6ad24556dbe9861ad5b0a9f526167f9.
* git: do not fail to commit if committer is anonymousSimon McVittie2016-12-28
|
* git: don't issue a warning if rcsinfo is undefinedSimon McVittie2016-12-28
| | | | | | The intention here seems to be that $prev may be undefined, and the only way that can legitimately happen is for $params{token} to be undefined too.
* Tell `git revert` not to follow renamesSimon McVittie2016-12-19
| | | | | | | | | | | | Otherwise, we have an authorization bypass vulnerability: rcs_preprevert looks at what changed in the commit we are reverting, not at what would result from reverting it now. In particular, if some files were renamed since the commit we are reverting, a revert of changes that were within the designated subdirectory and allowed by check_canchange() might now affect files that are outside the designated subdirectory or disallowed by check_canchange(). Signed-off-by: Simon McVittie <smcv@debian.org>
* Use git log --no-renames for recentchangesSimon McVittie2016-09-03
| | | | | | | Otherwise, recent git releases show renames as renames, and we do not see that newdir/test5 was affected. Bug-Debian: https://bugs.debian.org/835612
* Correctly handle filenames starting with a dash in add/rm/mv.Florian Wagner2016-03-17
|
* ensure_committer: don't do anything if we have the environment variablesSimon McVittie2015-11-30
|
* Don't memoize ensure_committerSimon McVittie2015-11-30
| | | | | This makes it harder to test, and if we're invoking git anyway, a couple of extra subprocesses are no big deal.
* git: if no committer identity is known, set it to "IkiWiki <ikiwiki.info>" ↵Simon McVittie2015-11-30
| | | | | | | in .git/config This resolves commit errors in versions of git that require a non-trivial committer identity.
* cloak user PII when making commits etc, and let cloaked PII be used in ↵Joey Hess2015-05-14
| | | | | | | | | | | | | | banned_users This was needed due to emailauth, but I've also wrapped all IP address exposure in cloak(), although the function doesn't yet cloak IP addresses. (One IP address I didn't cloak is the one that appears on the password reset email template. That is expected to be the user's own IP address, so ok to show it to them.) Thanks to smcv for the pointer to http://xmlns.com/foaf/spec/#term_mbox_sha1sum
* only_committed_changes could fail in a git repository merged with git merge ↵Joey Hess2014-04-05
| | | | -s ours.
* Merge remote-tracking branch 'remotes/smcv/ready/git-push-origin-master'Joey Hess2014-02-23
|\
| * git: explicitly specify the branch to push to originSimon McVittie2014-02-21
| | | | | | | | | | | | | | | | | | | | git's behaviour when doing "git push origin" is configurable, and the default is going to change in 2.0. In particular, if you've set push.default to "nothing", the regression test will warn: fatal: You didn't specify any refspecs to push, and push.default is "nothing". 'git push origin' failed: at .../lib/IkiWiki/Plugin/git.pm line 220.
* | Do not UTF8-escape "/" in Git's diffurl: cgit does not support this.intrigeri2013-12-31
|/
* deal with the case where oldrev is the same as newrevJoey Hess2013-11-16
|
* fix eqJoey Hess2013-11-16
|
* Added only_committed_changes config setting, which speeds up wiki refresh by ↵Joey Hess2013-11-16
| | | | querying git to find the files that were changed, rather than looking at the work tree. Not enabled by default as it can break some setups where not all files get committed to git.
* Pass --no-edit when used with git 1.7.8 and newer.Joey Hess2013-07-10
| | | | | | | | | Not sure if this is needed to avoid it trying to run an editor. Probably there is never a controlling terminal and probably git notices and does nothing. But I'm just copying what I have in git-annex assistant here. (Although with a much worse git version comparion, that only really works due to luck.)
* Deal with git behavior change in 1.7.8 and newer that broke support for ↵Joey Hess2013-07-10
| | | | commits with an empty commit message.
* Fix some warnigns in recent perls.Shlomi Fish2012-12-17
| | | | All existing tests pass.
* remove debug messageJoey Hess2012-03-22
| | | | | | A file may have no git sha1 if it's in the underlay, or just is not checked into git. This debug message doesn't add any value and is potentially confusing.
* URI escape filename when generating the diffurl.Joey Hess2012-03-13
| | | | | ikiwiki source files can contain at least one character that needs to be escaped in an url: +
* fix display of page name in recentchanges after a revertJoey Hess2012-02-07
| | | | | | | | | | | When the wiki is in a subdir of the git repo, a web revert would show in recentchanges as eg, doc/index, instead of just index. This happened because decode_git_file caches a $prefix that is dependant on the $git_dir setting, and the revert code runs with a different $git_dir, which polluted the $prefix for later. Fix this by adding a with_git_dir that juggles the variables properly.
* Fix web revert of a file deletion.Joey Hess2011-09-05
| | | | When reverting, an add is a remove, and a remove is an add.
* git: Fix bug involving attempting to web revert a commit that included ↵Joey Hess2010-12-29
| | | | changes to attachments.
* bugfixJoey Hess2010-12-29
|
* Add a second parameter to the rcs_diff hook, and avoid bloating memory ↵Joey Hess2010-12-29
| | | | reading in enormous commits.
* git: Avoid adding files when committing, so as not to implicitly add files ↵Joey Hess2010-11-29
| | | | like recentchanges files that are not normally checked in, when fixing links after rename.
* git: Fix temp file location.Joey Hess2010-11-29
|
* Use author date instead of commit dateTuomas Jormola2010-10-31
| | | | Signed-off-by: Tuomas Jormola <tj@solitudo.net>
* nice message if someone tries to revert a merge commitJoey Hess2010-10-23
|
* bugfixJoey Hess2010-10-23
|
* fix web reversion when the srcdir is in a subdir of the git repo.Joey Hess2010-10-23
|
* taint handling for revJoey Hess2010-10-08
|
* remove todo itemJoey Hess2010-10-08
| | | | | | | I understand the need to avoid chdir when running git_parse_changes for receive now. At that point, the changes have not been pushed to the srcdir's repo yet. When running the same code for preprevert, chdir to the srcdir is ok, and necessary.
* fix rcs_prepedit implementation to match specJoey Hess2010-10-08
|
* convert rcs_revert to only stage the reversionJoey Hess2010-10-06
|
* remove rcs_showpatchJoey Hess2010-10-06
|
* fix $git_root cachingJoey Hess2010-10-04
|