Skip to content
Commits on May 1, 2010
  1. git-submodule.sh: properly initialize shell variables

    Gerrit Pape committed with Apr 26, 2010
    git-submodule inherits variables from the environment it is started in,
    expects the internal variables init= and recursive= to have an empty
    value, but doesn't initialize them appropriately.  Thanks to the
    selftests, this can be reproduced through
    
     init=1 make test
     recursive=1 make test
    
    With this commit the variables are initialized, and the selftests
    succeed even if these variables have some values in the environment.
    
    The bug was discovered through the Debian autobuilders
     http://bugs.debian.org/569594
    
    Signed-off-by: Gerrit Pape <pape@smarden.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 25, 2010
  1. @Oblomov

    submodules: ensure clean environment when operating in a submodule

    Oblomov committed with Feb 25, 2010
    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" (a9fa11f) 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>
Commits on Jan 17, 2010
  1. @jlehmann

    git status: Show uncommitted submodule changes too when enabled

    jlehmann committed with Jan 17, 2010
    When the configuration variable status.submodulesummary is not 0 or
    false, "git status" shows the submodule summary of the staged submodule
    commits. But it did not show the summary of those commits not yet
    staged in the supermodule, making it hard to see what will not be
    committed.
    
    The output of "submodule summary --for-status" has been changed from
    "# Modified submodules:" to "# Submodule changes to be committed:" for
    the already staged changes. "# Submodules changed but not updated:" has
    been added for changes that will not be committed. This is much clearer
    and consistent with the output for regular files.
    
    Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 25, 2009
  1. Merge branch 'rs/work-around-grep-opt-insanity'

    committed Nov 25, 2009
    * rs/work-around-grep-opt-insanity:
      Protect scripted Porcelains from GREP_OPTIONS insanity
      mergetool--lib: simplify guess_merge_tool()
    
    Conflicts:
    	git-instaweb.sh
Commits on Nov 24, 2009
  1. Protect scripted Porcelains from GREP_OPTIONS insanity

    committed Nov 23, 2009
    If the user has exported the GREP_OPTIONS environment variable, the output
    from "grep" and "egrep" in scripted Porcelains may be different from what
    they expect.  For example, we may want to count number of matching lines,
    by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use.
    
    The approach taken by this change to address this issue is to protect only
    our own use of grep/egrep.  Because we do not unset it at the beginning of
    our scripts, hook scripts run from the scripted Porcelains are exposed to
    the same insanity this environment variable causes when grep/egrep is used
    to implement logic (e.g. "grep | wc -l"), and it is entirely up to the
    hook scripts to protect themselves.
    
    On the other hand, applypatch-msg hook may want to show offending words in
    the proposed commit log message using grep to the end user, and the user
    might want to set GREP_OPTIONS=--color to paint the match more visibly.
    The approach to protect only our own use without unsetting the environment
    variable globally will allow this use case.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 21, 2009
  1. Merge branch 'jl/submodule-add-noname'

    committed Nov 20, 2009
    * jl/submodule-add-noname:
      git submodule add: make the <path> parameter optional
