summaryrefslogtreecommitdiff
path: root/submodule.c
AgeCommit message (Collapse)Author
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-05git diff --submodule: Show detailed dirty status of submodulesJens Lehmann
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-25is_submodule_modified(): clear environment properlyGiuseppe Bilotta
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-01-31Fix memory leak in submodule.cJens Lehmann
The strbuf used in add_submodule_odb() was never released. So for every submodule - populated or not - we leaked its object directory name when using "git diff*" with the --submodule option. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-30is_submodule_modified(): fix breakage with external GIT_INDEX_FILEv1.7.0-rc1Junio C Hamano
Even when the environment was given for the top-level process, checking in the submodule work tree should use the index file associated with the work tree of the submodule. Do not export it to the environment. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-25Teach diff --submodule that modified submodule directory is dirtyJens Lehmann
Since commit 8e08b4 git diff does append "-dirty" to the work tree side if the working directory of a submodule contains new or modified files. Lets do the same when the --submodule option is used. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-23Merge branch 'jl/submodule-diff'Junio C Hamano
* jl/submodule-diff: Performance optimization for detection of modified submodules git status: Show uncommitted submodule changes too when enabled Teach diff that modified submodule directory is dirty Show submodules as modified when they contain a dirty work tree
2010-01-17Show submodules as modified when they contain a dirty work treeJens Lehmann
Until now a submodule only then showed up as modified in the supermodule when the last commit in the submodule differed from the one in the index or the diffed against commit of the superproject. A dirty work tree containing new untracked or modified files in a submodule was undetectable when looking at it from the superproject. Now git status and git diff (against the work tree) in the superproject will also display submodules as modified when they contain untracked or modified files, even if the compared ref matches the HEAD of the submodule. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-12submodule.c: mark file-local function staticJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-21submodule.c: Squelch a "use before assignment" warningDavid Aguilar
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) compiler (and probably others) mistakenly thinks variable 'right' is used before assigned. Work around it by giving it a fake initialization. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-31fixup tr/stash-format mergeJunio C Hamano
2009-10-20Add the --submodule option to the diff option familyJohannes Schindelin
When you use the option --submodule=log you can see the submodule summaries inlined in the diff, instead of not-quite-helpful SHA-1 pairs. The format imitates what "git submodule summary" shows. To do that, <path>/.git/objects/ is added to the alternate object databases (if that directory exists). This option was requested by Jens Lehmann at the GitTogether in Berlin. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>