aboutsummaryrefslogtreecommitdiff
path: root/builtin-check-ref-format.c
Commit message (Collapse)AuthorAge
* Merge branch 'jn/maint-http-fetch-mingw' into jn/help-everywhereJunio C Hamano2009-11-10
|\ | | | | | | | | | | | | | | | | | | * jn/maint-http-fetch-mingw: http-fetch: add missing initialization of argv0_path merge: do not setup worktree twice check-ref-format: update usage string Conflicts: builtin-check-ref-format.c
| * check-ref-format: update usage stringJonathan Nieder2009-11-10
| | | | | | | | | | | | | | | | 'git check-ref-format' has learned --branch and --print options since the usage string was last updated. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Show usage string for 'git check-ref-format -h'Jonathan Nieder2009-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only changes the behavior of "git check-ref-format -h" without any other options and arguments. This change cannot be breaking backward compatibility, since any valid refname must contain a /. Most existing scripts use arguments such as "heads/$foo". If some script checks the refname "-h" alone, git check-ref-format will still exit with nonzero status, and the only detrimental side-effect will be a usage string sent to stderr. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | check-ref-format: simplify --print implementationJonathan Nieder2009-10-12
| | | | | | | | | | | | | | | | | | normalize_path_copy() is a complicated function, but most of its functionality will never apply to a ref name that has been checked with check_ref_format(). Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git check-ref-format --printJunio C Hamano2009-10-12
|/ | | | | | | | | | | | | | Tolerating empty path components in ref names means each ref does not have a unique name. This creates difficulty for porcelains that want to see if two branches are equal. Add a helper associating to each ref a canonical name. If a user asks a porcelain to create a ref "refs/heads//master", the porcelain can run "git check-ref-format --print refs/heads//master" and only deal with "refs/heads/master" from then on. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf_check_branch_ref(): a helper to check a refname for a branchJunio C Hamano2009-03-22
| | | | | | | | | | | | | | | | This allows a common calling sequence strbuf_branchname(&ref, name); strbuf_splice(&ref, 0, 0, "refs/heads/", 11); if (check_ref_format(ref.buf)) die(...); to be refactored into if (strbuf_check_branch_ref(&ref, name)) die(...); Signed-off-by: Junio C Hamano <gitster@pobox.com>
* check-ref-format --branch: give Porcelain a way to grok branch shorthandJunio C Hamano2009-03-22
| | | | | | | | | | | The command may not be the best place to add this new feature, but $ git check-ref-format --branch "@{-1}" allows Porcelains to figure out what branch you were on before the last branch switching. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Start conforming code to "git subcmd" styleHeikki Orsila2008-08-30
| | | | | | | | User notifications are presented as 'git cmd', and code comments are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'. Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Further clean-up: usage() vs die()Junio C Hamano2006-08-03
| | | | | | | | This hopefully finishes the clean-up Ramsay started with recent commit 15e593e4d37d1d350fef20ab666d58f6881c7f5f and commit 8cdf33643dc0b21d9ea922a3fdd7f64226c421aa. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Call setup_git_directory() much earlierLinus Torvalds2006-07-29
| | | | | | | | | This changes the calling convention of built-in commands and passes the "prefix" (i.e. pathname of $PWD relative to the project root level) down to them. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make git-check-format-ref a builtin.Lukas Sandström2006-05-18
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>