git-ghost
git-ghost copied to clipboard
Should default value of 'from-hash' in 'git ghost push' be auto resolved value??
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 ??
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?
introducing GIT_GHOST_DEFAULT_FROM_HASH sounds nice to me 👍
How about resolving the commit by running git branch --remotes --contains <hash> for each commit, tracking back from HEAD?