Skip to content

Add no revision option #474

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

Merged
merged 4 commits into from
Apr 12, 2017
Merged

Conversation

lenovouser
Copy link
Contributor

No description provided.

@aciccarello
Copy link
Collaborator

Hello @lenovouser, Thanks for your contribution. I'm curious what your motivation is for this feature. Linking to the master branch would cause the documentation links to break over time.

@blakeembrey
Copy link
Member

Also, I'd suggest that if we were to commit to this feature, that we should do --revision instead and specify it explicitly (e.g. --revision master).

@lenovouser
Copy link
Contributor Author

I would need this because I have the docs in my git repository and force them being generated with pre-commit hooks. Right now it always uses the latest hash which is kind of annoying because a ton of files get changed each time which clutters the commit view. You don't really see what was changed in the actual code because of all the *.html files etc.

this.branch = out.stdout.replace('\n', '');
}
} else if (this.revision) {
this.branch = this.revision;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better name we can think of than revision? What's the git correct name?

Also, what if we just made this.branch = revision and only run the if instead of requiring an if else? Do we need both pieces of information?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, maybe branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we would take branch, should we also use --branch instead of --revision?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we'll definitely make it consistent 😄 I'm not convinced on branch either, but it is what was previously used I suppose - even though it was pointing to a ref. Which reminds me, does --git-ref make more sense then? And then reference in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I mean it's already declared as branch in src/lib/converter/plugins/GitHubPlugin.ts#L33. Basically it can be a branch or a revision and until now it was declared as branch first and when it finds a git repository it replaces it with the revision. I don't mind reference either but branch or revision feels more natural to me.

(revision actually makes the most sense to me because a branch can be a revsion and well a revision is a revision 😆 - branch can just be a branch and not a revision from a logical point of view)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you feel revision more accurately reflects what it is, let's use that. I agree that branch is the least useful. As for the CLI flag, can we maybe do --git-revision to make it less ambiguous? I feel like any of revision, reference or branch without context won't make a ton of sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sounds good to me. I'll use --gitRevision though since all the other flags are camelcase too, alright?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks! Sorry, I just manage issues and PRs here and can never remember all the parts of the project, but you are right 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, no problem. Do you want me to squash this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all good, thanks 👍 I'll squash when I merge it.

@@ -6,6 +6,8 @@ import {Component, ConverterComponent} from '../components';
import {BasePath} from '../utils/base-path';
import {Converter} from '../converter';
import {Context} from '../context';
import {Option} from '../../utils/component';
import {ParameterType} from '../../utils/options/declaration';

// This should be removed when @typings/shelljs typings are updated to the shelljs version being used
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good time to remove manual shelljs typing if possible. Or we could do this in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely leave it for a different PR 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have that already in a different branch. Will create a PR once this is merged.

@blakeembrey blakeembrey merged commit 707b4f1 into TypeStrong:master Apr 12, 2017
@lenovouser lenovouser deleted the no-revision branch April 12, 2017 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants