Maybe because the answer is a whole thread that includes comments and other pieces of context that a simple copy&paste of just an explanation wouldn't have?
b2ca3349c27b57b1e9462944cbe4aaaf76783d2b] Actually build react-dom file with the build
running ./check
React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
b2ca3349c27b57b1e9462944cbe4aaaf76783d2b is the first bad commit
commit b2ca3349c27b57b1e9462944cbe4aaaf76783d2b
Author: Paul O’Shannessy <paul@oshannessy.com>
Date: Tue Sep 8 10:13:24 2015 -0700
Actually build react-dom file with the build
:100644 100644 8b66781299e8980740f8f9a13ad31a0cb30fd684 c20a6aa20e3d3d26c63cf3ac7ee087c93dd8a7d6 M .eslintignore
:100644 100644 e99175b6a10b11857f4c6242341731af6138c3ca 3f4a02e3e372af1b04b5bb2f1ee2b4384ef22295 M Gruntfile.js
:040000 040000 7e99fe9ef7324209890325e2fd9a4a430a706814 1aeab86f880dbf4366709930d7134921bee9401e M grunt
:040000 040000 357233750d2d661818a5ba70ab21fe8049ab9583 154a4f6f867aa8eddc8637aadae8bd3c38e794eb M src
:040000 040000 4216cc98bca3b6d6276bdfbbb29a1ca14bed1972 1e90bf75ef899c6a0ed0484c5138f4d62f32b8d4 M vendor
bisect run success
`git log -S` might be better for this specific case, but `git bisect` is far more powerful so it's very useful to know how it works.
"I changed it to __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED to make our German friends less grossed out. I'm going to do the examples in a separate PR."
Off topic, but this is the second submission I've seen where the title was all in caps except "Not" and having just done a test it seems that HN converts "NOT" to "Not". I'm curious as to why...
28 comments
[ 0.22 ms ] story [ 35.6 ms ] threadIt's a good, simple refactoring strategy when you're trying to responsibly change an API.
Git blame:
https://github.com/facebook/react/blame/80bff5397bf854750dbe...
The last commit for this line:
https://github.com/facebook/react/commit/d17091ddebf317173eb...
It says:
src/React.js → src/umd/ReactUMDEntry.js
and essentially, the line was moved two spots down. Now I want to see the git blame before this change. Here is where it gets messy...
Best I can think of is go to the parent commit:
https://github.com/facebook/react/commit/d8ee071c92994879fa8...
Then look for the original file, src/React.js. So I go to "browse files at this revision", browse to the src/ dir, click React.js, then blame again:
https://github.com/facebook/react/blame/d8ee071c92994879fa82...
Alright, we're there.
Is there an easier way? This feels very convoluted and hacky...
Start with a file named `check` with the contents:
The commit is good if the line isn't there, the commit is bad if the line is there.Then find the first commit in the entire repository (it's 75897c2dcd1dd3a6ca46284dd37e13d22b4b16b4):
Then run: And a few seconds later git will tell us that it was commit https://github.com/facebook/react/commit/b2ca3349c27b57b1e94...: `git log -S` might be better for this specific case, but `git bisect` is far more powerful so it's very useful to know how it works.I found, looking through the tags, that src/React.js was added in 0.14-stable, then I examined the history of React.js to find this commit:
https://github.com/facebook/react/commit/b2ca3349c27b57b1e94...
Additionally, I dug this up:
https://github.com/facebook/react/pull/4814#discussion-diff-...
https://github.com/facebook/react/pull/4814
"I changed it to __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED to make our German friends less grossed out. I'm going to do the examples in a separate PR."
Ultimately this doesn't answer the question of why is it named this way.
$ git log -S__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
commit d17091ddebf317173eb30e3ab4a8e28e124c8f50
Author: Paul O’Shannessy <paul@oshannessy.com>
Date: Thu Mar 24 11:00:38 2016 -0700
commit 712199ef9830359c35c1c2442d79676396c06a2dAuthor: Jim <jsfb@github>
Date: Mon Oct 5 15:02:34 2015 -0700
commit b2ca3349c27b57b1e9462944cbe4aaaf76783d2bAuthor: Paul O’Shannessy <paul@oshannessy.com>
Date: Tue Sep 8 10:13:24 2015 -0700
$ git log -p -S "SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED"
Other submission was this one: https://news.ycombinator.com/item?id=11411368
[0] https://news.ycombinator.com/item?id=11448402
Things NOT to do if you are a developer. How NOT to apply for a job.