git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* git , submodules and remove from historic question
       [not found] <HE1PR0202MB2634CD91D2750E199098FACAE6350@HE1PR0202MB2634.eurprd02.prod.outlook.com>
@ 2020-01-13  9:41 ` FIGADERE, LAURENT
  2020-01-15  5:14   ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: FIGADERE, LAURENT @ 2020-01-13  9:41 UTC (permalink / raw)
  To: git

Dear git community ,

I am using git submodule features.

So, by example, I have a repository top which include a sub repository sub-repo.

I would like to re-write the whole historic on the top repository without the sub-repo.

I tried to use git-filter command but I have an issue on sub-repo.

Here the commands and outputs:
[10:27:42] $ git submodule
d3fc420ee38babe74d6e3838b5b2a946ee551fa7 sub-repo (v1.0)

[9:55:48] $ git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch sub-repo' --prune-empty --tag-name-filter cat -- --all
Rewrite 471a2c664466a364bfe5fdf774c7c0d7efe50396 (32/54) (3 seconds passed, remaining 2 predicted)    fatal: exec '--super-prefix= sub-repo/': cd to sub-repo' failed: No such file or directory
error: Submodule sub-repo' could not be updated.
error: Submodule ' sub-repo' cannot checkout new HEAD.
Could not initialize the index

Was somebody able to remove such historic from a top repository?
Thanks by advance for your help.

Kind Regards,
Laurent FIGADERE


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git , submodules and remove from historic question
  2020-01-13  9:41 ` git , submodules and remove from historic question FIGADERE, LAURENT
@ 2020-01-15  5:14   ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2020-01-15  5:14 UTC (permalink / raw)
  To: FIGADERE, LAURENT; +Cc: git

Hi!

FIGADERE, LAURENT wrote:

> I am using git submodule features.
>
> So, by example, I have a repository top which include a sub
> repository sub-repo.
>
> I would like to re-write the whole historic on the top repository
> without the sub-repo.
>
> I tried to use git-filter command but I have an issue on sub-repo.

Thanks for reporting.  This looks like a real bug.

(Nowadays we encourage using https://github.com/newren/git-filter-repo
instead of filter-branch, but I'm interested because of the underlying
issues this report might be revealing.)

By the way, what version of Git are you using (you can find out by
running "git version --build-options")?  Do you have the
submodule.recurse setting enabled?

> Here the commands and outputs:
> [10:27:42] $ git submodule
> d3fc420ee38babe74d6e3838b5b2a946ee551fa7 sub-repo (v1.0)
>
> [9:55:48] $ git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch sub-repo' --prune-empty --tag-name-filter cat -- --all
> Rewrite 471a2c664466a364bfe5fdf774c7c0d7efe50396 (32/54) (3 seconds passed, remaining 2 predicted)    fatal: exec '--super-prefix= sub-repo/': cd to sub-repo' failed: No such file or directory

Hm, I'm not able to reproduce this.  I tried using

  git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
  cd gerrit
  git filter-branch --index-filter \
    'git rm -rf --cached --ignore-unmatch plugins/hooks' \
    --prune-empty --tag-name-filter cat -- --all

What is the output with the GIT_TRACE=1 environment variable set?

Thanks and hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <HE1PR0202MB2634CD91D2750E199098FACAE6350@HE1PR0202MB2634.eurprd02.prod.outlook.com>
2020-01-13  9:41 ` git , submodules and remove from historic question FIGADERE, LAURENT
2020-01-15  5:14   ` Jonathan Nieder

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git