summaryrefslogtreecommitdiff
path: root/Documentation/git-for-each-ref.txt
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2017-01-10 08:49:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-10 20:44:31 (GMT)
commit4f3e3b37fae818e0e370d14fd56479d3a7d68b6e (patch)
treeaebe8b78b2321e0fdc1cb5e1358b692e6d0ac693 /Documentation/git-for-each-ref.txt
parentc58fc85692d759cb33a59e138a94931044a08284 (diff)
downloadgit-4f3e3b37fae818e0e370d14fd56479d3a7d68b6e.zip
git-4f3e3b37fae818e0e370d14fd56479d3a7d68b6e.tar.gz
git-4f3e3b37fae818e0e370d14fd56479d3a7d68b6e.tar.bz2
ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
Implement %(if:equals=<string>) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom is the same as the given '<string>'. Similarly, implement (if:notequals=<string>) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom is different from the given '<string>'. This is done by introducing 'if_atom_parser()' which parses the given %(if) atom and then stores the data in used_atom which is later passed on to the used_atom of the %(then) atom, so that it can do the required comparisons. Add tests and documentation for the same. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-for-each-ref.txt')
-rw-r--r--Documentation/git-for-each-ref.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt
index 6b671ae..d5be419 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -158,6 +158,9 @@ if::
evaluating the string before %(then), this is useful when we
use the %(HEAD) atom which prints either "*" or " " and we
want to apply the 'if' condition only on the 'HEAD' ref.
+ Append ":equals=<string>" or ":notequals=<string>" to compare
+ the value between the %(if:...) and %(then) atoms with the
+ given string.
In addition to the above, for commit and tag objects, the header
field names (`tree`, `parent`, `object`, `type`, and `tag`) can