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

Possibility to remove the gitname from the fragment file name #103

Open
maxschulz-COL opened this issue Sep 1, 2023 · 10 comments · Fixed by #106
Open

Possibility to remove the gitname from the fragment file name #103

maxschulz-COL opened this issue Sep 1, 2023 · 10 comments · Fixed by #106

Comments

@maxschulz-COL
Copy link

I could not find the setting in the docs - but is it possible to remove the gitname in the file name of the fragment.

There are many ways to see that name otherwise as its public, but this makes the name even more public :)

@nedbat
Copy link
Owner

nedbat commented Sep 1, 2023

You want to omit the branch name, or the user name? And can you say more about why? Public information is public.

@maxschulz-COL
Copy link
Author

It would be the user name - and yes, that's what I meant with that it's clearly public already, but having it in the file name makes it somewhat more visible.

The reason why we want that is that it's somewhat bureaucracy... people are more hesitant especially in a "corporate" context to have their names show so dominantly.

In our case we would wanna follow your idea of referring to the fragments as unreleased changes, but then there are immediately the names showing in that folder which might worry some..

Hope that makes sense a little

Thanks for getting back so promptly!

@nedbat
Copy link
Owner

nedbat commented Sep 8, 2023

Sorry, why did you close this?

@maxschulz-COL
Copy link
Author

I thought it might not be of interest, so didn't want to clog up the issues :) Can reopen though!

@maxschulz-COL maxschulz-COL reopened this Sep 8, 2023
@RonnyPfannschmidt
Copy link
Contributor

@nedbat im also in need of the feature, cause my git name taken from my email username is opensouce it makes no sense in context

@RonnyPfannschmidt
Copy link
Contributor

i propose the addition of a scriv.user_nick option

@nedbat
Copy link
Owner

nedbat commented Oct 12, 2023

This is now released as part of scriv 1.4.0.

@maxschulz-COL
Copy link
Author

QQ: this needs to be individually enabled in every git user setting? Or could this also be enabled globally in the scriv.ini such that the names just would not show up?

@nedbat
Copy link
Owner

nedbat commented Oct 12, 2023

This would be for each user. I can re-open this since the new setting doesn't exactly address the original request.

@nedbat nedbat reopened this Oct 12, 2023
@ncoghlan
Copy link

ncoghlan commented Nov 11, 2024

A related-but-not-the-same feature suggestion, but one that could potentially be addressed at the same time as this one: I'd like to be able to move the branch name to the front of the fragment file names, so tab-completion can more easily ignore the exact time the template fragment was created.

Something along the lines of:

[tool.scriv]
fragment_name_format = "{creator}_{branch}_{created}"

The current default fragment name format would be equivalent to setting the name format to {created}_{creator}_{branch}.

str.format_map doesn't care about unused keys, so omitting the fragment's creator name could look like:

[tool.scriv]
fragment_name_format = "{branch}_{created}"

(or the other way around if you prefer the default behaviour of putting the creation time at the start so the fragment list is chronologically ordered)

One downside of the "format string" approach is that it's hard to gracefully omit the branch name for uninteresting branches, so a sequence of field names that are joined by scriv to create the format string might be nicer:

[tool.scriv]
fragment_name_fields = ["creator", "branch", "created"]
[tool.scriv]
fragment_name_fields = ["creator", "created"]

That way scriv could still omit the redundant field separators when the active branch is deemed irrelevant when naming the fragment.

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 a pull request may close this issue.

4 participants