summaryrefslogtreecommitdiff
path: root/compat/regex/regex.c
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-12-05 13:16:21 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-06 02:59:40 +0900
commit9e2b7005becaf730ff75f6efbef4542cc4454107 (patch)
tree75b4750235ec9903939b4f3655cacbf8b03c472b /compat/regex/regex.c
parentad739f525eec917198887055f1a815e78d7c66be (diff)
fetch set_head: add warn-if-not-$branch option
Currently if we want to have a remote/HEAD locally that is different from the one on the remote, but we still want to get a warning if remote changes HEAD, our only option is to have an indiscriminate warning with "follow_remote_head" set to "warn". Add a new option "warn-if-not-$branch", where $branch is a branch name we do not wish to get a warning about. If the remote HEAD is $branch do not warn, otherwise, behave as "warn". E.g. let's assume, that our remote origin has HEAD set to "master", but locally we have "git remote set-head origin seen". Setting 'remote.origin.followRemoteHEAD = "warn"' will always print a warning, even though the remote has not changed HEAD from "master". Setting 'remote.origin.followRemoteHEAD = "warn-if-not-master" will squelch the warning message, unless the remote changes HEAD from "master". Note, that should the remote change HEAD to "seen" (which we have locally), there will still be no warning. Improve the advice message in report_set_head to also include silencing the warning message with "warn-if-not-$branch". Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/regex/regex.c')
0 files changed, 0 insertions, 0 deletions