Re: [PATCH] filter-branch: consider refs can refer to an object other than commit or tag
- From
Yuki Kokubun <orga.chem.job@gmail.com>
- Date
- Mar 23, 2018, 02:15 UTC
- Message-ID
- <5ab46520.0352650a.cc02b.a177@mx.google.com>
- In-Reply-To
- <xmqq370sm4cv.fsf@gitster-ct.c.googlers.com>
Show 20 quoted lines
> However, if we pre-filter to limit the refs in "$tempdir/heads" to > those that are committish (i.e. those that pass "$ref^0") like the > patch and subsequent discussion suggests, wouldn't we lose the > warning for these replace refs and non-committish tags. We perhaps > could do something like: > > git rev-parse --no-flags ... >"$tempdir/raw-heads" || exit > > while read ref > do > case "$ref" in ^?*) continue ;; esac > if git rev-parse --verify "$ref^0" 2>/dev/null > then > echo "$ref" > else > warn "WARNING: not rewriting '$ref' (not a committish)" > fi > done >"$tempdir/heads" <"$tempdir/raw-heads" > > (note: the else clause is new, relative to my earlier suggestion).
I agree these suggestions. I'm gonna send a new patch that follow it.