Commits on Sep 29, 2009
  1. @spearce

    typo fix: Directory `...' exist, ...: s/exist/exists/

    Jim Meyering committed with spearce Sep 29, 2009
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Sep 22, 2009
  1. @jlehmann

    git submodule add: make the <path> parameter optional

    jlehmann committed with Sep 22, 2009
    When <path> is not given, use the "humanish" part of the source repository
    instead.
    
    Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 27, 2009
  1. Merge branch 'jh/submodule-foreach'

    committed Aug 27, 2009
    * jh/submodule-foreach:
      git clone: Add --recursive to automatically checkout (nested) submodules
      t7407: Use 'rev-parse --short' rather than bash's substring expansion notation
      git submodule status: Add --recursive to recurse into nested submodules
      git submodule update: Introduce --recursive to update nested submodules
      git submodule foreach: Add --recursive to recurse into nested submodules
      git submodule foreach: test access to submodule name as '$name'
      Add selftest for 'git submodule foreach'
      git submodule: Cleanup usage string and add option parsing to cmd_foreach()
      git submodule foreach: Provide access to submodule name, as '$name'
    
    Conflicts:
    	Documentation/git-submodule.txt
    	git-submodule.sh
Commits on Aug 19, 2009
  1. @jherland

    git submodule status: Add --recursive to recurse into nested submodules

    jherland committed with Aug 19, 2009
    In very large and hierarchically structured projects, one may encounter
    nested submodules. In these situations, it is valuable to not only show
    status for all the submodules in the current repo (which is what is
    currently done by 'git submodule status'), but also to show status for
    all submodules at all levels (i.e. recursing into nested submodules as
    well).
    
    This patch teaches the new --recursive option to the 'git submodule status'
    command. The patch also includes documentation and selftests.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jherland

    git submodule update: Introduce --recursive to update nested submodules

    jherland committed with Aug 19, 2009
    In very large and hierarchically structured projects, one may encounter
    nested submodules. In these situations, it is valuable to not only update
    the submodules in the current repo (which is what is currently done by
    'git submodule update'), but also to operate on all submodules at all
    levels (i.e. recursing into nested submodules as well).
    
    This patch teaches the new --recursive option to the 'git submodule update'
    command. The patch also includes documentation and selftests.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @jherland

    git submodule foreach: Add --recursive to recurse into nested submodules

    jherland committed with Aug 19, 2009
    In very large and hierarchically structured projects, one may encounter
    nested submodules. In these situations, it is valuable to not only operate
    on all the submodules in the current repo (which is what is currently done
    by 'git submodule foreach'), but also to operate on all submodules at all
    levels (i.e. recursing into nested submodules as well).
    
    This patch teaches the new --recursive option to the 'git submodule foreach'
    command. The patch also includes documentation and selftests.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @jherland

    git submodule: Cleanup usage string and add option parsing to cmd_for…

    jherland committed with Aug 19, 2009
    …each()
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 18, 2009
  1. @jherland

    git submodule foreach: Provide access to submodule name, as '$name'

    jherland committed with Aug 16, 2009
    The argument to 'git submodule foreach' already has access to the variables
    '$path' (the path to the submodule, relative to the superproject) and '$sha1'
    (the submodule commit recorded by the superproject).
    
    This patch adds another variable -- '$name' -- which contains the name of the
    submodule, as recorded in the superproject's .gitmodules file.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 15, 2009
  1. @jlehmann

    git submodule summary: add --files option

    jlehmann committed with Aug 13, 2009
    git submodule summary is providing similar functionality for submodules as
    git diff-index does for a git project (including the meaning of --cached).
    But the analogon to git diff-files is missing, so add a --files option to
    summarize the differences between the index of the super project and the
    last commit checked out in the working tree of the submodule.
    
    Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 2, 2009
  1. Merge branch 'sb/quiet-porcelains'

    committed Jul 1, 2009
    * sb/quiet-porcelains:
      stash: teach quiet option
      am, rebase: teach quiet option
      submodule, repack: migrate to git-sh-setup's say()
      git-sh-setup: introduce say() for quiet options
      am: suppress apply errors when using 3-way
      t4150: test applying with a newline in subject
Commits on Jun 21, 2009
  1. Merge branch 'ph/submodule-rebase'

    committed Jun 20, 2009
    * ph/submodule-rebase:
      git-submodule: add support for --merge.
    
    Conflicts:
    	Documentation/git-submodule.txt
    	git-submodule.sh
Commits on Jun 18, 2009
  1. @bebarino

    submodule, repack: migrate to git-sh-setup's say()

    bebarino committed with Jun 16, 2009
    Now that there is say() in git-sh-setup, these scripts don't need to use
    their own. Migrate them over by setting GIT_QUIET and removing their
    custom say() functions.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 13, 2009
  1. Merge branch 'ph/submodule-rebase' (early part)

    committed Jun 13, 2009
    * 'ph/submodule-rebase' (early part):
      Rename submodule.<name>.rebase to submodule.<name>.update
      git-submodule: add support for --rebase.
    
    Conflicts:
    	Documentation/git-submodule.txt
    	git-submodule.sh
Commits on Jun 3, 2009
  1. @jherland

    git-submodule: add support for --merge.

    jherland committed with Jun 3, 2009
    'git submodule update --merge' merges the commit referenced by the
    superproject into your local branch, instead of checking it out on
    a detached HEAD.
    
    As evidenced by the addition of "git submodule update --rebase", it
    is useful to provide alternatives to the default 'checkout' behaviour
    of "git submodule update". One such alternative is, when updating a
    submodule to a new commit, to merge that commit into the current
    local branch in that submodule. This is useful in workflows where
    you want to update your submodule from its upstream, but you cannot
    use --rebase, because you have downstream people working on top of
    your submodule branch, and you don't want to disrupt their work.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jherland

    Rename submodule.<name>.rebase to submodule.<name>.update

    jherland committed with Jun 3, 2009
    The addition of "submodule.<name>.rebase" demonstrates the usefulness of
    alternatives to the default behaviour of "git submodule update". However,
    by naming the config variable "submodule.<name>.rebase", and making it a
    boolean choice, we are artificially constraining future git versions that
    may want to add _more_ alternatives than just "rebase".
    
    Therefore, while "submodule.<name>.rebase" is not yet in a stable git
    release, future-proof it, by changing it from
    
      submodule.<name>.rebase = true/false
    
    to
    
      submodule.<name>.update = rebase/checkout
    
    where "checkout" specifies the default behaviour of "git submodule update"
    (checking out the new commit to a detached HEAD), and "rebase" specifies
    the --rebase behaviour (where the current local branch in the submodule is
    rebase onto the new commit). Thus .update == checkout is equivalent to
    .rebase == false, and .update == rebase is equivalent to .rebase == true.
    Finally, leaving .update unset is equivalent to leaving .rebase unset.
    
    In future git versions, other alternatives to "git submodule update"
    behaviour can be included by adding them to the list of allowable values
    for the submodule.<name>.update variable.
    
    Signed-off-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 9, 2009
  1. @mstsirkin

    Add --reference option to git submodule.

    mstsirkin committed with May 4, 2009
    This adds --reference option to git submodule add and
    git submodule update commands, which is passed to git clone.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 24, 2009
  1. @whot

    git-submodule: add support for --rebase.

    whot committed with Apr 24, 2009
    'git submodule update --rebase' rebases your local branch on top of what
    would have been checked out to a detached HEAD otherwise.
    
    In some cases, detaching the HEAD when updating a submodule complicates
    the workflow to commit to this submodule (checkout master, rebase, then
    commit).  For submodules that require frequent updates but infrequent
    (if any) commits, a rebase can be executed directly by the git-submodule
    command, ensuring that the submodules stay on their respective branches.
    
    git-config key: submodule.$name.rebase (bool)
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 19, 2009
  1. @bjj

    Work around ash "alternate value" expansion bug

    bjj committed with Apr 18, 2009
    Ash (used as /bin/sh on many distros) has a shell expansion bug
    for the form ${var:+word word}.  The result is a single argument
    "word word".  Work around by using ${var:+word} ${var:+word} or
    equivalent.
    
    Signed-off-by: Ben Jackson <ben@ben.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 5, 2009
  1. @jd

    git submodule: fix usage line

    jd committed with Mar 31, 2009
    Actually, you have to set the -b option after the add command.
    
    Signed-off-by: Julien Danjou <julien@danjou.info>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 22, 2009
  1. Merge branch 'mg/maint-submodule-normalize-path' into maint

    committed Mar 21, 2009
    * mg/maint-submodule-normalize-path:
      git submodule: Fix adding of submodules at paths with ./, .. and //
      git submodule: Add test cases for git submodule add
Commits on Mar 4, 2009
  1. @mjg

    git submodule: Fix adding of submodules at paths with ./, .. and //

    mjg committed with Mar 3, 2009
    Make 'git submodule add' normalize the submodule path in the
    same way as 'git ls-files' does, so that 'git submodule init' looks up
    the information in .gitmodules with the same key under which 'git
    submodule add' stores it.
    
    This fixes 4 known breakages.
    
    Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 15, 2009
  1. Merge branch 'ff/submodule-no-fetch'

    committed Feb 15, 2009
    * ff/submodule-no-fetch:
      submodule: add --no-fetch parameter to update command
Commits on Feb 7, 2009
  1. @dscho

    submodule: warn about non-submodules

    dscho committed with Feb 7, 2009
    Earlier, when you called
    
            git submodule some/bogus/path
    
    Git would silently ignore the path, without warning the user about the
    likely mistake.  Now it does.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @Fabianx

    submodule: add --no-fetch parameter to update command

    Fabianx committed with Feb 5, 2009
    git submodule update --no-fetch makes it possible to use git submodule
    update in complete offline mode by not fetching new revisions.
    
    This does make sense in the following setup:
    
    * There is an unstable and a stable branch in the super/master repository.
    * The submodules might be at different revisions in the branches.
    * You are at some place without internet connection ;)
    
    With this patch it is now possible to change branches and update
    the submodules to be at the recorded revision without online access.
    
    Another advantage is that with -N the update operation is faster, because fetch is checking for new updates even if there was no fetch/pull on the super/master repository since the last update.
    
    Signed-off-by: Fabian Franz <git@fabian-franz.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Dec 3, 2008
  1. submodule: use git rev-parse -q

    Miklos Vajna committed with Dec 3, 2008
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 11, 2008
  1. Merge branch 'maint'

    committed Nov 11, 2008
    * maint:
      Fix non-literal format in printf-style calls
      git-submodule: Avoid printing a spurious message.
      git ls-remote: make usage string match manpage
      Makefile: help people who run 'make check' by mistake
  2. @julliard

    git-submodule: Avoid printing a spurious message.

    julliard committed with Nov 11, 2008
    Fix 'git submodule update' to avoid printing a spurious "Maybe you want
    to use 'update --init'?" once for every uninitialized submodule it
    encounters.
    
    Signed-off-by: Alexandre Julliard <julliard@winehq.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 23, 2008
  1. @peff

    submodule: fix some non-portable grep invocations

    peff committed with Oct 22, 2008
    Not all greps support "-e", but in this case we can easily convert it to a
    single extended regex.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 29, 2008
  1. @spearce

    Merge branch 'bc/master-diff-hunk-header-fix'

    spearce committed Sep 29, 2008
    * bc/master-diff-hunk-header-fix:
      Clarify commit error message for unmerged files
      Use strchrnul() instead of strchr() plus manual workaround
      Use remove_path from dir.c instead of own implementation
      Add remove_path: a function to remove as much as possible of a path
      git-submodule: Fix "Unable to checkout" for the initial 'update'
      Clarify how the user can satisfy stash's 'dirty state' check.
      t4018-diff-funcname: test syntax of builtin xfuncname patterns
      t4018-diff-funcname: test syntax of builtin xfuncname patterns
      make "git remote" report multiple URLs
      diff hunk pattern: fix misconverted "\{" tex macro introducers
      diff: fix "multiple regexp" semantics to find hunk header comment
      diff: use extended regexp to find hunk headers
      diff: use extended regexp to find hunk headers
      diff.*.xfuncname which uses "extended" regex's for hunk header selection
      diff.c: associate a flag with each pattern and use it for compiling regex
      diff.c: return pattern entry pointer rather than just the hunk header pattern
    
    Conflicts:
    	builtin-merge-recursive.c
    	t/t7201-co.sh
    	xdiff-interface.h
Something went wrong with that request. Please try again.