aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/git.pm20
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/git_commit_adds_files_that_were_not_tracked.mdwn3
3 files changed, 16 insertions, 10 deletions
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 39d88d002..3db4af729 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -496,16 +496,16 @@ sub rcs_commit (@) {
return $conflict if defined $conflict;
}
- rcs_add($params{file});
- return rcs_commit_staged(
- message => $params{message},
- session => $params{session},
- );
+ return rcs_commit_helper(@_);
}
sub rcs_commit_staged (@) {
# Commits all staged changes. Changes can be staged using rcs_add,
# rcs_remove, and rcs_rename.
+ return rcs_commit_helper(@_);
+}
+
+sub rcs_commit_helper (@) {
my %params=@_;
my %env=%ENV;
@@ -546,10 +546,12 @@ sub rcs_commit_staged (@) {
$params{message}.=".";
}
}
- push @opts, '-q';
- # git commit returns non-zero if file has not been really changed.
- # so we should ignore its exit status (hence run_or_non).
- if (run_or_non('git', 'commit', @opts, '-m', $params{message})) {
+ if (exists $params{file}) {
+ push @opts, '--', $params{file};
+ }
+ # git commit returns non-zero if nothing really changed.
+ # So we should ignore its exit status (hence run_or_non).
+ if (run_or_non('git', 'commit', '-m', $params{message}, '-q', @opts)) {
if (length $config{gitorigin_branch}) {
run_or_cry('git', 'push', $config{gitorigin_branch});
}
diff --git a/debian/changelog b/debian/changelog
index bab5eeb88..1ae992b7a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,9 @@ ikiwiki (3.20101113) UNRELEASED; urgency=low
as a template for a new page.
* git: Fix temp file location.
* rename: Fix to pass named parameters to rcs_commit.
+ * git: Avoid adding files when committing, so as not to implicitly add
+ files like recentchanges files that are not normally checked in,
+ when fixing links after rename.
-- Joey Hess <joeyh@debian.org> Tue, 16 Nov 2010 14:23:47 -0400
diff --git a/doc/bugs/git_commit_adds_files_that_were_not_tracked.mdwn b/doc/bugs/git_commit_adds_files_that_were_not_tracked.mdwn
index 829e80327..587650c61 100644
--- a/doc/bugs/git_commit_adds_files_that_were_not_tracked.mdwn
+++ b/doc/bugs/git_commit_adds_files_that_were_not_tracked.mdwn
@@ -15,4 +15,5 @@ because of the link fixup code run when renaming a page. --[[Joey]]
> 'git add .' to be called. I've fixed that.
>
> I think there is still potential for the problem I described above to
-> occur during a rename or possibly otherwise. --[[Joey]]
+> occur during a rename or possibly otherwise. Ok.. fixed `rcs_commit`
+> to not add too. [[done]] --[[Joey]]