Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox: Document or automate displaying WPT test section headers as hunk headers in Git diffs #19

Open
ErichDonGubler opened this issue Oct 23, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@ErichDonGubler
Copy link
Collaborator

ErichDonGubler commented Oct 23, 2023

With the following .gitconfig snippet:

[diff "wpt-metadata"]
	xfuncname = "^\\[.*\\]\\s*$"

…and the following .gitattributes snippet:

testing/web-platform/meta/**/*.ini diff=wpt-metadata
testing/web-platform/mozilla/meta/**/*.ini diff=wpt-metadata

git diff can yield output like this when run in a Git checkout of Gecko:

diff --git a/testing/web-platform/mozilla/meta/webgpu/chunked/20/cts.https.html.ini b/testing/web-platform/mozilla/meta/webgpu/chunked/20/cts.https.html.ini
index b51d7fe6de28a..ea93b2101d342 100644
--- a/testing/web-platform/mozilla/meta/webgpu/chunked/20/cts.https.html.ini
+++ b/testing/web-platform/mozilla/meta/webgpu/chunked/20/cts.https.html.ini
@@ -48,6 +48,7 @@ [cts.https.html?q=webgpu:api,validation,encoding,cmds,setBindGroup:dynamic_offse
   [:encoderType="compute%20pass";dynamicOffsets=[\];useU32array=true]
     expected:
       if os == "mac": FAIL
+      blarg
 
   [:encoderType="compute%20pass";dynamicOffsets=[512,0\];useU32array=false]
     expected:

The exciting part is the hunk header output that's showing the test section header a few dozen lines up in source (!):

@@ -48,6 +48,7 @@ [cts.https.html?q=webgpu:api,validation,encoding,cmds,setBindGroup:dynamic_offse

…which we didn't have before. 🙂

@ErichDonGubler ErichDonGubler added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 23, 2023
@ErichDonGubler
Copy link
Collaborator Author

Automation for the Git config. portion of OP might be possible with GIT_CONFIG_* env. vars (see git/git:b3b186262:git-config.txt:355-365) or git -c.

@ErichDonGubler ErichDonGubler added help wanted Extra attention is needed question Further information is requested labels Oct 24, 2023
@ErichDonGubler
Copy link
Collaborator Author

Settings attributes and config. might be possible through the gix crate's Repository::attributes_only API (which wraps the gix-attributes crate).

@ErichDonGubler ErichDonGubler changed the title Document or automate displaying WPT test section headers as hunk headers in Git diffs Firefox: Document or automate displaying WPT test section headers as hunk headers in Git diffs Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant