# HG changeset patch # User Marcin Kuzminski # Date 2013-03-21 22:56:17 # Node ID c04d1d9b6193b4dfdd100052084a47c58cccbe03 # Parent 835d44dd6ed835cdccf4550b44d2659789a62764 made git refs filter configurable ref issue #797 - default --all was kept and --branches --tags (or even other variations) is possible to use via .ini file diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -98,6 +98,10 @@ use_gravatar = true ## path to git executable git_path = git +## git rev filter option, --all is the default filter, if you need to +## hide all refs in changelog switch this to --branches --tags +git_rev_filter=--all + ## RSS feed options rss_cut_off_limit = 256000 rss_items_per_page = 10 diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -98,6 +98,10 @@ use_gravatar = true ## path to git executable git_path = git +## git rev filter option, --all is the default filter, if you need to +## hide all refs in changelog switch this to --branches --tags +git_rev_filter=--all + ## RSS feed options rss_cut_off_limit = 256000 rss_items_per_page = 10 diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -98,6 +98,10 @@ use_gravatar = true ## path to git executable git_path = git +## git rev filter option, --all is the default filter, if you need to +## hide all refs in changelog switch this to --branches --tags +git_rev_filter=--all + ## RSS feed options rss_cut_off_limit = 256000 rss_items_per_page = 10 diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py --- a/rhodecode/lib/vcs/backends/git/changeset.py +++ b/rhodecode/lib/vcs/backends/git/changeset.py @@ -187,8 +187,10 @@ class GitChangeset(BaseChangeset): """ Returns list of children changesets. """ + rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter', + '--all').strip() so, se = self.repository.run_git_command( - "rev-list --all --children | grep '^%s'" % self.raw_id + "rev-list %s --children | grep '^%s'" % (rev_filter, self.raw_id) ) children = [] diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -231,7 +231,9 @@ class GitRepository(BaseRepository): self._repo.head() except KeyError: return [] - cmd = 'rev-list --all --reverse --date-order' + rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter', + '--all').strip() + cmd = 'rev-list %s --reverse --date-order' % (rev_filter) try: so, se = self.run_git_command(cmd) except RepositoryError: @@ -505,7 +507,9 @@ class GitRepository(BaseRepository): cmd_template += ' $branch_name' cmd_params['branch_name'] = branch_name else: - cmd_template += ' --all' + rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter', + '--all').strip() + cmd_template += ' %s' % (rev_filter) cmd = Template(cmd_template).safe_substitute(**cmd_params) revs = self.run_git_command(cmd)[0].splitlines() diff --git a/test.ini b/test.ini --- a/test.ini +++ b/test.ini @@ -98,6 +98,10 @@ use_gravatar = true ## path to git executable git_path = git +## git rev filter option, --all is the default filter, if you need to +## hide all refs in changelog switch this to --branches --tags +git_rev_filter=--all + ## RSS feed options rss_cut_off_limit = 256000 rss_items_per_page = 10