summaryrefslogtreecommitdiff
path: root/builtin
AgeCommit message (Collapse)Author
2010-12-28cherry-pick/revert: add support for -X/--strategy-optionJonathan Nieder
For example, this would allow cherry-picking or reverting patches from a piece of history with a different end-of-line style, like so: $ git revert -Xrenormalize old-problematic-commit Currently that is possible with manual use of merge-recursive but the cherry-pick/revert porcelain does not expose the functionality. While at it, document the existing support for --strategy. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22Merge branch 'jk/commit-die-on-bogus-ident'Junio C Hamano
* jk/commit-die-on-bogus-ident: commit: die before asking to edit the log message ident: die on bogus date format Conflicts: builtin/commit.c
2010-12-22Merge branch 'tf/commit-list-prefix'Junio C Hamano
* tf/commit-list-prefix: commit: Add commit_list prefix in two function names. Conflicts: sha1_name.c
2010-12-21commit: die before asking to edit the log messageJunio C Hamano
When determine_author_info() returns to the calling prepare_to_commit(), we already know the pieces of information necessary to determine what author ident will be used in the final message, but deferred making a call to fmt_ident() before the final commit_tree(). Most importantly, we would open the editor to ask the user to compose the log message before it. As one important side effect of fmt_ident() is to error out when the given information is malformed, this resulted in us spawning the editor first and then refusing to commit due to error, even though we had enough information to detect the error before starting the editor, which was annoying. Move the fmt_ident() call to the end of determine_author_info() where we have final determination of author info to rectify this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19builtin/rm.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.Thiago Farina
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19builtin/branch.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.Thiago Farina
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-16Merge branch 'jl/fetch-submodule-recursive'Junio C Hamano
* jl/fetch-submodule-recursive: fetch_populated_submodules(): document dynamic allocation Submodules: Add the "fetchRecurseSubmodules" config option Add the 'fetch.recurseSubmodules' config setting fetch/pull: Add the --recurse-submodules option Conflicts: builtin/fetch.c
2010-12-16Merge branch 'aa/status-hilite-branch'Junio C Hamano
* aa/status-hilite-branch: default color.status.branch to "same as header" status: show branchname with a configurable color
2010-12-16Merge branch 'ak/describe-exact'Junio C Hamano
* ak/describe-exact: describe: Delay looking up commits until searching for an inexact match describe: Store commit_names in a hash table by commit SHA1 describe: Do not use a flex array in struct commit_name describe: Use for_each_rawref
2010-12-13Merge branch 'jn/parse-options-extra'Junio C Hamano
* jn/parse-options-extra: update-index: migrate to parse-options API setup: save prefix (original cwd relative to toplevel) in startup_info parse-options: make resuming easier after PARSE_OPT_STOP_AT_NON_OPTION parse-options: allow git commands to invent new option types parse-options: never suppress arghelp if LITERAL_ARGHELP is set parse-options: do not infer PARSE_OPT_NOARG from option type parse-options: sanity check PARSE_OPT_NOARG flag parse-options: move NODASH sanity checks to parse_options_check parse-options: clearer reporting of API misuse parse-options: Don't call parse_options_check() so much
2010-12-13Merge branch 'tc/format-patch-p'Junio C Hamano
* tc/format-patch-p: format-patch: page output with --stdout
2010-12-13Merge branch 'jn/git-cmd-h-bypass-setup'Junio C Hamano
* jn/git-cmd-h-bypass-setup: update-index -h: show usage even with corrupt index merge -h: show usage even with corrupt index ls-files -h: show usage even with corrupt index gc -h: show usage even with broken configuration commit/status -h: show usage even with broken configuration checkout-index -h: show usage even in an invalid repository branch -h: show usage even in an invalid repository Conflicts: builtin/merge.c
2010-12-11Merge branch 'mg/maint-tag-rfc1991' into maintJunio C Hamano
* mg/maint-tag-rfc1991: tag: recognize rfc1991 signatures tag: factor out sig detection for tag display tag: factor out sig detection for body edits verify-tag: factor out signature detection t/t7004-tag: test handling of rfc1991 signatures
2010-12-10thread-utils.h: simplify the inclusionJunio C Hamano
All files that include this header file use the same four line incantation: #ifndef NO_PTHREADS #include <pthread.h> #include "thread-utils.h" #endif Move the responsibility for that gymnastics to the header file from the files that include it. This approach makes it easier to later declare new services that are related to threading in thread-utils.h and have them available to all the threading code. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09describe: Delay looking up commits until searching for an inexact matchAnders Kaseorg
Now that struct commit.util is not used until after we've checked that the argument doesn't exactly match a tag, we can wait until then to look up the commits for each tag. This avoids a lot of I/O on --exact-match queries in repositories with many tags. For example, 'git describe --exact-match HEAD' becomes about 12 times faster on a cold cache (3.2s instead of 39s) in a linux-2.6 repository with 2000 packed tags. That is a huge win for the interactivity of the __git_ps1 shell prompt helper when on a detached HEAD. Signed-off-by: Anders Kaseorg <andersk@ksplice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09describe: Store commit_names in a hash table by commit SHA1Anders Kaseorg
describe is currently forced to look up the commit at each tag in order to store the struct commit_name pointers in struct commit.util. For --exact-match queries, those lookups are wasteful. In preparation for removing them, put the commit_names into a hash table, indexed by commit SHA1, that can be used to quickly check for exact matches. Signed-off-by: Anders Kaseorg <andersk@ksplice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09describe: Do not use a flex array in struct commit_nameAnders Kaseorg
Now add_to_known_names overwrites commit_names in place when multiple tags point to the same commit. This will make it easier to store commit_names in a hash table. Signed-off-by: Anders Kaseorg <andersk@ksplice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09describe: Use for_each_rawrefAnders Kaseorg
Don't waste time checking for dangling refs; they wouldn't affect the output of 'git describe' anyway. Although this does not gain much performance by itself, it does in conjunction with the next commits. Signed-off-by: Anders Kaseorg <andersk@ksplice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09Merge branch 'jn/cherry-pick-refresh-index' into maintJunio C Hamano
* jn/cherry-pick-refresh-index: cherry-pick/revert: transparently refresh index
2010-12-09Merge branch 'fc/apply-p2-get-header-name' into maintJunio C Hamano
* fc/apply-p2-get-header-name: test: git-apply -p2 rename/chmod only Fix git-apply with -p greater than 1
2010-12-09Merge branch 'np/pack-broken-boundary' into maintJunio C Hamano
* np/pack-broken-boundary: make pack-objects a bit more resilient to repo corruption
2010-12-09Merge branch 'ak/apply-non-git-epoch' into maintJunio C Hamano
* ak/apply-non-git-epoch: apply: handle patches with funny filename and colon in timezone apply: Recognize epoch timestamps with : in the timezone
2010-12-08Merge branch 'nd/maint-fix-add-typo-detection' (early part)Junio C Hamano
* 'nd/maint-fix-add-typo-detection' (early part): add: do not rely on dtype being NULL behavior
2010-12-08Merge branch 'il/remote-fd-ext'Junio C Hamano
* 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
2010-12-08Merge branch 'mg/maint-tag-rfc1991'Junio C Hamano
* mg/maint-tag-rfc1991: tag: recognize rfc1991 signatures tag: factor out sig detection for tag display tag: factor out sig detection for body edits verify-tag: factor out signature detection t/t7004-tag: test handling of rfc1991 signatures
2010-12-08Merge branch 'jh/notes-merge'Junio C Hamano
* 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
2010-12-07update-index: migrate to parse-options APIJonathan Nieder
--refresh and --really-refresh accept flags (like -q) and modify an error indicator. It might make sense to make the error indicator global, but just pass the flags and a pointer to the error indicator in a struct instead. --cacheinfo wants 3 arguments. Use the OPTION_LOWLEVEL_CALLBACK extension to grab them and PARSE_OPT_NOARG to disallow the "sticked" --cacheinfo=foo form. (The resulting message $ git update-index --cacheinfo=foo error: option `cacheinfo' takes no value is unfortunately incorrect.) --assume-unchanged and --no-assume-unchanged probably should use the OPT_UYN feature; but use a callback for now so the existing MARK_FLAG and UNMARK_FLAG values can be used. --stdin and --index-info are still constrained to be the last argument (implemented using the OPTION_LOWLEVEL_CALLBACK extension). --unresolve and --again consume all arguments that come after them (also using OPTION_LOWLEVEL_CALLBACK). The order of options matters. Each path on the command line is affected only by the options that come before it. A custom argument-parsing loop with parse_options_step() brings that about. In exchange for all the fuss, we get the usual perks: support for un-sticked options, better usage error messages, more useful -h output, and argument parsing code that should be easier to tweak in the future. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-07parse-options: Don't call parse_options_check() so muchStephen Boyd
parse_options_check() is being called for each invocation of parse_options_step which can be quite a bit for some commands. The commit introducing this function cb9d398 (parse-options: add parse_options_check to validate option specs., 2009-06-09) had the correct motivation and explicitly states that parse_options_check() should be called from parse_options_start(). However, the implementation differs from the motivation. Fix it. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-04Merge branch 'jn/thinner-wrapper'Junio C Hamano
* jn/thinner-wrapper: Remove pack file handling dependency from wrapper.o pack-objects: mark file-local variable static wrapper: give zlib wrappers their own translation unit strbuf: move strbuf_branchname to sha1_name.c path helpers: move git_mkstemp* to wrapper.c wrapper: move odb_* to environment.c wrapper: move xmmap() to sha1_file.c
2010-12-04Merge branch 'pn/commit-autosquash'Junio C Hamano
* pn/commit-autosquash: add tests of commit --squash commit: --squash option for use with rebase --autosquash add tests of commit --fixup commit: --fixup option for use with rebase --autosquash pretty.c: teach format_commit_message() to reencode the output commit: helper methods to reduce redundant blocks of code Conflicts: Documentation/git-commit.txt t/t3415-rebase-autosquash.sh
2010-12-04Merge branch 'sn/diff-doc'Junio C Hamano
* sn/diff-doc: docs: clarify git diff modes of operation diff,difftool: Don't use the {0,2} notation in usage strings CodingGuidelines: Add a section on writing documentation
2010-12-02Merge branch 'cb/maint-orphan-merge-noclobber' into maintJunio C Hamano
* cb/maint-orphan-merge-noclobber: do not overwrite untracked during merge from unborn branch
2010-12-02Merge branch 'tr/maint-merge-file-subdir' into maintJunio C Hamano
* tr/maint-merge-file-subdir: merge-file: correctly find files when called in subdir prefix_filename(): safely handle the case where pfx_len=0
2010-12-02Merge branch 'ks/no-textconv-symlink' into maintJunio C Hamano
* 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
2010-12-02Merge branch 'maint'Junio C Hamano
* maint: add: introduce add.ignoreerrors synonym for add.ignore-errors bash: Match lightweight tags in prompt git-commit.txt: (synopsis): move -i and -o before "--"
2010-12-02Merge branch 'maint-1.7.2' into maintJunio C Hamano
* maint-1.7.2: add: introduce add.ignoreerrors synonym for add.ignore-errors bash: Match lightweight tags in prompt git-commit.txt: (synopsis): move -i and -o before "--"
2010-12-02Merge branch 'maint-1.7.1' into maint-1.7.2Junio C Hamano
* maint-1.7.1: add: introduce add.ignoreerrors synonym for add.ignore-errors
2010-12-02Merge branch 'maint-1.7.0' into maint-1.7.1Junio C Hamano
* maint-1.7.0: add: introduce add.ignoreerrors synonym for add.ignore-errors
2010-11-30Merge branch 'jl/clone-recurse-sm-synonym'Junio C Hamano
* jl/clone-recurse-sm-synonym: clone: Add the --recurse-submodules option as alias for --recursive
2010-11-30Merge branch 'jn/cherry-pick-refresh-index'Junio C Hamano
* jn/cherry-pick-refresh-index: cherry-pick/revert: transparently refresh index
2010-11-30Merge branch 'np/pack-broken-boundary'Junio C Hamano
* np/pack-broken-boundary: make pack-objects a bit more resilient to repo corruption
2010-11-30Merge branch 'fc/apply-p2-get-header-name'Junio C Hamano
* fc/apply-p2-get-header-name: test: git-apply -p2 rename/chmod only Fix git-apply with -p greater than 1
2010-11-30Merge branch 'kb/blame-author-email'Junio C Hamano
* kb/blame-author-email: blame: Add option to show author email instead of name Conflicts: t/annotate-tests.sh
2010-11-30Merge branch 'ak/apply-non-git-epoch'Junio C Hamano
* ak/apply-non-git-epoch: apply: handle patches with funny filename and colon in timezone apply: Recognize epoch timestamps with : in the timezone
2010-11-30status: show branchname with a configurable colorAleksi Aalto
You can tell "git status" to paint the name of the current branch in its output (the line that says "On branch ...") by setting the configuration variable color.status.branch; it is by default turned off. Signed-off-by: Aleksi Aalto <aga@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-29commit: Add commit_list prefix in two function names.Thiago Farina
Add commit_list prefix to insert_by_date function and to sort_by_date, so it's clear that these functions refer to commit_list structure. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-24Merge branch 'cb/maint-orphan-merge-noclobber'Junio C Hamano
* cb/maint-orphan-merge-noclobber: do not overwrite untracked during merge from unborn branch
2010-11-24Merge branch 'rs/opt-help-text'Junio C Hamano
* rs/opt-help-text: verify-tag: document --verbose branch: improve --verbose description archive: improve --verbose description Describe various forms of "be quiet" using OPT__QUIET add OPT__FORCE add description parameter to OPT__QUIET add description parameter to OPT__DRY_RUN add description parameter to OPT__VERBOSE
2010-11-24Merge branch 'mm/phrase-remote-tracking'Junio C Hamano
* mm/phrase-remote-tracking: git-branch.txt: mention --set-upstream as a way to change upstream configuration user-manual: remote-tracking can be checked out, with detached HEAD user-manual.txt: explain better the remote(-tracking) branch terms Change incorrect "remote branch" to "remote tracking branch" in C code Change incorrect uses of "remote branch" meaning "remote-tracking" Change "tracking branch" to "remote-tracking branch" everyday.txt: change "tracking branch" to "remote-tracking branch" Change remote tracking to remote-tracking in non-trivial places Replace "remote tracking" with "remote-tracking" Better "Changed but not updated" message in git-status
2010-11-24Merge branch 'jk/maint-apply-no-binary' into maintJunio C Hamano
* jk/maint-apply-no-binary: apply: don't segfault on binary files with missing data