git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2 5/6] submodule update: add super-reference flag

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2016, 17:13 UTC
Message-ID
<xmqqh9axizw9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160806012318.17968-6-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 7 quoted lines
> When we have a another clone of a superproject, we may want to
> mirror the submodules using alternates. Introduce an option
> `--super-reference` that let's a user point to another superproject,
> which is assumed to have the same structure as the one they are
> running the "submodule update" command from and has all submodules
> checked out to borrow the submodule objects from within the other
> superprojects git directory.
That's much better than the previous round.

I however have trouble with the "checked out", though. Isn't it that it merely has to be "init"ed? For that matter, as long as super.git has $GIT_DIR/modules/ populated fully, it does not matter it has checkout, and more interestingly and importantly, the superproject mirror can even be a bare repository!

> +--super-reference <superproject repository>::
> +	This option is only valid for the update command. When update needs
> +	to clone a repository, a reference will be passed to the clone command
> +	that points at the submodule path inside the reference superproject.
"points at the submodule path inside" sounds as if we would look at
    /var/cache/super/libs/xyzzy

in the scenario in <xmqqoa57vvzl.fsf@gitster.mtv.corp.google.com>, when you give us "--super-reference=/var/cache/super". Can we clarify to avoid such a misread?

> +superreference=
Please don't name a multiple_word field "multipleword".
Show 26 quoted lines
>  cached=
>  recursive=
>  init=
> @@ -520,6 +521,14 @@ cmd_update()
>  		--reference=*)
>  			reference="$1"
>  			;;
> +		--super-reference)
> +			case "$2" in '') usage ;; esac
> +			superreference="--super-reference=$2"
> +			shift
> +			;;
> +		--super-reference=*)
> +			superreference="$1"
> +			;;
>  		-m|--merge)
>  			update="merge"
>  			;;
> @@ -576,6 +585,7 @@ cmd_update()
>  		${prefix:+--recursive-prefix "$prefix"} \
>  		${update:+--update "$update"} \
>  		${reference:+"$reference"} \
> +		${superreference:+"$superreference"} \
>  		${depth:+--depth "$depth"} \
>  		${recommend_shallow:+"$recommend_shallow"} \
>  		${jobs:+$jobs} \
Previous: Stefan Beller
Message 12 of 12 in “[PATCHv2 0/6] git clone: Marry --recursive and --reference”
  1. Stefan BellerAug 6, 2016
  2. Junio C HamanoAug 6, 2016
  3. Stefan BellerAug 8, 2016
  4. 2/6 t7408: merge short tests, factor out testing methodStefan Beller, Aug 6, 2016
  5. Junio C HamanoAug 6, 2016
  6. 3/6 submodule--helper module-clone: allow multiple referencesStefan Beller, Aug 6, 2016
  7. 4/6 submodule--helper update-clone: allow multiple referencesStefan Beller, Aug 6, 2016
  8. Junio C HamanoAug 6, 2016
  9. 1/6 t7408: modernize styleStefan Beller, Aug 6, 2016
  10. 6/6 clone: reference flag is used for submodules as wellStefan Beller, Aug 6, 2016
  11. 5/6 submodule update: add super-reference flagStefan Beller, Aug 6, 2016
  12. Junio C HamanoAug 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.