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

Extracting the original FreeBSD branch name when using a local branch? #87

Open
Ximalas opened this issue Feb 10, 2021 · 2 comments
Open

Comments

@Ximalas
Copy link

Ximalas commented Feb 10, 2021

I use a local branch to keep track of my own stuff, kernel configuration files and one firstboot script.

When I ask Git which branch is checked out, I get the name of my own branch, local. Is there a Git command for extracting the name of the branch of which the local branch was rebased on?

The name of local branch will also be part of the kernel's identification. What are the pros and cons of naming a local branch as main+local or stable/13+local? All forward slashes and plus signs must be changed to, say, dashes when used as part of ZFS filesystem and snapshot names.

When stable/14 comes to light, I imagine this sequence:

cd /usr/src
# Already on the stable/13+local branch.
git checkout -b stable/14+local
# It's not a given that stable/14 is known to the local repo.
# And it's not a given that I know what I'm talking about.
git checkout stable/13
git pull --no-edit --no-ff
git checkout stable/14
git rebase stable/14 stable/14+local
# Fixup any files.
git add ...
git commit

Any later update proceeds as usual:

cd /usr/src
git checkout stable/14
git pull --no-edit --no-ff
git rebase stable/14 stable/14+local
@Ximalas
Copy link
Author

Ximalas commented Feb 11, 2021

Last evening I had to run some additional commands on my laptop running main, and then repeat the update procedure:

git -C /usr/src prune
git -C /usr/src gc --auto

@bsdimp
Copy link
Owner

bsdimp commented Feb 11, 2021

The general problem is a hard.

However, you can make an educated guess with rev-count:

% git rev-list main.. --first-parent --count
3
% git rev-list stable/13.. --first-parent --count
407
% git rev-list stable/12.. --first-parent --count
18716

This is for a branch off main...

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

No branches or pull requests

2 participants