Skip to content

Commit 173473c

Browse files
committed
Merge branch 'kn/gitweb-extra-branch-refs'
Allow gitweb to be configured to show refs out of refs/heads/ as if they were branches. * kn/gitweb-extra-branch-refs: gitweb: Denote non-heads, non-remotes branches gitweb: Add a feature for adding more branch refs gitweb: Return 1 on validation success instead of passed input gitweb: Move check-ref-format code into separate function
2 parents 1945e8a + e374747 commit 173473c

File tree

2 files changed

+175
-46
lines changed

2 files changed

+175
-46
lines changed

Documentation/gitweb.conf.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,43 @@ time zones in the form of "+/-HHMM", such as "+0200".
849849
+
850850
Project specific override is not supported.
851851

852+
extra-branch-refs::
853+
List of additional directories under "refs" which are going to
854+
be used as branch refs. For example if you have a gerrit setup
855+
where all branches under refs/heads/ are official,
856+
push-after-review ones and branches under refs/sandbox/,
857+
refs/wip and refs/other are user ones where permissions are
858+
much wider, then you might want to set this variable as
859+
follows:
860+
+
861+
--------------------------------------------------------------------------------
862+
$feature{'extra-branch-refs'}{'default'} =
863+
['sandbox', 'wip', 'other'];
864+
--------------------------------------------------------------------------------
865+
+
866+
This feature can be configured on per-repository basis after setting
867+
$feature{'extra-branch-refs'}{'override'} to true, via repository's
868+
`gitweb.extraBranchRefs` configuration variable, which contains a
869+
space separated list of refs. An example:
870+
+
871+
--------------------------------------------------------------------------------
872+
[gitweb]
873+
extraBranchRefs = sandbox wip other
874+
--------------------------------------------------------------------------------
875+
+
876+
The gitweb.extraBranchRefs is actually a multi-valued configuration
877+
variable, so following example is also correct and the result is the
878+
same as of the snippet above:
879+
+
880+
--------------------------------------------------------------------------------
881+
[gitweb]
882+
extraBranchRefs = sandbox
883+
extraBranchRefs = wip other
884+
--------------------------------------------------------------------------------
885+
+
886+
It is an error to specify a ref that does not pass "git check-ref-format"
887+
scrutiny. Duplicated values are filtered.
888+
852889

853890
EXAMPLES
854891
--------

0 commit comments

Comments
 (0)