Re: [PATCH v6 1/2] scripts: generate_rust_analyzer.py: add versioning infrastructure

From: Jesung Yang

Date: Thu May 07 2026 - 10:35:47 EST


On Thu, May 7, 2026 at 11:16 PM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
> On Thu, May 7, 2026 at 8:57 AM Jesung Yang <y.j3ms.n@xxxxxxxxx> wrote:
> > On Tue, May 5, 2026 at 7:01 AM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
> > >
> > > I think we talked about this being a bit more defensive with (at least)
> > > set -eu. How's this?
> > >
> > > #!/usr/bin/env bash
> > >
> > > set -euo pipefail
> > >
> > > RUST_VERSION=$1
> > >
> > > grep_args=()
> > > while IFS= read -r subject; do
> > > grep_args+=(--grep "$subject")
> > > done < <(git -C rust log \
> > > --fixed-strings \
> > > --format='%s' \
> > > --grep 'Merge pull request #' \
> > > --merges \
> > > --no-follow \
> > > -n 10 \
> > > "$RUST_VERSION" \
> > > -- src/tools/rust-analyzer
> > > )
> > >
> > > tag_predates=$(
> > > git -C rust-analyzer log \
> > > --fixed-strings \
> > > --format='%(describe:tags,abbrev=0)' \
> > > --merges \
> > > -n 1 \
> > > "${grep_args[@]}"
> > > )
> > >
> > > link_prefix="https://github.com/rust-lang/rust-analyzer/releases/tag";
> > > echo "$link_prefix/$tag_predates"
> > >
> > > Note I added `--merges` in the first `git log`, inlined `LOOKAHEAD` (and
> > > reduced it to 10, now that it's only merge commits), and replaced piping
> > > into grep with `--grep`. The second and third `git log` commands are
> > > combined.
> >
> > I don't see the `--no-follow` option in the man page, so I'd go for
> > `-c log.follow=false`.
>
> https://lore.kernel.org/git/20260507-document-log-no-follow-v1-1-46ce02490eba@xxxxxxxxx/

Awesome!

> > Should we also use that for the second `git log`?
> > Otherwise, merge commits might be lost, right?
>
> The man page says:
>
> --follow
> Continue listing the history of a file beyond renames (works
> only for a single file).
>
> So the second `git log` is not affected because it doesn't pass paths.
> I suppose it doesn't hurt, but can be misleading.

I see. Everything makes sense; thanks for the heads up.

Best regards,
Jesung