-
Notifications
You must be signed in to change notification settings - Fork 484
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
use git log know a documents last modified date #1573
use git log know a documents last modified date #1573
Conversation
I have no idea what's causing these
It doesn't seem to be happening on |
The only thing that isn't great here is that it seems to be printing some Buffer things when you run the destructive ideas. |
@@ -84,10 +84,19 @@ function execGit(args, opts = {}, root = null) { | |||
args, | |||
{ | |||
cwd: gitRoot, | |||
// Default is 1MB | |||
// That's rarely big enough for what we're using Yari for. | |||
maxBuffer: 1024 * 1024 * 100, // 100MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth to pull the 100
to the front, since that eases reading.
@fiji-flo r? ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!
@fiji-flo Everything's working except the most important thing. The If I run
This time it gets it right! If I remove that filtering, So I guess we need to figure out some way to run |
Using |
@fiji-flo and I discussed a gnarly corner case that can happen. The situation is extremely rare and probably not all that important. We can maybe figure it out some other day. |
For the record, here's the simplest way to demonstrate that above-mentioned problem:
you'll potentially see a different set of commits. The latter one gives the right commit if you compare it with the GitHub file History UI. |
Part of #706
A lot going on here and I don't feel like it's complete yet. But I wanted to reach out for some early feedback.
![Screen Shot 2020-10-29 at 5 41 01 PM](https://user-images.githubusercontent.com/26739/97635558-ec857b80-1a0d-11eb-8d52-81cb4092737f.png)
But it works!
The way it works is that you run
yarn tool gather-git-history
and it puts in a file called_githistory.json
in/path/to/mdn/content/files/en-us/
. Once that's in place when it builds documents it's able to extract the data for each document.So, the building of documents will at least work.
The idea is that, in the Production Build workflow, we first run that command so that the content has these files. Then it can build.
But it will leave a file inside the
mdn/content/files/*/_githistory.json
which needs to be added to.gitignore
inmdn/content
. In the Production Build workflow, that doesn't matter.Also, I think it would make sense that we modify the
yarn start
script inmdn/content
so that it runs this command first.But it's still a bit weird and I wish it wasn't so. Perhaps there's a better place to put it. Really open to ideas, but I felt I was getting stuck for better ideas so I opted for some code that we can change rather than no code and more thinking.
Lastly, I hacked the workflow to use infinite depth when it does the
git clone
. I think that's ok because it's we're only ever downloading one branch when we git clone. And who cares if it takes a big fat 30 seconds?But I made the CLI command so that you can provide a file to read from and it dumps it all back. What we could do in GitHub Actions now is to use
actions/cache
to save this file. And it could be reused. But I'm still not sure if it's needed. Perhaps this prototype is over-engineered already.