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

Should default value of 'from-hash' in 'git ghost push' be auto resolved value?? #16

Open
everpeace opened this issue Apr 11, 2019 · 3 comments · May be fixed by #47
Open

Should default value of 'from-hash' in 'git ghost push' be auto resolved value?? #16

everpeace opened this issue Apr 11, 2019 · 3 comments · May be fixed by #47

Comments

@everpeace
Copy link
Contributor

currently 'from-hash''s defualt value is HEAD.

$ git ghost push --help
...
Usage:
  git-ghost push [from-hash(default=HEAD)] [flags]

However, if user's working repo is like

* Unsataged changes
* commtA [HEAD]
* commitB [origin/master]
I initial

git ghost push outputs commitA __diff_hash__. but below will fail

git clone
git checkout commitA
git ghost pull commitA __diff_hash__ # failed!!!

So, from-hash's default value should be auto resolved to commitA ??

@dtaniwaki
Copy link
Contributor

dtaniwaki commented Apr 11, 2019

I first thought we can use a flag which takes remote branch like origin/master, but it looks the same as we directly set it as a from hash like git ghost push origin/master as it resolves origin/master internally. Then, changing the default value from HEAD to origin/master was considered as a solution, but there're many cases in which origin/master is not the "best" commit to check a merge base.
We can actually provide an option to set the default value by environment variable like GIT_GHOST_DEFAULT_FROM_HASH, but specifying origin/master in a command line is more intuitive. @everpeace What do you think?

@everpeace
Copy link
Contributor Author

introducing GIT_GHOST_DEFAULT_FROM_HASH sounds nice to me 👍

@niboshi
Copy link

niboshi commented Dec 8, 2020

How about resolving the commit by running git branch --remotes --contains <hash> for each commit, tracking back from HEAD?

@niboshi niboshi linked a pull request Dec 9, 2020 that will close this issue
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.

3 participants