[PATCH] scripts: add helper for generating Origin-URL references
Sascha Hauer
s.hauer at pengutronix.de
Thu Dec 18 00:01:56 PST 2025
On Wed, Dec 17, 2025 at 11:35:46AM +0100, Ahmad Fatoum wrote:
> To improve tracking where code originated from, e.g. when porting from
> Linux or U-Boot, some recent commits have started using Origin-URL
> comments. Add a script that can generate them.
>
> Examples in Vim:
>
> # add into highlight URL pointing at specified file
> V:!git origin-url ../linux/lib/ucs2_string.c
>
> # as above, but consult buffer extension for comment style
> V:!git origin-url ../linux/lib/ucs2_string.c %
>
> # generate in snippet syntax
> V:!git origin-url -s ../linux/lib/ucs2_string.c
It's worth mentioning that the repository you point at here needs to be
checked out at the very same state that it was when you copied the file.
In other words, there is no magic that tries to match the barebox
version of the file to the closest linux/u-boot/... revision of the
file.
It's a thing to remember when somebody reminds you of adding the
origin-URL in a review and you call the script a week later when your
Linux repository already has another revision checked out.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list