From: Ævar Arnfjörð Bjarmason Date: Fri, 31 Aug 2018 20:10:02 +0000 (+0000) Subject: push doc: correct lies about how push refspecs work X-Git-Tag: v2.20.0-rc0~229^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fe802bd21e81cceedff2db79cc3c9a5ad75b4f93?hp=fe802bd21e81cceedff2db79cc3c9a5ad75b4f93 push doc: correct lies about how push refspecs work There's complex rules governing whether a push is allowed to take place depending on whether we're pushing to refs/heads/*, refs/tags/* or refs/not-that/*. See is_branch() in refs.c, and the various assertions in refs/files-backend.c. (e.g. "trying to write non-commit object %s to branch '%s'"). This documentation has never been quite correct, but went downhill after dbfeddb12e ("push: require force for refs under refs/tags/", 2012-11-29) when we started claiming that couldn't be a tag object, which is incorrect. After some of the logic in that patch was changed in 256b9d70a4 ("push: fix "refs/tags/ hierarchy cannot be updated without --force"", 2013-01-16) the docs weren't updated, and we've had some version of documentation that confused whether was a tag or not with whether would accept either an annotated tag object or the commit it points to. This makes the intro somewhat more verbose & complex, perhaps we should have a shorter description here and split the full complexity into a dedicated section. Very few users will find themselves needing to e.g. push blobs or trees to refs/custom-namespace/* (or blobs or trees at all), and that could be covered separately as an advanced topic. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano ---