summaryrefslogtreecommitdiff
path: root/builtin
Commit message (Collapse)AuthorAgeFilesLines
* fast-export: Add a --full-tree optionElijah Newren2010-07-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This option adds symmetry with fast-import, enabling it to also work with complete trees instead of just incremental changes. It works by issuing a 'deleteall' directive with each commit and then listing the full set of files that make up that commit, rather than just showing the list of files that have changed since the (first) parent commit. Note that this functionality is automatically turned on when using --import-marks together with path limiting in order to avoid dropping important but unchanged files. This functionality is desired when using hand-written filters along with 'fast-export | some-filter | fast-import' as it can be easier to write <some-filter> in terms of complete trees than incremental changes. We could avoid the need to add this option by simply always turning it on. While the end result would be identical, it would slow things down slightly by printing many more filenames per commit which goes somewhat against the 'fast' in 'fast-export'. Signed-off-by: Elijah Newren <newren@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fast-export: Fix dropping of files with --import-marks and path limitingElijah Newren2010-07-191-1/+8
| | | | | | | | | | | | | | | | | | | | Since fast-export operates by listing file changes since the (first) parent commit, when using --import-marks and path limiting and using a wider list of paths than in previous runs, files from the new path(s) will silently be omitted from the result unless or until a commit which explicitly changes those files. The resulting repository in such cases is broken and makes no sense. This commit fixes this by having fast-export work with complete trees instead of incremental changes (when both --import-marks and path limiting are used). It works by issuing a 'deleteall' directive with each commit and then listing the full set of files that make up that commit, rather than just showing the list of files that have changed since the (first) parent commit. Signed-off-by: Elijah Newren <newren@gmail.com> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint-1.6.4' into maintJunio C Hamano2010-07-071-2/+2
| | | | | * maint-1.6.4: rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
* Merge branch 'tr/receive-pack-aliased-update-fix' into maintJunio C Hamano2010-07-071-37/+91
| | | | | | | | | | * tr/receive-pack-aliased-update-fix: check_aliased_update: strcpy() instead of strcat() to copy receive-pack: detect aliased updates which can occur with symrefs receive-pack: switch global variable 'commands' to a parameter Conflicts: t/t5516-fetch-push.sh
* notes: check number of parameters to "git notes copy"Jeff King2010-06-281-0/+4
| | | | | | | | Otherwise we may segfault with too few parameters. Signed-off-by: Jeff King <peff@peff.net> Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* msvc: Fix some "expr evaluates to function" compiler warningsRamsay Jones2010-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | 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 'cc/maint-commit-reflog-msg' into maintJunio C Hamano2010-06-221-4/+9
|\ | | | | | | | | * cc/maint-commit-reflog-msg: commit: use value of GIT_REFLOG_ACTION env variable as reflog message
| * commit: use value of GIT_REFLOG_ACTION env variable as reflog messageChristian Couder2010-06-131-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The environment variable GIT_REFLOG_ACTION was used by git-commit.sh, but when it was converted to a builtin (f5bbc3225c4b073a7ff3218164a0c820299bc9c6, Port git commit to C, Nov 8 2007) this was lost. Let's use it again as it is more user friendly when reverting or cherry-picking to see "revert" or "cherry-pick" in the reflog rather than to just see "commit". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/maint-advice-empty-amend' into maintJunio C Hamano2010-06-221-0/+7
|\ \ | | | | | | | | | | | | * jk/maint-advice-empty-amend: commit: give advice on empty amend
| * | commit: give advice on empty amendJeff King2010-06-111-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We generally disallow empty commits with "git commit". The output produced by the wt_status functions is generally sufficient to explain what happened. With --amend commits, however, things are a little more confusing. We would create an empty commit not if you actually have staged changes _now_, but if your staged changes match HEAD^. In this case, it is not immediately obvious why "git commit" claims no changes, but "git status" does not. Furthermore, we should point the user in the direction of git reset, which would eliminate the empty commit entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'tc/commit-abbrev-fix' into maintJunio C Hamano2010-06-221-6/+4
| | | | | | | | | | | | | | * tc/commit-abbrev-fix: commit::print_summary(): don't use format_commit_message() t7502-commit: add summary output tests for empty and merge commits t7502-commit: add tests for summary output
* | Merge branch 'cb/ls-files-cdup' into maintJunio C Hamano2010-06-221-34/+41
|\ \ | | | | | | | | | | | | | | | * cb/ls-files-cdup: ls-files: allow relative pathspec quote.c: separate quoting and relative path generation
| * | ls-files: allow relative pathspecClemens Buchacher2010-06-051-34/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | git ls-files used to error out if given paths which point outside the current working directory, such as '../'. We now allow such paths and the output is analogous to git grep -l. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'tc/merge-m-log' into maintJunio C Hamano2010-06-222-36/+60
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | merge: --log appends shortlog to message if specifiedTay Ray Chuan2010-05-102-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user specifies a message, use fmt_merge_msg_shortlog() to append the shortlog. Previously, when a message was specified, we ignored the merge title ("Merge <foo> into <bar>") and shortlog from fmt_merge_msg(). Update the documentation for -m to reflect this too. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: add function to append shortlog onlyTay Ray Chuan2010-05-101-4/+9
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: refactor merge title formattingTay Ray Chuan2010-05-101-29/+36
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: minor refactor of fmt_merge_msg()Tay Ray Chuan2010-05-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shift implementation into a private function, do_fmt_merge_msg(). This allows for further changes to the implementation, without affecting the interface. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: rename variableTay Ray Chuan2010-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is more accurate to call it 'merge_names' instead of 'msg', as it does not contain the final message. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: update commentTay Ray Chuan2010-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ce9d823 (merge: do not add standard message when message is given with -m option) changed the behaviour of the code that the comment addressed, but the comment was not similarly updated. Fix this. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ph/clone-message-reword' into maintJunio C Hamano2010-06-221-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * ph/clone-message-reword: clone: reword messages to match the end-user perception
| * | | | clone: reword messages to match the end-user perceptionPete Harlan2010-05-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cloning into a non-bare repository, e.g. "git clone $URL mine", we used to report that we are cloning into "mine/.git". Reword the report to say "Cloning into mine" instead, as that matches what the end-user asked for closer. Make the message for "git clone --bare $URL mine" to say "Cloning into bare repository mine" do make the distinction between this case and the above stand out a bit more prominently. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Pete Harlan <pgit@pcharlan.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jn/maint-amend-missing-name' into maintJunio C Hamano2010-06-221-7/+13
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jn/maint-amend-missing-name: commit --amend: cope with missing display name
| * | | | | commit --amend: cope with missing display nameJonathan Nieder2010-05-041-7/+13
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Though I have not seen this in the wild, it has been said that there are likely to be git repositories converted from other version control systems with an invalid ident line like this one: author <user@example.com> 18746342 +0000 Because there is no space between the (empty) user name and the email address, commit --amend chokes. When searching for a space-left-bracket sequence on the ident line, it finds it in the committer line, ending up utterly confused. Better for commit --amend to treat this like a valid ident line with empty username and complain. The tests remove the questionable commit objects after use so there is no chance for them to confuse later tests. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'pc/remove-warn' into maintJunio C Hamano2010-06-221-5/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pc/remove-warn: Remove a redundant errno test in a usage of remove_path Introduce remove_or_warn function Implement the rmdir_or_warn function Generalise the unlink_or_warn function
| * | | | | Introduce remove_or_warn functionPeter Collingbourne2010-03-281-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the remove_or_warn function which is a generalised version of the {unlink,rmdir}_or_warn functions. It takes an additional parameter indicating the mode of the file to be removed. The patch also modifies certain functions to use remove_or_warn where appropriate, and adds a test case for a bug fixed by the use of remove_or_warn. Signed-off-by: Peter Collingbourne <peter@pcc.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'rs/diff-no-minimal' into maintJunio C Hamano2010-06-214-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/diff-no-minimal: git diff too slow for a file
* | | | | | Merge branch 'bg/apply-blank-trailing-context' into maintJunio C Hamano2010-06-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bg/apply-blank-trailing-context: apply: Allow blank *trailing* context lines to match beyond EOF
* | | | | | Merge branch 'jn/shortlog' into maintJunio C Hamano2010-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jn/shortlog: pretty: Respect --abbrev option shortlog: Document and test --format option t4201 (shortlog): Test output format with multiple authors t4201 (shortlog): guard setup with test_expect_success Documentation/shortlog: scripted users should not rely on implicit HEAD
* | | | | | Merge branch 'np/index-pack-memsave' into maintJunio C Hamano2010-06-161-44/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * np/index-pack-memsave: index-pack: smarter memory usage when appending objects index-pack: rationalize unpack_entry_data() index-pack: smarter memory usage when resolving deltas
* | | | | | Merge branch 'sp/maint-describe-tiebreak-with-tagger-date' into maintJunio C Hamano2010-06-161-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sp/maint-describe-tiebreak-with-tagger-date: describe: Break annotated tag ties by tagger date tag.c: Parse tagger date (if present) tag.c: Refactor parse_tag_buffer to be saner to program tag.h: Remove unused signature field tag.c: Correct indentation
* | | | | | Merge branch 'np/malloc-threading' into maintJunio C Hamano2010-06-162-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * np/malloc-threading: Thread-safe xmalloc and xrealloc needs a recursive mutex Make xmalloc and xrealloc thread-safe
* | | | | | Merge branch 'mh/status-optionally-refresh' into maintJunio C Hamano2010-06-161-0/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mh/status-optionally-refresh: t7508: add a test for "git status" in a read-only repository git status: refresh the index if possible t7508: add test for "git status" refreshing the index
| * | | | | | git status: refresh the index if possibleMarkus Heidelberg2010-04-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was already the case before commit 9e4b7ab6 (git status: not "commit --dry-run" anymore, 2009-08-15) with the difference that it died at failure. It got lost during the new implementation of "git status", which was meant to only change behaviour when invoked with arguments. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | notes: Initialize variable to appease Sun StudioÆvar Arnfjörð Bjarmason2010-06-151-1/+1
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sun Studio 12 Update 1 thinks that *t could be uninitialized, ostensibly because it doesn't take rewrite_cmd into account in its static analysis. builtin/notes.c: In function `notes_copy_from_stdin': builtin/notes.c:419: warning: 't' might be used uninitialized in this function Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Change C99 comments to old-style C commentsTor Arntsen2010-06-072-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tor Arntsen <tor@spacetec.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | show-branch: use DEFAULT_ABBREV instead of 7Tay Ray Chuan2010-05-251-1/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | handle "git --bare init <dir>" properlyJeff King2010-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we know we are creating a bare repository, we use setenv to set the GIT_DIR directory to the current directory (either where we already were, or one we created and chdir'd into with "git init --bare <dir>"). However, with "git --bare init <dir>" (note the --bare as a git wrapper option), the setup code actually sets GIT_DIR for us, but it uses the wrong, original cwd when a directory is given. Because our setenv does not use the overwrite flag, it is ignored. We need to set the overwrite flag, but only when we are given a directory on the command line. That still allows: GIT_DIR=foo.git git init --bare to work. The behavior is changed for: GIT_DIR=foo.git git init --bare bar.git which used to create the repository in foo.git, but now will use bar.git. This is more sane, as command line options should generally override the environment. Noticed by Oliver Hoffmann. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | cherry-pick: do not dump core when iconv failsJonathan Nieder2010-05-081-2/+7
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cherry-picking, usually the new and old commit encodings are both UTF-8. Most old iconv implementations do not support this trivial conversion, so on old platforms, out->message remains NULL, and later attempts to read it segfault. Fix this by noticing the input and output encodings match and skipping the iconv step, like the other reencode_string() call sites already do. Also stop segfaulting on other iconv failures: if iconv fails for some other reason, the best we can do is to pass the old message through. This fixes a regression introduced in v1.7.1-rc0~15^2~2 (revert: clarify label on conflict hunks, 2010-03-20). Reported-by: Andreas Krey <a.krey@gmx.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | clone: quell the progress report from init and report on cloneJunio C Hamano2010-05-041-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a local git clone reports only initializing an empty git dir, which is potentially confusing. Instead, report that cloning is in progress and when it is done (unless -q) is given, and suppress the init report. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'maint'Junio C Hamano2010-05-011-1/+1
| |_|/ |/| | | | | | | | | | | | | | * maint: index-pack: fix trivial typo in usage string git-submodule.sh: properly initialize shell variables
* | | Merge branch 'maint'Junio C Hamano2010-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | * maint: t7012: Mark missing tests as TODO reflog: remove 'show' from 'expire's usage string MSVC: Fix build by adding missing termios.h dummy
* | | Merge branch 'jg/auto-initialize-notes-with-percent-n-in-format'Junio C Hamano2010-04-181-1/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | * jg/auto-initialize-notes-with-percent-n-in-format: t3301: add tests to use --format="%N" pretty: Initialize notes if %N is used
| * | | pretty: Initialize notes if %N is usedJohannes Gilger2010-04-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using git log --pretty='%N' without an explicit --show-notes, git would segfault. This patches fixes this behaviour by loading the needed notes datastructures if --pretty is used and the format contains %N. When --pretty='%N' is used together with --no-notes, %N won't be expanded. This is an extension to a proposed patch by Jeff King. Signed-off-by: Johannes Gilger <heipei@hackvalue.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | tag -v: use RUN_GIT_CMD to run verify-tagJonathan Nieder2010-04-171-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the preferred way to run a git command. The only obvious observable effects I can think of are that the exec is properly reported in GIT_TRACE output and that verifying signed tags will still work if the git-verify-tag hard link in gitexecdir goes missing. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2010-04-093-9/+6
| | | | | | | | | | | | | | | | | | * maint: Let check_preimage() use memset() to initialize "struct checkout" fetch/push: fix usage strings
* | | Merge branch 'jn/mailinfo-scissors'Junio C Hamano2010-04-071-1/+2
|\ \ \ | | | | | | | | | | | | | | | | * jn/mailinfo-scissors: Teach mailinfo %< as an alternative scissors mark
| * | | Teach mailinfo %< as an alternative scissors markJonathan Nieder2010-04-041-1/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle perforations found “in the wild” more robustly by recognizing “%<” as an alternative scissors mark. This feature is only meant to support old habits. Discourage new use of the percent-based version by only documenting the 8< symbol so new users’ perforations can still be recognized by old versions of Git. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'sb/fmt-merge-msg'Junio C Hamano2010-04-061-103/+56
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sb/fmt-merge-msg: fmt-merge-msg: hide summary option fmt-merge-msg: remove custom string_list implementation string-list: add unsorted_string_list_lookup() fmt-merge-msg: use pretty.c routines t6200: test fmt-merge-msg more t6200: modernize with test_tick fmt-merge-msg: be quiet if nothing to merge
| * | | fmt-merge-msg: hide summary optionStephen Boyd2010-03-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --summary command line option has been deprecated in favor of --log. Hide the option from the help message to further discourage the use of this option. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>