[PATCH v2] scripts: add helper for generating Origin-URL references

Jonas Rebmann jre at pengutronix.de
Tue Jan 20 01:42:13 PST 2026


On 2025-12-18 16:18, 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 with the assumption that
> the origin project is checked out at exactly the version the code was
> copied from.
> 
> 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
> 
> This is mostly useful for new code that's being ported. It does have no
> support to find out similarity between the files specified.
> 
> Cc: Jonas Rebmann <jre at pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

Reviewed-by: Jonas Rebmann <jre at pengutronix.de>




More information about the barebox mailing list