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

umpf: add new --override option to override topic commit-ish #24

Merged
merged 1 commit into from
Sep 24, 2023

Conversation

a3f
Copy link
Member

@a3f a3f commented Jul 24, 2023

In one project, umpf tags are pushed immediately, but branches are only pushed upstream once they are reviewed and cleared for merge into BSP. It's thus often the case, that developers want to use the upstream branches, except for that one branch they are currently working on.

This is not an unusual case and the tips-and-tricks lists some workarounds to achieve this. Provide a better way by allowing overriding single topic branches on the command-line.

@a3f a3f requested a review from michaelolbrich July 24, 2023 13:25
umpf Outdated Show resolved Hide resolved
umpf Outdated Show resolved Hide resolved
umpf Outdated Show resolved Hide resolved
doc/tips.rst Show resolved Hide resolved
Copy link
Member

@michaelolbrich michaelolbrich left a comment

Choose a reason for hiding this comment

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

Looks good for the most part. One small change, then it should be ready.

umpf Outdated Show resolved Hide resolved
umpf Outdated Show resolved Hide resolved
@a3f
Copy link
Member Author

a3f commented Sep 1, 2023

@michaelolbrich I am thinking of whether we might want to increase --override's scope a bit: If the topic doesn't already exist it will be appended to the list of topics, perhaps with a rename to --with, --inject or w/e. Example:

umpf tag utag --with existing-topic --with new-topic

This would make it more useful to cover two common cases I have: Someone umpf'd a release and I want to either override a single topic branch that exists or to add a single branch into the umpf. The alternative for the latter is currently cumbersome:

umpf show utag >series
git rev-parse new-topic
vi series # add topic and hashinfo
umpf tag utag --identical

@michaelolbrich
Copy link
Member

I like the idea in general but I think we should have two separate options for this. --override and maybe --append.

@a3f
Copy link
Member Author

a3f commented Sep 15, 2023

I had changed the syntax from --override topic_orig:topic_override a few revisions ago to --override topic_orig=topic_override, because I found it clearer: When doing a git push, you do git push topic_override:topic_orig so I found that = would be an improvement.

Anyway, I forgot about that and tried to use umpf --override today and found that I broke error handling: git rev-parse returns text even if it fails, so we need to always check the exit code. I learnt that the bash syntax of

if ! rev="$(${GIT} rev-parse "${OVERRIDES[$topic]}^{}" 2> /dev/null)"; then

used elsewhere in umpf, does just that, so I force pushed this single change.

Copy link
Member

@michaelolbrich michaelolbrich left a comment

Choose a reason for hiding this comment

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

Almost there, just minor stuff in the help text.

umpf Outdated Show resolved Hide resolved
umpf Outdated Show resolved Hide resolved
In one project, umpf tags are pushed immediately, but branches are only
pushed upstream once they are reviewed and cleared for merge into BSP.
It's thus often the case, that developers want to use the upstream
branches, except for that one branch they are currently working on.

This is not an unusual case and the tips-and-tricks lists some
workarounds to achieve this. Provide a better way by allowing overriding
single topic branches on the command-line.

Signed-off-by: Ahmad Fatoum <[email protected]>
@michaelolbrich michaelolbrich merged commit 545e4e6 into pengutronix:master Sep 24, 2023
2 checks passed
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.

2 participants