Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Karthik B S <karthik.b.s@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH i-g-t v2] scripts: Add new script for verbatim sync with kernel
Date: Fri, 15 May 2026 11:10:44 +0300	[thread overview]
Message-ID: <8a9eb3b8ed8250faaeda2507f146ede1e2691328@intel.com> (raw)
In-Reply-To: <20260514132713.35818-1-kamil.konieczny@linux.intel.com>

On Thu, 14 May 2026, Kamil Konieczny <kamil.konieczny@linux.intel.com> wrote:
> From: Jani Nikula <jani.nikula@intel.com>
>
> This is a helper script used in cases when a verbatim kernel
> file should be copied into igt-dev.

First of all, thanks for picking this up.

Then some process nitpicks. ;)

> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Cc: Karthik B S <karthik.b.s@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

I'm pretty sure I haven't sent this with my Signed-off-by. I admit I
should have, but Signed-off-by is a legal thing, and you can't add it on
my behalf.

Anyway,

Signed-off-by: Jani Nikula <jani.nikula@intel.com>


> Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
>  scripts/sync_with_kernel.sh | 57 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100755 scripts/sync_with_kernel.sh
>
> diff --git a/scripts/sync_with_kernel.sh b/scripts/sync_with_kernel.sh
> new file mode 100755
> index 000000000..65753677c
> --- /dev/null
> +++ b/scripts/sync_with_kernel.sh
> @@ -0,0 +1,57 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: MIT
> +#
> +# Copyright © 2026 Intel Corporation
> +#
> +# Author: Jani Nikula <jani.nikula@intel.com>
> +#

I'm generally against adding *any* Author: lines in comments in any
collaborative projects. They give a false sense of ownership, and they
create a perpetual problem of "when do you add another author". The
author lines are also (socially) difficult to remove afterwards.

In the kernel, we have Author: lines in files by folks that created the
file 10-15 years ago, but have been basically completely rewritten since
then by a dozen people. But nobody added another Author: line since
then. I think that's just misattribution and misleading.

I could basically add my name in almost every file in the i915 display
parts, and much more, but what would be the point of that?

The truth is really in the git history.

I want to reply with the above rant when anyone is adding a file with
Author:, and I sometimes do in the kernel. But I kind of shy away in igt
since there are already so many files with Author:.

But for sure I can say: Please remove the Author: line with my name
here.


Thanks,
Jani.



> +# Use this for verbatim copies from kernel into igt-dev-tools
> +# Change paths to yours, update the repos, cd to IGT, and run.
> +
> +SINCE=962601ac4c78
> +KERNEL=$HOME/src/linux
> +IGT=$HOME/src/intel-gpu-tools
> +
> +declare -g -A map
> +map["drivers/gpu/drm/i915/display/intel_vbt_defs.h"]="tools/intel_vbt_defs.h"
> +map["drivers/gpu/drm/i915/display/intel_dsi_vbt_defs.h"]="tools/intel_dsi_vbt_defs.h"
> +map["include/drm/intel/pciids.h"]="lib/pciids.h"
> +
> +cd $KERNEL
> +
> +for infile in "${!map[@]}"; do
> +	outfile=${map[$infile]}
> +
> +	echo "processing $infile -> $outfile"
> +
> +	last=
> +	for commit in $(git log --reverse --pretty=%h $SINCE..HEAD -- $infile); do
> +		if ! git cat-file -e $commit:$infile 2>/dev/null; then
> +			continue
> +		fi
> +		if git show $commit:$infile | diff -q $IGT/$outfile - >/dev/null; then
> +			last=$commit
> +			break
> +		fi
> +	done
> +
> +	if [[ -z "$last" ]]; then
> +		echo "last update to $infile not found"
> +		continue
> +	fi
> +
> +	for commit in $(git log --reverse --pretty=%h $last..HEAD -- $infile); do
> +		prefix="${outfile%.*}"
> +		base="$(basename $outfile)"
> +		# ref=$(git cite $commit)
> +		# alias: cite = log -1 --abbrev=12 '--format=%h (\"%s\")'
> +		ref=$(git log -1 --abbrev=12 '--format=%h (\"%s\")' $commit)
> +		git show $commit:$infile > $IGT/$outfile
> +		cd $IGT
> +		git commit -as \
> +		    -m "${prefix}: sync ${base} with kernel commit $commit" \
> +		    -m "Synchronize ${base} with kernel commit:" \
> +		    -m "$ref"
> +		cd -
> +	done
> +done

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-05-15  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 13:27 [PATCH i-g-t v2] scripts: Add new script for verbatim sync with kernel Kamil Konieczny
2026-05-15  8:10 ` Jani Nikula [this message]
2026-05-15 10:33   ` Kamil Konieczny
2026-05-15 14:37 ` Gustavo Sousa
2026-05-15 14:53   ` Jani Nikula
2026-05-15 15:39     ` Gustavo Sousa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a9eb3b8ed8250faaeda2507f146ede1e2691328@intel.com \
    --to=jani.nikula@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox