summaryrefslogtreecommitdiff
path: root/builtin.h
Commit message (Collapse)AuthorAgeFilesLines
* repo-config: add deprecation warningRené Scharfe2011-02-131-1/+2
| | | | | | | | | repo-config was deprecated in 5c66d0d4 on 2008-01-17. Warn the remaining users that it has been replaced by config and is going to be removed eventually. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'il/remote-fd-ext'Junio C Hamano2010-12-081-0/+2
|\ | | | | | | | | | | | | | | | | | | | | * il/remote-fd-ext: remote-fd/ext: finishing touches after code review git-remote-ext git-remote-fd Add bidirectional_transfer_loop() Conflicts: compat/mingw.h
| * git-remote-extIlari Liusvaara2010-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | This remote helper invokes external command and passes raw smart transport stream through it. This is useful for instance for invoking ssh with one-off odd options, connecting to git services in unix domain sockets, in abstract namespace, using TLS or other secure protocols, etc... Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-remote-fdIlari Liusvaara2010-10-131-0/+1
| | | | | | | | | | | | | | | | | | This remote helper reflects raw smart remote transport stream back to the calling program. This is useful for example if some UI wants to handle ssh itself and not use hacks via GIT_SSH. Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jh/notes-merge'Junio C Hamano2010-12-081-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jh/notes-merge: (23 commits) Provide 'git merge --abort' as a synonym to 'git reset --merge' cmd_merge(): Parse options before checking MERGE_HEAD Provide 'git notes get-ref' to easily retrieve current notes ref git notes merge: Add testcases for merging notes trees at different fanouts git notes merge: Add another auto-resolving strategy: "cat_sort_uniq" git notes merge: --commit should fail if underlying notes ref has moved git notes merge: List conflicting notes in notes merge commit message git notes merge: Manual conflict resolution, part 2/2 git notes merge: Manual conflict resolution, part 1/2 Documentation: Preliminary docs on 'git notes merge' git notes merge: Add automatic conflict resolvers (ours, theirs, union) git notes merge: Handle real, non-conflicting notes merges builtin/notes.c: Refactor creation of notes commits. git notes merge: Initial implementation handling trivial merges only builtin/notes.c: Split notes ref DWIMmery into a separate function notes.c: Use two newlines (instead of one) when concatenating notes (trivial) t3303: Indent with tabs instead of spaces for consistency notes.h/c: Propagate combine_notes_fn return value to add_note() and beyond notes.h/c: Allow combine_notes functions to remove notes notes.c: Reorder functions in preparation for next commit ... Conflicts: builtin.h
| * | builtin/notes.c: Refactor creation of notes commits.Johan Herland2010-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create new function create_notes_commit() which is slightly more general than commit_notes() (accepts multiple commit parents and does not auto-update the notes ref). This function will be used by the notes-merge functionality in future patches. Also rewrite builtin/notes.c:commit_notes() to reuse this new function. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ks/no-textconv-symlink'Junio C Hamano2010-11-171-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ks/no-textconv-symlink: blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664'' blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks blame,cat-file: Prepare --textconv tests for correctly-failing conversion program
| * | | blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''Kirill Smelkov2010-09-291-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to get the correct mode when blame reads the source from the working tree, the index, or trees. This allows us to omit running textconv filters on symbolic links. Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rr/fmt-merge-msg'Junio C Hamano2010-09-291-3/+4
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rr/fmt-merge-msg: t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length merge: Make 'merge.log' an integer or boolean option merge: Make '--log' an integer option for number of shortlog entries fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len Conflicts: builtin/merge.c
| * | fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_lenRamkumar Ramachandra2010-09-091-3/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Give "shortlog_len" parameter to the fmt_merge_msg(), remove its "merge_summary" parameter, and remove fmt_merge_msg_shortlog() function. In the updated API, shortlog_len == 0 means no shortlog is given. The parameter "merge_title" controls if the title of the merge commit is autogenerated (it reads something like "Merge branch ..."), and typically it is set to true when the caller does not give its own message. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Mentored-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin.h: Move two functions definitions to help.h.Thiago Farina2010-09-011-2/+0
|/ | | | | | | | The two functions defined here are implemented in help.c, so makes more sense to put the definition of those in help.h instead of in builtin.h. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'cp/textconv-cat-file'Junio C Hamano2010-06-271-0/+2
|\ | | | | | | | | | | | | | | * cp/textconv-cat-file: git-cat-file.txt: Document --textconv t/t8007: test textconv support for cat-file textconv: support for cat_file sha1_name: add get_sha1_with_context()
| * textconv: support for cat_fileClément Poulain2010-06-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Make the textconv_object function public, and add --textconv option to cat-file to perform conversion on blob objects. Using --textconv implies that we are working on a blob. As files drivers need to be initialized, a new config is required in addition to git_default_config. Therefore git_cat_file_config() is introduced Signed-off-by: Clément Poulain <clement.poulain@ensimag.imag.fr> Signed-off-by: Diane Gasselin <diane.gasselin@ensimag.imag.fr> Signed-off-by: Axel Bonnet <axel.bonnet@ensimag.imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2010-06-251-2/+2
|\ \ | | | | | | | | | | | | | | | | | | * maint: msvc: Fix some compiler warnings Documentation: grep: fix asciidoc problem with -- msvc: Fix some "expr evaluates to function" compiler warnings
| * | msvc: Fix some "expr evaluates to function" compiler warningsRamsay Jones2010-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, the following warning is issued while compiling notes.c: notes.c(927) : warning C4550: expression evaluates to a \ function which is missing an argument list along with identical warnings on lines 928, 1016 and 1017. In order to suppress the warning, we change the definition of combine_notes_fn, so that the symbol type is an (explicit) "pointer to function ...". As a result, several other declarations need some minor fix-up to take account of the new typedef. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'tc/merge-m-log'Junio C Hamano2010-06-181-0/+1
|\ \ \ | |/ / | | / | |/ |/| | | | | | | | | | | | | | | | | | | | | * tc/merge-m-log: merge: --log appends shortlog to message if specified fmt-merge-msg: add function to append shortlog only fmt-merge-msg: refactor merge title formatting fmt-merge-msg: minor refactor of fmt_merge_msg() merge: rename variable merge: update comment t7604-merge-custom-message: show that --log doesn't append to -m t7604-merge-custom-message: shift expected output creation Conflicts: builtin.h
| * fmt-merge-msg: add function to append shortlog onlyTay Ray Chuan2010-05-101-0/+1
| | | | | | | | | | Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | make commit_tree a library functionJeff King2010-04-011-3/+0
|/ | | | | | | | | | | | | | | | | | Until now, this has been part of the commit-tree builtin. However, it is already used by other builtins (like commit, merge, and notes), and it would be useful to access it from library code. The check_valid helper has to come along, too, but is given a more library-ish name of "assert_sha1_type". Otherwise, the code is unchanged. There are still a few rough edges for a library function, like printing the utf8 warning to stderr, but we can address those if and when they come up as inappropriate. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* notes: implement helpers needed for note copying during rewriteThomas Rast2010-03-121-0/+17
| | | | | | | | | | | | | | Implement helper functions to load the rewriting config, and to actually copy the notes. Also document the config. Secondly, also implement an undocumented --for-rewrite=<cmd> option to 'git notes copy' which is used like --stdin, but also puts the configuration for <cmd> into effect. It will be needed to support the copying in git-rebase. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Builtin-ify git-notesJohan Herland2010-02-131-0/+3
| | | | | | | | | | | | | | | | | | | The builtin-ification includes some minor behavioural changes to the command-line interface: It is no longer allowed to mix the -m and -F arguments, and it is not allowed to use multiple -F options. As part of the builtin-ification, we add the commit_notes() function to the builtin API. This function (together with the notes.h API) can be easily used from other builtins to manipulate the notes tree. Also includes needed changes to t3301. This patch has been improved by the following contributions: - Stephen Boyd: Use die() instead of fprintf(stderr, ...) followed by exit(1) Cc: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "index-pack" a built-inLinus Torvalds2010-01-221-0/+1
| | | | | | | | This required some fairly trivial packfile function 'const' cleanup, since the builtin commands get a const char *argv[] array. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git pack-redundant" a built-inLinus Torvalds2010-01-221-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git unpack-file" a built-inLinus Torvalds2010-01-221-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "mktag" a built-inLinus Torvalds2010-01-221-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "merge-index" a built-inLinus Torvalds2010-01-221-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git patch-id" a built-inLinus Torvalds2010-01-211-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git var" a built-inLinus Torvalds2010-01-211-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git hash-object" a built-inLinus Torvalds2010-01-211-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make "git merge-tree" a built-inLinus Torvalds2010-01-211-0/+1
| | | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Retire fetch--tool helper to contrib/examplesJonathan Nieder2009-11-091-1/+0
| | | | | | | | | | | | | When git-fetch was builtin-ized, the previous script was moved to contrib/examples. Now, it is the sole remaining user for 'git fetch--tool'. The fetch--tool code is still worth keeping around so people can try out the old git-fetch.sh, for example when investigating regressions from the builtinifaction. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* update-server-info: make builtin, use parseoptRené Scharfe2009-08-291-0/+1
| | | | | | | Convert git update-server-info to a built-in command and use parseopt. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'cc/replace'Junio C Hamano2009-08-211-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cc/replace: t6050: check pushing something based on a replaced commit Documentation: add documentation for "git replace" Add git-replace to .gitignore builtin-replace: use "usage_msg_opt" to give better error messages parse-options: add new function "usage_msg_opt" builtin-replace: teach "git replace" to actually replace Add new "git replace" command environment: add global variable to disable replacement mktag: call "check_sha1_signature" with the replacement sha1 replace_object: add a test case object: call "check_sha1_signature" with the replacement sha1 sha1_file: add a "read_sha1_file_repl" function replace_object: add mechanism to replace objects found in "refs/replace/" refs: add a "for_each_replace_ref" function
| * Add new "git replace" commandChristian Couder2009-05-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can only be used now to list replace refs in "refs/replace/" and to delete them. The option to list replace refs is "-l". The option to delete replace refs is "-d". The behavior should be consistent with how "git tag" and "git branch" are working. The code has been copied from "builtin-tag.c" by Kristian Høgsberg <krh@redhat.com> and Carlos Rica <jasampler@gmail.com> that was itself based on git-tag.sh and mktag.c by Linus Torvalds. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-mailsplit.c: remove read_line_with_nul() since it is no longer usedBrandon Casey2009-08-051-1/+0
|/ | | | | Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* build-in git-mktreeJunio C Hamano2009-05-101-0/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect--helper: implement "git bisect--helper"Christian Couder2009-04-051-0/+1
| | | | | | | | | | | | | | | | | This patch implements a new "git bisect--helper" builtin plumbing command that will be used to migrate "git-bisect.sh" to C. We start by implementing only the "--next-vars" option that will read bisect refs from "refs/bisect/", and then compute the next bisect step, and output shell variables ready to be eval'ed by the shell. At this step, "git bisect--helper" ignores the paths that may have been put in "$GIT_DIR/BISECT_NAMES". This will be fixed in a later patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jc/alternate-push'Shawn O. Pearce2008-09-251-0/+1
|\ | | | | | | | | | | | | | | * jc/alternate-push: push: receiver end advertises refs from alternate repositories push: prepare sender to receive extended ref information from the receiver receive-pack: make it a builtin is_directory(): a generic helper function
| * receive-pack: make it a builtinJunio C Hamano2008-09-091-0/+1
| | | | | | | | | | | | | | It is a good thing to do in general, but more importantly, transport routines can only be used by built-ins, which is what I'll be adding next. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | commit_tree(): add a new author parameterMiklos Vajna2008-09-101-1/+2
|/ | | | | | | | In case it's NULL, it is still determined automatically, but now you have the ability to specify one yourself. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git wrapper: DWIM mistyped commandsJohannes Schindelin2008-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a modified Damerau-Levenshtein algorithm into Git's code base, and uses it with the following penalties to show some similar commands when an unknown command was encountered: swap = 0, insertion = 1, substitution = 2, deletion = 4 A typical output would now look like this: $ git sm git: 'sm' is not a git-command. See 'git --help'. Did you mean one of these? am rm The cut-off is at similarity rating 6, which was empirically determined to give sensible results. As a convenience, if there is only one candidate, Git continues under the assumption that the user mistyped it. Example: $ git reabse WARNING: You called a Git program named 'reabse', which does not exist. Continuing under the assumption that you meant 'rebase' [...] Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Revert "Build-in "git-shell""Junio C Hamano2008-08-251-1/+0
| | | | | | | This reverts commit daa0cc9a92c9c2c714aa5f7da6d0ff65b93e0698. It was a stupid idea to do this; when run as a log-in shell, it is spawned with argv[0] set to "-git-shell", so the usual name-based dispatch would not work to begin with.
* Build-in "git-shell"Junio C Hamano2008-08-201-0/+1
| | | | | | | | | | | This trivially makes "git-shell" a built-in. It makes the executable even fatter, though. And MinGW removed git-shell only because of the funny dependencies; there is no reason to do so anymore. Signed-off-by: Junio C Hamano <gitster@pobox.com> Tested-on-MinGW-by: Johannes Sixt <johannes.sixt@telecom.at>
* Allow pager of diff command be enabled/disabledAlex Riesen2008-07-231-0/+1
| | | | | | | | | See for example, status and show commands. Besides, Documentation/RelNotes-1.6.0.txt mentions that pager.<cmd> can be used to enable/disable paging behavior per command. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Build in mergeMiklos Vajna2008-07-071-0/+1
| | | | | | Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-commit-tree: make it usable from other builtinsMiklos Vajna2008-07-061-0/+4
| | | | | | | | | Move all functionality (except option parsing) from cmd_commit_tree() to commit_tree(), so that other builtins can use it without a child process. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-fmt-merge-msg: make it usable from other builtinsMiklos Vajna2008-06-301-0/+3
| | | | | | | | | | | | | Move all functionality (except config and option parsing) from cmd_fmt_merge_msg() to fmt_merge_msg(), so that other builtins can use it without a child process. All functions have been changed to use strbufs, and now only cmd_fmt_merge_msg() reads directly from a file / writes anything to stdout. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Print info about "git help COMMAND" on git's main usage pagesTeemu Likonen2008-06-061-0/+1
| | | | | | | | | | Git's main usage pages did not show "git help" as a way to get more information on a specific subcommand. This patch adds an info line after the list of git commands currently printed by "git", "git help", "git --help" and "git help --all". Signed-off-by: Teemu Likonen <tlikonen@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'js/mailinfo'Junio C Hamano2008-05-251-0/+1
|\ | | | | | | | | | | | | * js/mailinfo: mailsplit: minor clean-up in read_line_with_nul() mailinfo: apply the same fix not to lose NULs in BASE64 and QP codepaths mailsplit and mailinfo: gracefully handle NUL characters
| * mailsplit and mailinfo: gracefully handle NUL charactersJohannes Schindelin2008-05-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The function fgets() has a big problem with NUL characters: it reads them, but nobody will know if the NUL comes from the file stream, or was appended at the end of the line. So implement a custom read_line_with_nul() function. Noticed by Tommy Thorn. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Build in cloneDaniel Barkalow2008-05-041-0/+1
|/ | | | | | | Thanks to Johannes Schindelin for various comments and improvements, including supporting cloning full bundles. Signed-off-by: Junio C Hamano <gitster@pobox.com>