summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-03-20pull: replace unnecessary sed invocationStephen Boyd
Getting the shortened branch name is as easy as using the shell's parameter expansion. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-17Merge branch 'maint'Junio C Hamano
* maint: Documentation: receive.denyCurrentBranch defaults to 'refuse' bash: complete *_HEAD refs if present
2010-03-17Documentation: receive.denyCurrentBranch defaults to 'refuse'Thomas Rast
acd2a45 (Refuse updating the current branch in a non-bare repository via push, 2009-02-11) changed the default to refuse such a push, but it forgot to update the docs. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-17bash: complete *_HEAD refs if presentIan Ward Comfort
We already complete HEAD, of course, and might as well complete the other common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and MERGE_HEAD. Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-17Merge branch 'maint'Junio C Hamano
* maint: Documentation/git-read-tree: clarify 2-tree merge Documentation/git-read-tree: fix table layout
2010-03-16refs: ref entry with NULL sha1 is can be a dangling symrefJunio C Hamano
Brandon Casey noticed that t5505 had accidentally broken its && chain, hiding inconsistency between the code that writes the warning to the standard output and the test that expects to see the warning on the standard error, which was introduced by f8948e2 (remote prune: warn dangling symrefs, 2009-02-08). It turns out that the issue is deeper than that. After f8948e2, a symref that is dangling is marked with a NULL sha1, and the idea of using NULL sha1 to mean a deleted ref was scrapped, but somehow a follow-up eafb452 (do_one_ref(): null_sha1 check is not about broken ref, 2009-07-22) incorrectly reorganized do_one_ref(), still thinking NULL sha1 is never used in the code. Fix this by: - adopt Brandon's fix to t5505 test; - introduce REF_BROKEN flag to mark a ref that fails to resolve (dangling symref); - move the check for broken ref back inside the "if we are skipping dangling refs" code block. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-15Documentation/git-read-tree: clarify 2-tree mergeMichael J Gruber
Clarify the description of the 2-tree merge by defining the terms which are used in the table, and by applying some small linguistic changes. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-15Documentation/git-read-tree: fix table layoutMichael J Gruber
Asciidoc takes the first non-space character in the first line of the paragraph as a reference point for preformatted layout, so adjust to that to make the table align. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-15Merge branch 'sd/format-patch-to'Junio C Hamano
* sd/format-patch-to: send-email: add --no-cc, --no-to, and --no-bcc format-patch: add --no-cc, --no-to, and --no-add-headers format-patch: use a string_list for headers Add 'git format-patch --to=' option and 'format.to' configuration variable.
2010-03-15Merge branch 'tc/http-cleanup'Junio C Hamano
* tc/http-cleanup: remote-curl: init walker only when needed remote-curl: use http_fetch_ref() instead of walker wrapper http: init and cleanup separately from http-walker http-walker: cleanup more thoroughly http-push: remove "|| 1" to enable verbose check t554[01]-http-push: refactor, add non-ff tests t5541-http-push: check that ref is unchanged for non-ff test
2010-03-15Merge branch 'tc/transport-verbosity'Junio C Hamano
* tc/transport-verbosity: transport: update flags to be in running order fetch and pull: learn --progress push: learn --progress transport->progress: use flag authoritatively clone: support multiple levels of verbosity push: support multiple levels of verbosity fetch: refactor verbosity option handling into transport.[ch] Documentation/git-push: put --quiet before --verbose Documentation/git-pull: put verbosity options before merge/fetch ones Documentation/git-clone: mention progress in -v Conflicts: transport.h
2010-03-15Merge branch 'ld/push-porcelain'Junio C Hamano
* ld/push-porcelain: t5516: Use test_cmp when appropriate git-push: add tests for git push --porcelain git-push: make git push --porcelain print "Done" git-push: send "To <remoteurl>" messages to the standard output in --porcelain mode git-push: fix an advice message so it goes to stderr Conflicts: transport.c
2010-03-15Merge branch 'jh/notes'Junio C Hamano
* jh/notes: (33 commits) Documentation: fix a few typos in git-notes.txt notes: fix malformed tree entry builtin-notes: Minor (mostly parse_options-related) fixes builtin-notes: Add "copy" subcommand for copying notes between objects builtin-notes: Misc. refactoring of argc and exit value handling builtin-notes: Add -c/-C options for reusing notes builtin-notes: Refactor handling of -F option to allow combining -m and -F builtin-notes: Deprecate the -m/-F options for "git notes edit" builtin-notes: Add "append" subcommand for appending to note objects builtin-notes: Add "add" subcommand for adding notes to objects builtin-notes: Add --message/--file aliases for -m/-F options builtin-notes: Add "list" subcommand for listing note objects Documentation: Generalize git-notes docs to 'objects' instead of 'commits' builtin-notes: Add "prune" subcommand for removing notes for missing objects Notes API: prune_notes(): Prune notes that belong to non-existing objects t3305: Verify that removing notes triggers automatic fanout consolidation builtin-notes: Add "remove" subcommand for removing existing notes Teach builtin-notes to remove empty notes Teach notes code to properly preserve non-notes in the notes tree t3305: Verify that adding many notes with git-notes triggers increased fanout ... Conflicts: Makefile
2010-03-14tests for "git add ignored-dir/file" without -fJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-14dir: fix COLLECT_IGNORED on excluded prefixesJeff King
As we walk the directory tree, if we see an ignored path, we want to add it to the ignored list only if it matches any pathspec that we were given. We used to check for the pathspec to appear explicitly. E.g., if we see "subdir/file" and it is excluded, we check to see if we have "subdir/file" in our pathspec. However, this interacts badly with the optimization to avoid recursing into ignored subdirectories. If "subdir" as a whole is ignored, then we never recurse, and consider only whether "subdir" itself is in our pathspec. It would not match a pathspec of "subdir/file" explicitly, even though it is the reason that subdir/file would be excluded. This manifests itself to the user as "git add subdir/file" failing to correctly note that the pathspec was ignored. This patch extends the in_pathspec logic to include prefix directory case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-14t0050: mark non-working test as suchJunio C Hamano
The test is to prepare an empty file "camelcase" in the index, remove and replace it with another file "CamelCase" with "1" as its contents in the working tree, and add it to the index, in a repository configured to be case insensitive. However, the test actually checked ls-files knows about a pathname that matches "camelcase" case insensitively. It didn't check if the added contents actually was the updated one. Mark the test as non-working. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-14git status: ignoring untracked files must apply to submodules tooJens Lehmann
Since 1.7.0 submodules are considered dirty when they contain untracked files. But when git status is called with the "-uno" option, the user asked to ignore untracked files, so they must be ignored in submodules too. To achieve this, the new flag DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES is introduced. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-14Merge branch 'maint'Junio C Hamano
* maint: don't use default revision if a rev was specified for_each_recent_reflog_ent(): use strbuf, fix offset handling t/Makefile: remove test artifacts upon "make clean" blame: fix indent of line numbers
2010-03-14don't use default revision if a rev was specifiedDave Olszewski
If a revision is specified, it happens not to have any commits, don't use the default revision. By doing so, surprising and undesired behavior can happen, such as showing the reflog for HEAD when a branch was specified. [jc: squashed a test from René] Signed-off-by: Dave Olszewski <cxreg@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13for_each_recent_reflog_ent(): use strbuf, fix offset handlingRené Scharfe
As Vladimir reported, "git log -g refs/stash" surprisingly showed the reflog of HEAD if the message in the reflog file was too long. To fix this, convert for_each_recent_reflog_ent() to use strbuf_getwholeline() instead of fgets(), for safety and to avoid any size limits for reflog entries. Also reverse the logic of the part of the function that only looks at file tails. It used to close the file if fgets() succeeded. The following fgets() call in the while loop was likely to fail in this case, too, so passing an offset to for_each_recent_reflog_ent() never worked. Change it to error out if strbuf_getwholeline() fails instead. Reported-by: Vladimir Panteleev <vladimir@thecybershadow.net> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13t/Makefile: remove test artifacts upon "make clean"Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13blame: fix indent of line numbersRené Scharfe
Correct the calculation of the number of digits for line counts of the form 10^n-1 (9, 99, ...) in lineno_width(). This makes blame stop printing an extra space before the line numbers of files with that many total lines. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: t9150,t9151: Add rewrite-root option to init git-svn: Fix merge detecting with rewrite-root
2010-03-13t9150,t9151: Add rewrite-root option to initTuomas Suutari
The rewrite-root option seems to be a bit problematic with merge detecting, so it's better to have a merge detecting test with it turned on. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-03-13git-svn: Fix merge detecting with rewrite-rootTuomas Suutari
Detecting of merges from svn:mergeinfo or svk merge tickets failed with rewrite-root option. This fixes it. Signed-off-by: Tuomas Suutari <tuomas.suutari@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-03-13git status: Fix false positive "new commits" output for dirty submodulesJens Lehmann
Testing if the output "new commits" should appear in the long format of "git status" is done by comparing the hashes of the diffpair. This always resulted in printing "new commits" for submodules that contained untracked or modified content, even if they did not contain new commits. The reason was that match_stat_with_submodule() did set the "changed" flag for dirty submodules, resulting in two->sha1 being set to the null_sha1 at the call sites, which indicates that new commits are present. This is changed so that when no new commits are present, the same object names are in the sha1 field for both sides of the filepair, and the working tree side will have the "dirty_submodule" flag set when appropriate. For a submodule to be seen as modified even when it just has a dirty work tree, some conditions had to be extended to also check for the "dirty_submodule" flag. Unfortunately the test case that should have found this bug had been changed incorrectly too. It is fixed and extended to test for other combinations too. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13Refactor dirty submodule detection in diff-lib.cJens Lehmann
Moving duplicated code into the new function match_stat_with_submodule(). Replacing the implicit activation of detailed checks for the dirtiness of submodules when DIFF_FORMAT_PATCH was selected with explicitly setting the recently added DIFF_OPT_DIRTY_SUBMODULES option in diff_setup_done(). Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13Merge branch 'maint'Junio C Hamano
* maint: t9400: Use test_cmp when appropriate
2010-03-13notes: rework subcommands and parse optionsStephen Boyd
Running 'git notes copy -h' is not very helfpul right now. It lists the options for all the git notes subcommands and is rather confusing. Fix this by splitting cmd_notes() into separate functions for each subcommand (besides append and edit since they're very similar) and only providing a usage message for the subcommand. This has an added benefit of reducing the code complexity while making it safer and easier to read. The downside is we get some code bloat from similar setup and teardown needed for notes and options parsing. We also get a bit stricter in options parsing by only allowing the ref option to come before the subcommand. Acked-by: Johan Herland <johan@herland.net> Cc: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13git-notes(1): add a section about the meaning of historyThomas Rast
To the displaying code, the only interesting thing about a notes ref is that it has a tree of the required format. However, notes actually have a history since they are recorded as successive commits. Make a note about the existence of this history in the manpage, but keep some doors open if we want to change the details. 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>
2010-03-13notes: track whether notes_trees were changed at allThomas Rast
Currently, the notes copying is a bit wasteful since it always creates new trees, even if no notes were copied at all. Teach add_note() and remove_note() to flag the affected notes tree as changed ('dirty'). Then teach builtin/notes.c to use this knowledge and avoid committing trees that weren't changed. 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>
2010-03-13notes: add shorthand --ref to override GIT_NOTES_REFThomas Rast
Adds a shorthand option that overrides the GIT_NOTES_REF variable, and hence determines the notes tree that will be manipulated. It also DWIMs a refs/notes/ prefix. 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>
2010-03-13commit --amend: copy notes to the new commitThomas Rast
Teaches 'git commit --amend' to copy notes. The catch is that this must also be guarded by --no-post-rewrite, which we use to prevent --amend from copying notes during a rebase -i 'edit'/'reword'. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13rebase: support automatic notes copyingThomas Rast
Luckily, all the support already happens to be there. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13notes: implement helpers needed for note copying during rewriteThomas Rast
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>
2010-03-13notes: implement 'git notes copy --stdin'Thomas Rast
This implements a mass-copy command that takes a sequence of lines in the format <from-sha1> SP <to-sha1> [ SP <rest> ] LF on stdin, and copies each <from-sha1>'s notes to the <to-sha1>. The <rest> is ignored. The intent, of course, is that this can read the same input that the 'post-rewrite' hook gets. The copy_note() function is exposed for everyone's and in particular the next commit's use. 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>
2010-03-13rebase -i: invoke post-rewrite hookThomas Rast
Aside from the same issue that rebase also has (remembering the original commit across a conflict resolution), rebase -i brings an extra twist: We need to defer writing the rewritten list in the case of {squash,fixup} because their rewritten result should be the last commit in the squashed group. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13rebase: invoke post-rewrite hookThomas Rast
We have to deal with two separate code paths: a normal rebase, which actually goes through git-am; and rebase {-m|-s}. The only small issue with both is that they need to remember the original sha1 across a possible conflict resolution. rebase -m already puts this information in $dotest/current, and we just introduce a similar file for git-am. Note that in git-am, the hook really only runs when coming from git-rebase: the code path that sets the $dotest/original-commit file is guarded by a test for $dotest/rebasing. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13commit --amend: invoke post-rewrite hookThomas Rast
The rough structure of run_rewrite_hook() comes from run_receive_hook() in receive-pack. We introduce a --no-post-rewrite option and use it to avoid the hook when called from git-rebase -i 'edit'. The next patch will add full support in git-rebase, and we only want to invoke the hook once. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13Documentation: document post-rewrite hookThomas Rast
This defines the behaviour of the post-rewrite hook support, which will be implemented in the following patches. We deliberately do not document how often the hook will be invoked per rewriting command, but the interface is designed to keep that at "once". This would currently not matter too much, since both rebase and filter-branch are shellscripts and spawn many processes anyway. However, when a fast sequencer in C is implemented, it will be beneficial to only have to run the hook once. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-13Support showing notes from more than one notes treeThomas Rast
With this patch, you can set notes.displayRef to a glob that points at your favourite notes refs, e.g., [notes] displayRef = refs/notes/* Then git-log and friends will show notes from all trees. Thanks to Junio C Hamano for lots of feedback, which greatly influenced the design of the entire series and this commit in particular. 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>
2010-03-13test-lib: unset GIT_NOTES_REF to stop it from influencing testsThomas Rast
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>
2010-03-12t5516: Use test_cmp when appropriateJunio C Hamano
Consistently using test_cmp would make debugging test scripts far easier, as output from them run under "-v" option becomes readable. Besides, some platforms' "diff" implementations lack "-q" option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-12t9400: Use test_cmp when appropriateJunio C Hamano
Consistently using test_cmp would make debugging test scripts far easier, as output from them run under "-v" option becomes readable. Besides, some platforms' "diff" implementations lack "-q" option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-10Merge branch 'sd/init-template'Junio C Hamano
* sd/init-template: wrap-for-bin: do not export an empty GIT_TEMPLATE_DIR t/t0001-init.sh: add test for 'init with init.templatedir set' init: having keywords without value is not a global error. Add a "TEMPLATE DIRECTORY" section to git-init[1]. Add `init.templatedir` configuration variable.
2010-03-10Merge branch 'sh/am-keep-cr'Junio C Hamano
* sh/am-keep-cr: git-am: Add tests for `--keep-cr`, `--no-keep-cr` and `am.keepcr` git-am: Add am.keepcr and --no-keep-cr to override it git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit documentation: 'git-mailsplit --keep-cr' is not hidden anymore
2010-03-10Merge branch 'cp/add-u-pathspec'Junio C Hamano
* cp/add-u-pathspec: test for add with non-existent pathspec git add -u: die on unmatched pathspec
2010-03-10Makefile: update check-docs targetJunio C Hamano
When we added bunch of git-remote-* helper backends, we should have done this to squelch complaints that they do not have their own manual pages. Also the entry for git-remote-helpers was not properly marked as a non-command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-10Merge branch 'lt/deepen-builtin-source'Junio C Hamano
* lt/deepen-builtin-source: Move 'builtin-*' into a 'builtin/' subdirectory Conflicts: Makefile
2010-03-10git submodule summary: Handle HEAD as argument when on an unborn branchJens Lehmann
When calling "git submodule summary HEAD" on an unborn branch the output was empty even when it shouldn't have been ("git submodule summary" without the HEAD argument prints the expected output since commit "submodule summary: do not fail before the first commit"). This also fixes "git status" to emit the "Submodule changes to be committed" section on an unborn branch when used with the status.submodulesummary config option. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>