aboutsummaryrefslogtreecommitdiffstats
path: root/Perl
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2019-04-04 01:28:17 +0200
committerGuillem Jover <guillem@debian.org>2019-04-04 14:32:42 +0200
commit97729276414fca15d305e1ab62ff346eb13dcd4e (patch)
tree71f9e3a6f5df521de527598d752205b9130fb6b6 /Perl
parent69ba1b173fccf08a6411f7ec06066103bfeb6d07 (diff)
smart-change: Add new --modified and --commit options
This should help work off the VCS. The --modified option helps with the following workflow: 1) Modify english version; commit. 2) Modify translations; use smart_change with -m; commit. The --commit option helps with the following workflow: 1) Modify english version; commit. 2) Modify translations; commit. 3) Use smart_change with -c from 2); commit.
Diffstat (limited to 'Perl')
-rw-r--r--Perl/Local/VCS_git.pm32
1 files changed, 32 insertions, 0 deletions
diff --git a/Perl/Local/VCS_git.pm b/Perl/Local/VCS_git.pm
index 9bbb17988f8..7f67d9f17e4 100644
--- a/Perl/Local/VCS_git.pm
+++ b/Perl/Local/VCS_git.pm
@@ -1268,6 +1268,38 @@ sub next_revision
return $ret;
}
+=item @files = get_modified_files_from_worktree()
+
+Returns a list of modified files in the current worktree.
+
+=cut
+
+sub get_modified_files_from_worktree
+{
+ my $self = shift;
+
+ my (@files) = qx(git ls-files -m);
+ chomp @files;
+
+ return @files;
+}
+
+=item @files = get_modified_files_from_revision($revid)
+
+Returns a list of modified files in $revid.
+
+=cut
+
+sub get_modified_files_from_revision
+{
+ my ($self, $rev) = @_;
+
+ my (@files) = qx(git diff-tree --no-commit-id --name-only --diff-filter=M -r $rev);
+ chomp @files;
+
+ return @files;
+}
+
=item get_topdir
Return the top dir of the webwml repository

© 2014-2024 Faster IT GmbH | imprint | privacy policy