summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-27doc: submodule.* config are keyed by submodule namesLibravatar W. Trevor King1-1/+1
Ever since 941987a5 (git-submodule: give submodules proper names, 2007-06-11) introduced the ability to move a submodule from one path to another inside its superproject tree without losing its identity, we should have consistently used submodule.<name>.* to access settings related to the named submodule. Reported-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19submodule add: If --branch is given, record it in .gitmodulesLibravatar W. Trevor King3-0/+7
This allows you to easily record a submodule.<name>.branch option in .gitmodules when you add a new submodule. With this patch, $ git submodule add -b <branch> <repository> [<path>] $ git config -f .gitmodules submodule.<path>.branch <branch> reduces to $ git submodule add -b <branch> <repository> [<path>] This means that future calls to $ git submodule update --remote ... will get updates from the same branch that you used to initialize the submodule, which is usually what you want. Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-19submodule update: add --remote for submodule's upstream changesLibravatar W. Trevor King5-2/+84
The current `update` command incorporates the superproject's gitlinked SHA-1 ($sha1) into the submodule HEAD ($subsha1). Depending on the options you use, it may checkout $sha1, rebase the $subsha1 onto $sha1, or merge $sha1 into $subsha1. This helps you keep up with changes in the upstream superproject. However, it's also useful to stay up to date with changes in the upstream subproject. Previous workflows for incorporating such changes include the ungainly: $ git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) && git pull' With this patch, all of the useful functionality for incorporating superproject changes can be reused to incorporate upstream subproject updates. When you specify --remote, the target $sha1 is replaced with a $sha1 of the submodule's origin/master tracking branch. If you want to merge a different tracking branch, you can configure the `submodule.<name>.branch` option in `.gitmodules`. You can override the `.gitmodules` configuration setting for a particular superproject by configuring the option in that superproject's default configuration (using the usual configuration hierarchy, e.g. `.git/config`, `~/.gitconfig`, etc.). Previous use of submodule.<name>.branch ======================================= Because we're adding a new configuration option, it's a good idea to check if anyone else is already using the option. The foreach-pull example above was described by Ævar in commit f030c96d8643fa0a1a9b2bd9c2f36a77721fb61f Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Date: Fri May 21 16:10:10 2010 +0000 git-submodule foreach: Add $toplevel variable Gerrit uses the same interpretation for the setting, but because Gerrit has direct access to the subproject repositories, it updates the superproject repositories automatically when a subproject changes. Gerrit also accepts the special value '.', which it expands into the superproject's branch name. Although the --remote functionality is using `submodule.<name>.branch` slightly differently, the effect is the same. The foreach-pull example uses the option to record the name of the local branch to checkout before pulls. The tracking branch to be pulled is recorded in `.git/modules/<name>/config`, which was initialized by the module clone during `submodule add` or `submodule init`. Because the branch name stored in `submodule.<name>.branch` was likely the same as the branch name used during the initial `submodule add`, the same branch will be pulled in each workflow. Implementation details ====================== In order to ensure a current tracking branch state, `update --remote` fetches the submodule's remote repository before calculating the SHA-1. However, I didn't change the logic guarding the existing fetch: if test -z "$nofetch" then # Run fetch only if $sha1 isn't present or it # is not reachable from a ref. (clear_local_git_env; cd "$path" && ( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) && test -z "$rev") || git-fetch)) || die "$(eval_gettext "Unable to fetch in submodule path '\$path'")" fi There will not be a double-fetch, because the new $sha1 determined after the `--remote` triggered fetch should always exist in the repository. If it doesn't, it's because some racy process removed it from the submodule's repository and we *should* be re-fetching. Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-11submodule: add get_submodule_config helper funtionLibravatar W. Trevor King1-0/+26
Several submodule configuration variables (e.g. fetchRecurseSubmodules) are read from .gitmodules with local overrides from the usual git config files. This shell function mimics that logic to help initialize configuration variables in git-submodule.sh. Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27Merge branch 'maint'Libravatar Junio C Hamano1-1/+2
2012-11-27Merge branch 'nd/maint-compat-fnmatch-fix' into maintLibravatar Junio C Hamano1-1/+1
* nd/maint-compat-fnmatch-fix: compat/fnmatch: fix off-by-one character class's length check
2012-11-27Merge branch 'jh/update-ref-d-through-symref' into maintLibravatar Junio C Hamano2-1/+19
* jh/update-ref-d-through-symref: Fix failure to delete a packed ref through a symref t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
2012-11-27Merge branch 'esr/maint-doc-fast-import' into maintLibravatar Junio C Hamano1-2/+6
* esr/maint-doc-fast-import: doc/fast-import: clarify how content states are built
2012-11-27Merge branch 'wtk/submodule-doc-fixup' into maintLibravatar Junio C Hamano2-2/+2
* wtk/submodule-doc-fixup: git-submodule: wrap branch option with "<>" in usage strings.
2012-11-27Documentation: improve phrasing in git-push.txtLibravatar Mark Szepieniec1-1/+2
The current version contains the sentence: Further suppose that the other person already pushed changes leading to A back to the original repository you two obtained the original commit X. which doesn't parse for me; I've changed it to Further suppose that the other person already pushed changes leading to A back to the original repository from which you two obtained the original commit X. Signed-off-by: Mark Szepieniec <mszepien@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26Merge branch 'maint'Libravatar Junio C Hamano2-2/+2
* maint: Fix typo in remote set-head usage Makefile: hide stderr of curl-config test
2012-11-26Fix typo in remote set-head usageLibravatar Antoine Pelisse1-1/+1
parenthesis are not matching in `builtin_remote_sethead_usage` as a square bracket is closing something never opened. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26Makefile: hide stderr of curl-config testLibravatar Paul Gortmaker1-1/+1
You will get $ make distclean 2>&1 | grep curl /bin/sh: curl-config: not found /bin/sh: curl-config: not found /bin/sh: curl-config: not found /bin/sh: curl-config: not found /bin/sh: curl-config: not found $ if you don't have a curl development package installed. The intent is not to alarm the user, but just to test if there is a new enough curl installed. However, if you look at search engine suggested completions, the above "error" messages are confusing people into thinking curl is a hard requirement. Redirect this error output to /dev/null as it is not necessary to be shown to the end users. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-26emacs: make 'git-status' work with separate git dirsLibravatar Enrico Scholz1-1/+1
when trying 'M-x git-status' in a submodule created with recent (1.7.5+) git, the command fails with | ... is not a git working tree This is caused by creating submodules with '--separate-git-dir' but still checking for a working tree by testing for a '.git' directory. The patch fixes this by relaxing the existing detection a little bit. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-25Update draft release notes to 1.8.1Libravatar Junio C Hamano1-0/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-25Merge branch 'rr/submodule-diff-config'Libravatar Junio C Hamano7-24/+98
Allow "git diff --submodule=log" to set to be the default via configuration. * rr/submodule-diff-config: submodule: display summary header in bold diff: rename "set" variable diff: introduce diff.submodule configuration variable Documentation: move diff.wordRegex from config.txt to diff-config.txt
2012-11-25Merge branch 'nd/maint-compat-fnmatch-fix'Libravatar Junio C Hamano1-1/+1
* nd/maint-compat-fnmatch-fix: compat/fnmatch: fix off-by-one character class's length check
2012-11-25Merge branch 'bc/do-not-recurse-in-die'Libravatar Junio C Hamano1-0/+15
* bc/do-not-recurse-in-die: usage.c: detect recursion in die routines and bail out immediately
2012-11-25Merge branch 'mk/complete-tcsh'Libravatar Junio C Hamano1-0/+63
* mk/complete-tcsh: tcsh-completion re-using git-completion.bash
2012-11-25Merge branch 'jh/update-ref-d-through-symref'Libravatar Junio C Hamano2-1/+19
"update-ref -d --deref SYM" to delete a ref through a symbolic ref that points to it did not remove it correctly. * jh/update-ref-d-through-symref: Fix failure to delete a packed ref through a symref t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
2012-11-25Merge branch 'lt/diff-stat-show-0-lines'Libravatar Junio C Hamano4-36/+42
We failed to mention a file without any content change but whose permission bit was modified, or (worse yet) a new file without any content in the "git diff --stat" output. * lt/diff-stat-show-0-lines: Fix "git diff --stat" for interesting - but empty - file changes
2012-11-25Merge branch 'sg/complete-help-undup'Libravatar Junio C Hamano1-1/+1
* sg/complete-help-undup: completion: remove 'help' duplicate from porcelain commands
2012-11-25Sync with 1.8.0.1Libravatar Junio C Hamano4-4/+17
2012-11-25Git 1.8.0.1Libravatar Junio C Hamano3-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-25Merge branch 'jk/checkout-out-of-unborn' into maintLibravatar Junio C Hamano1-0/+3
* jk/checkout-out-of-unborn: checkout: print a message when switching unborn branches
2012-11-25Merge branch 'cn/config-missing-path' into maintLibravatar Junio C Hamano2-1/+7
* cn/config-missing-path: config: don't segfault when given --path with a missing value
2012-11-25Merge branch 'jk/maint-gitweb-xss' into maintLibravatar Junio C Hamano2-0/+16
Fixes an XSS vulnerability in gitweb. * jk/maint-gitweb-xss: gitweb: escape html in rss title
2012-11-24Completion must sort before using uniqLibravatar Marc Khouzam1-1/+1
The user can be presented with invalid completion results when trying to complete a 'git checkout' command. This can happen when using a branch name prefix that matches multiple remote branches. For example, if available branches are: master remotes/GitHub/maint remotes/GitHub/master remotes/origin/maint remotes/origin/master When performing completion on 'git checkout ma' the user will be given the choices: maint master However, 'git checkout maint' will fail in this case, although completion previously said 'maint' was valid. Furthermore, when performing completion on 'git checkout mai', no choices will be suggested. So, the user is first told that the branch name 'maint' is valid, but when trying to complete 'mai' into 'maint', that completion is no longer valid. The completion results should never propose 'maint' as a valid branch name, since 'git checkout' will refuse it. The reason for this bug is that the uniq program only works with sorted input. The man page states "uniq prints the unique lines in a sorted file". When __git_refs uses the guess heuristic employed by checkout for tracking branches it wants to consider remote branches but only if the branch name is unique. To do that, it calls 'uniq -u'. However the input given to 'uniq -u' is not sorted. Therefore, in the above example, when dealing with 'git checkout ma', "__git_refs '' 1" will find the following list: master maint master maint master which, when passed to 'uniq -u' will remain the same. Therefore 'maint' will be wrongly suggested as a valid option. When dealing with 'git checkout mai', the list will be: maint maint which happens to be sorted and will be emptied by 'uniq -u', properly ignoring 'maint'. A solution for preventing the completion script from suggesting such invalid branch names is to first call 'sort' and then 'uniq -u'. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-21Update draft release notes for 1.8.1Libravatar Junio C Hamano1-0/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-21Merge branch 'esr/maint-doc-fast-import'Libravatar Junio C Hamano1-2/+6
* esr/maint-doc-fast-import: doc/fast-import: clarify how content states are built
2012-11-21Merge branch 'wtk/submodule-doc-fixup'Libravatar Junio C Hamano2-2/+2
* wtk/submodule-doc-fixup: git-submodule: wrap branch option with "<>" in usage strings.
2012-11-21Merge branch 'so/prompt-command'Libravatar Junio C Hamano1-8/+90
Updates __git_ps1 so that it can be used as $PROMPT_COMMAND, instead of being used for command substitution in $PS1, to embed color escape sequences in its output. * so/prompt-command: coloured git-prompt: paint detached HEAD marker in red Fix up colored git-prompt show color hints based on state of the git tree Allow __git_ps1 to be used in PROMPT_COMMAND
2012-11-21Merge branch 'jk/config-ignore-duplicates'Libravatar Junio C Hamano4-196/+232
Drop duplicate detection from "git-config --get"; this lets it better match the internal config callbacks, which clears up some corner cases with includes. * jk/config-ignore-duplicates: builtin/config.c: Fix a sparse warning git-config: use git_config_with_options git-config: do not complain about duplicate entries git-config: collect values instead of immediately printing git-config: fix regexp memory leaks on error conditions git-config: remove memory leak of key regexp t1300: test "git config --get-all" more thoroughly t1300: remove redundant test t1300: style updates
2012-11-21Merge branch 'jk/maint-http-half-auth-fetch'Libravatar Junio C Hamano1-1/+1
Finishing touches to squelch a compiler warning. * jk/maint-http-half-auth-fetch: remote-curl.c: Fix a compiler warning
2012-11-21remote-curl.c: Fix a compiler warningLibravatar Ramsay Jones1-1/+1
In particular, gcc issues an "'gzip_size' might be used uninitialized" warning (-Wuninitialized). However, this warning is a false positive, since the 'gzip_size' variable would not, in fact, be used uninitialized. In order to suppress the warning, we simply initialise the variable to zero in it's declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20compat/fnmatch: fix off-by-one character class's length checkLibravatar Nguyễn Thái Ngọc Duy1-1/+1
Character class "xdigit" is the only one that hits 6 character limit defined by CHAR_CLASS_MAX_LENGTH. All other character classes are 5 character long and therefore never caught by this. This should make xdigit tests in t3070 pass on Windows. Reported-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Sixth batch for 1.8.1Libravatar Junio C Hamano1-3/+39
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Merge branch 'ml/cygwin-mingw-headers'Libravatar Junio C Hamano2-0/+11
Make git compile on cygwin with newer header files. * ml/cygwin-mingw-headers: USE CGYWIN_V15_WIN32API as macro to select api for cygwin Update cygwin.c for new mingw-64 win32 api headers
2012-11-20Merge branch 'jk/checkout-out-of-unborn'Libravatar Junio C Hamano1-0/+3
* jk/checkout-out-of-unborn: checkout: print a message when switching unborn branches
2012-11-20Merge branch 'cn/config-missing-path'Libravatar Junio C Hamano2-1/+7
"git config --path $key" segfaulted on "[section] key" (a boolean "true" spelled without "=", not "[section] key = true"). * cn/config-missing-path: config: don't segfault when given --path with a missing value
2012-11-20Merge branch 'jl/submodule-rm'Libravatar Junio C Hamano1-15/+15
* jl/submodule-rm: docs: move submodule section
2012-11-20Merge branch 'mg/replace-resolve-delete'Libravatar Junio C Hamano2-6/+20
Be more user friendly to people using "git replace -d". * mg/replace-resolve-delete: replace: parse revision argument for -d
2012-11-20Merge branch 'jk/maint-gitweb-xss'Libravatar Junio C Hamano2-0/+16
Fixes an XSS vulnerability in gitweb. * jk/maint-gitweb-xss: gitweb: escape html in rss title
2012-11-20Merge branch 'rh/maint-gitweb-highlight-ext'Libravatar Junio C Hamano1-9/+8
Fixes a clever misuse of perl's list interpretation. * rh/maint-gitweb-highlight-ext: gitweb.perl: fix %highlight_ext mappings
2012-11-20Merge branch 'pw/maint-p4-rcs-expansion-newline'Libravatar Junio C Hamano2-1/+20
I do not have p4 to play with, but looks obviously correct to me. * pw/maint-p4-rcs-expansion-newline: git p4: RCS expansion should not span newlines
2012-11-20Merge branch 'mh/alt-odb-string-list-cleanup'Libravatar Junio C Hamano1-28/+22
Cleanups in the alternates code. Fixes a potential bug and makes the code much cleaner. * mh/alt-odb-string-list-cleanup: link_alt_odb_entries(): take (char *, len) rather than two pointers link_alt_odb_entries(): use string_list_split_in_place()
2012-11-20Merge branch 'ta/doc-cleanup'Libravatar Junio C Hamano20-68/+134
* ta/doc-cleanup: Documentation: build html for all files in technical and howto Documentation/howto: convert plain text files to asciidoc Documentation/technical: convert plain text files to asciidoc Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txt Shorten two over-long lines in git-bisect-lk2009.txt by abbreviating some sha1 Split over-long synopsis in git-fetch-pack.txt into several lines
2012-11-20Merge branch 'kb/preload-index-more'Libravatar Junio C Hamano3-6/+15
Use preloadindex in more places, which has a nice speedup on systems with slow stat calls (and even on Linux). * kb/preload-index-more: update-index/diff-index: use core.preloadindex to improve performance
2012-11-20Merge branch 'jk/maint-http-half-auth-fetch'Libravatar Junio C Hamano3-8/+39
Fixes fetch from servers that ask for auth only during the actual packing phase. This is not really a recommended configuration, but it cleans up the code at the same time. * jk/maint-http-half-auth-fetch: remote-curl: retry failed requests for auth even with gzip remote-curl: hoist gzip buffer size to top of post_rpc
2012-11-20Sync with maintLibravatar Junio C Hamano1-1/+7
* maint: Further preparation for 1.8.0.1