-
Notifications
You must be signed in to change notification settings - Fork 304
Changed commit.id to commit.id.full #123
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
Conversation
Changed key name for COMMIT_ID to commit.id.full
Hi, |
If commit.id represents a JSON object it must be either a primitive, a list, or a map. Since it has a string value, then it is a primitive.
However, commit.id.abbrev is s child of commit.id, implying that commit.id is a map.
commit.id cannot be both a primitive and a map at the same time. — On Sun, Jun 8, 2014 at 7:39 AM, TheSnoozer [email protected]
|
commit : { id : { full: "bacd46826abc48cde.." abbrev : "bacd46" } } On Sun, Jun 8, 2014 at 8:11 AM, Derrick Burns [email protected]
|
The issue is that with JSON, the dot notation is used for paths not keys.— On Sun, Jun 8, 2014 at 8:14 AM, Derrick Burns [email protected]
|
The JSON file namespace is hierarchical, not flat like the properties file namespace.— On Sun, Jun 8, 2014 at 8:32 AM, Derrick Burns [email protected]
|
Well ok, now I got the problem. |
No, renaming commit.id to be commit.id.full resolves the conflict. Then commit.id is a MAP with members full and abbrev, etc.— On Sun, Jun 8, 2014 at 11:11 AM, TheSnoozer [email protected]
|
That is what my pull request does.— On Sun, Jun 8, 2014 at 11:11 AM, TheSnoozer [email protected]
|
That's a lot of emails for a small change! ;-) I agree and see the problem @derrickburns, although I'd like to take into account projects which already use the plugin - this would break them if they rely on the previous key being present. How are you generating your JSON? Because the usual case is to go via a POJO, like the Anyhow - I'd like to know how you generate your JSON before we merge this |
Sorry about the barrage of short emails. :) I read in all properties files and JSON files and map them back to JSON objects. I use the git-commit-id-plugin feature to generate a property file. If you prefer to be backward compatible, you could offer a way to remap the property names before the property file is generated. Then, I could simply provide my own remapping of "commit.id" to "commit.id.full". On Sun, Jun 8, 2014 at 12:18 PM, Konrad Malawski [email protected]
|
97e085d
to
7ee11ec
Compare
I guys, |
This refs #122 |
Currently I'd argue it's easy enough to not go 1:1 into your json object, you could simply: def myJsonProps(gitProps: Properties): String = {
gitProps.put("git.commit.id.full", gitProps.get("git.commit.id"))
gitProps.remove("git.commit.id")
} and done, right? The reason I'm reluctant with this change now is that people are depending on this key in the properties, so we'd break existing users, where as the fix for you is to not directly depend on the props object. Or even - you can simply write your own json properties file and use maven properties replacement in there - no problem. |
In order to make the commit info be convertable to a JSON object, I placed the renamed the commit id to "commit.id.full".