summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-12git status: Fix false positive "new commits" output for dirty submodulesLibravatar Jens Lehmann3-9/+88
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-12Refactor dirty submodule detection in diff-lib.cLibravatar Jens Lehmann2-18/+33
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-08git status: Show detailed dirty status of submodules in long formatLibravatar Jens Lehmann5-12/+46
Since 1.7.0 there are three reasons a submodule is considered modified against the work tree: It contains new commits, modified content or untracked content. Lets show all reasons in the long format of git status, so the user can better asses the nature of the modification. This change does not affect the short and porcelain formats. Two new members are added to "struct wt_status_change_data" to store the information gathered by run_diff_files(). wt-status.c uses the new flag DIFF_OPT_DIRTY_SUBMODULES to tell diff-lib.c it wants to get detailed dirty information about submodules. A hint line for submodules is printed in the dirty header when dirty submodules are present. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-04git diff --submodule: Show detailed dirty status of submodulesLibravatar Jens Lehmann5-21/+58
When encountering a dirty submodule while doing "git diff --submodule" print an extra line for new untracked content and another for modified but already tracked content. And if the HEAD of the submodule is equal to the ref diffed against in the superproject, drop the output which would just show the same SHA1s and no commit message headlines. To achieve that, the dirty_submodule bitfield is expanded to two bits. The output of "git status" inside the submodule is parsed to set the according bits. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24is_submodule_modified(): clear environment properlyLibravatar Giuseppe Bilotta1-11/+11
Rather than only clearing GIT_INDEX_FILE, take the list of environment variables to clear from local_repo_env, appending the settings for GIT_DIR and GIT_WORK_TREE. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24submodules: ensure clean environment when operating in a submoduleLibravatar Giuseppe Bilotta1-10/+10
git-submodule used to take care of clearing GIT_DIR whenever it operated on a submodule index or configuration, but forgot to unset GIT_WORK_TREE or other repo-local variables. This would lead to failures e.g. when GIT_WORK_TREE was set. This only happened in very unusual contexts such as operating on the main worktree from outside of it, but since "git-gui: set GIT_DIR and GIT_WORK_TREE after setup" (a9fa11fe5bd5978bb) such failures could also be provoked by invoking an external tool such as "git submodule update" from the Git Gui in a standard setup. Solve by using the newly introduced clear_local_git_env() shell function to ensure that all repo-local environment variables are unset. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24shell setup: clear_local_git_env() functionLibravatar Giuseppe Bilotta1-0/+7
Introduce an auxiliary function to clear all repo-local environment variables. This should be invoked by any shell script that switches repository during execution, to ensure that the environment is clean and that things such as the git dir and worktree are set up correctly. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24rev-parse: --local-env-vars optionLibravatar Giuseppe Bilotta2-0/+13
This prints the list of repo-local environment variables. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24Refactor list of of repo-local env varsLibravatar Giuseppe Bilotta3-12/+28
Move the list of GIT_* environment variables that are local to a repository into a static list in environment.c, as it is also useful elsewhere. Also add the missing GIT_CONFIG variable to the list. Make it easy to use the list both by NULL-termination and by size; the latter (excluding the terminating NULL) is stored in the local_repo_env_size define. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12Git 1.7.0Libravatar Junio C Hamano3-1/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12Merge branch 'maint'Libravatar Junio C Hamano2-2/+2
* maint: Fix typo in 1.6.6.2 release notes Re-fix check-ref-format documentation mark-up
2010-02-12Fix typo in 1.6.6.2 release notesLibravatar Junio C Hamano1-1/+1
Of course, these are changes since 1.6.6.1; changes since 1.6.6.2 would have been nil. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12Re-fix check-ref-format documentation mark-upLibravatar Junio C Hamano1-1/+1
It is not double-backslash we forbid; backslashes are forbidden since a4c2e699 (Disallow '\' in ref names, 2009-05-08) Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12archive documentation: attributes are taken from the tree by defaultLibravatar Junio C Hamano1-0/+8
By default, git-archive takes attributes from the tree being archived. People however often wonder why their attempts to affect the way how the command archives their tree by changing .gitattributes in their work tree fail. Add a bit of explanatory note to tell them how to achieve what they want to do. Noticed-by: Francois Marier Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12Documentation: minor fixes to RelNotes-1.7.0Libravatar Michael J Gruber1-8/+8
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12bash: support 'git am's new '--continue' optionLibravatar SZEDER Gábor1-1/+1
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: filter-branch: Fix error message for --prune-empty --commit-filter
2010-02-11filter-branch: Fix error message for --prune-empty --commit-filterLibravatar Jacob Helwig1-1/+1
Running filter-branch with --prune-empty and --commit-filter reports: "Cannot set --prune-empty and --filter-commit at the same time". Change it to use the correct option name: --commit-filter Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11am: switch --resolved to --continueLibravatar Jeff King2-3/+5
Rebase calls this same function "--continue", which means users may be trained to type it. There is no reason to deprecate --resolved (or -r), so we will keep it as a synonym. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Update draft release notes to 1.7.0 one more timeLibravatar Junio C Hamano1-15/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Sync with 1.6.6.2Libravatar Junio C Hamano4-4/+53
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Git 1.6.6.2Libravatar Junio C Hamano4-3/+50
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Merge branch 'maint-1.6.5' into maintLibravatar Junio C Hamano1-2/+4
* maint-1.6.5: t8003: check exit code of command and error message separately
2010-02-10t8003: check exit code of command and error message separatelyLibravatar Junio C Hamano1-2/+4
Shell reports exit status only from the most downstream command in a pipeline. In these tests, we want to make sure that the command fails in a controlled way, and produces a correct error message. This issue was known by Jay who submitted the patch, and also was pointed out by Hannes during the review process, but I forgot to fix it up before applying. Sorry about that. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Merge branch 'sp/maint-fast-import-large-blob' into maintLibravatar Junio C Hamano5-20/+227
* sp/maint-fast-import-large-blob: fast-import: Stream very large blobs directly to pack
2010-02-10Merge branch 'gp/maint-cvsserver' into maintLibravatar Junio C Hamano1-1/+1
* gp/maint-cvsserver: git-cvsserver: allow regex metacharacters in CVSROOT
2010-02-10Merge branch 'jc/maint-reflog-bad-timestamp' into maintLibravatar Junio C Hamano4-10/+86
* jc/maint-reflog-bad-timestamp: t0101: use a fixed timestamp when searching in the reflog Update @{bogus.timestamp} fix not to die() approxidate_careful() reports errorneous date string
2010-02-10Merge branch 'il/maint-xmallocz' into maintLibravatar Junio C Hamano4-10/+15
* il/maint-xmallocz: Fix integer overflow in unpack_compressed_entry() Fix integer overflow in unpack_sha1_rest() Fix integer overflow in patch_delta() Add xmallocz()
2010-02-10Merge branch 'jh/maint-config-file-prefix' into maintLibravatar Junio C Hamano2-1/+12
* jh/maint-config-file-prefix: builtin-config: Fix crash when using "-f <relative path>" from non-root dir
2010-02-10Merge branch 'nd/include-termios-for-osol' into maintLibravatar Junio C Hamano1-0/+1
* nd/include-termios-for-osol: Add missing #include to support TIOCGWINSZ on Solaris
2010-02-10Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maintLibravatar Junio C Hamano2-1/+58
* jc/maint-1.6.1-checkout-m-custom-merge: checkout -m path: fix recreating conflicts Conflicts: t/t7201-co.sh
2010-02-10Merge branch 'rs/maint-archive-match-pathspec' into maintLibravatar Junio C Hamano1-1/+24
* rs/maint-archive-match-pathspec: archive: complain about path specs that don't match anything
2010-02-10check-ref-format documentation: fix enumeration mark-upLibravatar Junio C Hamano1-1/+1
The last item in the enumerated refname rule was mistakenly made into a sub-item of the 7th one. It should be the 8th one in the list on its own. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10Documentation: quote braces in {upstream} notationLibravatar Thomas Rast1-1/+1
The lack of quoting made the entire line disappear. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08t3902: Protect against OS X normalizationLibravatar Brian Gernhardt1-4/+4
8424981: "Fix invalid read in quote_c_style_counted" introduced a test that used "caractère spécial" as a directory name. Git creates it as "caract\303\250re sp\303\251cial" OS X stores it as "caracte\314\200re spe\314\201cial" To work around this problem, use the already introduced $FN as the directory name. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08Merge branch 'maint'Libravatar Junio C Hamano5-14/+28
* maint: blame: prevent a segv when -L given start > EOF git-push: document all the status flags used in the output Fix parsing of imap.preformattedHTML and imap.sslverify git-add documentation: Fix shell quoting example
2010-02-08Merge branch 'maint-1.6.5' into maintLibravatar Junio C Hamano2-1/+9
* maint-1.6.5: blame: prevent a segv when -L given start > EOF
2010-02-08blame: prevent a segv when -L given start > EOFLibravatar Jay Soffian2-1/+9
blame would segv if given -L <lineno> with <lineno> past the end of the file. While we're fixing the bug, add test cases for an invalid <start> when called as -L <start>,<end> or -L<start>. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08Merge branch 'jc/maint-push-doc-status' into maintLibravatar Junio C Hamano1-5/+10
* jc/maint-push-doc-status: git-push: document all the status flags used in the output
2010-02-08git-push: document all the status flags used in the outputLibravatar Junio C Hamano1-5/+10
We didn't talk about '-' (deletion), '*' (addition), nor '+' (forced). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08Merge branch 'jc/maint-imap-config-parse' into maintLibravatar Junio C Hamano1-7/+8
* jc/maint-imap-config-parse: Fix parsing of imap.preformattedHTML and imap.sslverify
2010-02-08Fix parsing of imap.preformattedHTML and imap.sslverifyLibravatar Junio C Hamano1-7/+8
These two variables are boolean and can lack "= value" in the configuration file. Do not reject such input early in the parser callback function. Also the key are downcased before being given to the callback, so we should run strcmp() with keyword spelled in all-lowercase. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08Merge branch 'jc/maint-doc-git-add-example' into maintLibravatar Junio C Hamano1-1/+1
* jc/maint-doc-git-add-example: git-add documentation: Fix shell quoting example
2010-02-08git-add documentation: Fix shell quoting exampleLibravatar Junio C Hamano1-1/+1
When 921177f (Documentation: improve "add", "pull" and "format-patch" examples, 2008-05-07) converted this from enumeration header to displayed text, it failed to adjust for the AsciiDoc's rule to quote backslashes. In displayed text, backslash is shown verbatim, while in enumeration header, we need to double it. We have a similar construct in git-rm.txt documentation, and need to be careful when somebody wants to update it to match the style of the "git add" example. Noticed by: Greg Bacon <gbacon@dbresearch.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08Revert "pack-objects: fix pack generation when using pack_size_limit"Libravatar Nicolas Pitre2-12/+10
This reverts most of commit a2430dde8ceaaaabf05937438249397b883ca77a. That commit made the situation better for repositories with relatively small number of objects. However with many objects and a small pack size limit, the time required to complete the repack tends towards O(n^2), or even much worse with long delta chains. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-07Merge git://repo.or.cz/git-guiLibravatar Junio C Hamano34-2514/+3126
* git://repo.or.cz/git-gui: git-gui: update french translation git-gui: update Japanese translation git-gui: fix shortcut for menu "Commit/Revert Changes" git-gui: Quote git path when starting another gui in a submodule git-gui: update Italian translation git-gui: Update Swedish translation (520t0f0u) git-gui: use themed tk widgets with Tk 8.5 git-gui: Update German translation (12 new or changed strings). git-gui: Update translation template git-gui: Remove unused icon file_parttick git-gui: use different icon for new and modified files in the index git-gui: set GIT_DIR and GIT_WORK_TREE after setup git-gui: update shortcut tools to use _gitworktree git-gui: handle bare repos correctly git-gui: handle non-standard worktree locations git-gui: Support applying a range of changes at once git-gui: Add a special diff popup menu for submodules git-gui: Use git diff --submodule when available
2010-02-07Merge branch 'maint'Libravatar Junio C Hamano2-18/+26
* maint: archive: simplify archive format guessing
2010-02-07archive: simplify archive format guessingLibravatar René Scharfe2-18/+26
The code to guess an output archive's format consumed any --format options and built a new one. Jonathan noticed that it does so in an unsafe way, risking to overflow the static buffer fmt_opt. Change the code to keep the existing --format options intact and to only add a new one if a format could be guessed based on the output file name. The new option is added as the first one, allowing the existing ones to overrule it, i.e. explicit --format options given on the command line win over format guesses, as before. To simplify the code further, format_from_name() is changed to return the full --format option, thus no potentially dangerous sprintf() calls are needed any more. Reported-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-06Fix invalid read in quote_c_style_countedLibravatar Jeff King2-2/+21
This function did not work on strings that were not NUL-terminated. It reads through a length-bounded string, searching for characters in need of quoting. After we find one, we output the quoted character, then advance our pointer to find the next one. However, we never decremented the length, meaning we ended up looking at whatever random junk was stored after the string. This bug was not found by the existing tests because most code paths feed a NUL-terminated string. The notable exception is a directory name being fed by ls-tree. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-06docs: fix filter-branch example for quoted pathsLibravatar Jeff King1-1/+1
If there is a quoted path, update-index will correctly unquote it. However, we must take care to put our new prefix inside the double-quote. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>