-
Notifications
You must be signed in to change notification settings - Fork 661
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
script: double change #89
base: master
Are you sure you want to change the base?
Conversation
save_the_dev function that stashes current work to reapply if after sync do get bleeding edge patches on everything saving the dev's ass; adding some humor to the interation with user;
#86 it's there too. |
separating stash and stash applying via two functions now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, "why not"
Perhaps it would be better to repo forall -c 'git stash', rather than just saving device/phh/treble
build-dakkar.sh
Outdated
@@ -100,14 +101,14 @@ function get_rom_type() { | |||
mainrepo="https://github.com/PixelExperience/manifest" | |||
mainbranch="oreo-mr1" | |||
localManifestBranch="android-8.1" | |||
treble_generate="pixel" | |||
treble_generate="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it really matters, but I guess they don't need extra_make_options either
build-dakkar.sh
Outdated
} | ||
|
||
function restore_the_dev() { | ||
if [ -d device/phh/trble ] && [ -z "$stashstatus" ];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, trble => treble
@@ -300,6 +301,25 @@ function jack_env() { | |||
fi | |||
} | |||
|
|||
function save_the_dev() { | |||
if [ -d device/phh/treble ];then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please invert this to reduce indentation and for better clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invert?
What do you mean ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
[ -d device/phh/treble] && return
build-dakkar.sh
Outdated
|
||
function restore_the_dev() { | ||
if [ -d device/phh/trble ] && [ -z "$stashstatus" ];then | ||
cd device/phh/treble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a subshell, instead of cd xxx; .... ; cd $curpath which is error prone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as said earlier, should be already in subshell since this is a function
build-dakkar.sh
Outdated
function save_the_dev() { | ||
if [ -d device/phh/treble ];then | ||
cd device/phh/treble | ||
if git stash -u | grep -q 'No local changes to save';then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broken indentation
@@ -300,6 +301,25 @@ function jack_env() { | |||
fi | |||
} | |||
|
|||
function save_the_dev() { | |||
if [ -d device/phh/treble ];then | |||
cd device/phh/treble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a subshell, instead of cd xxx; .... ; cd $curpath which is error prone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a function doesn't automatically assume to execute stuff in subshell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if that's the case, you can just drop the cd $oldpwd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stuff is, the execution of this script is in the root of sync, if I drop the cd it will stash on the whole rom files and not only on DT
build-dakkar.sh
Outdated
if [ -d device/phh/treble ];then | ||
cd device/phh/treble | ||
if git stash -u | grep -q 'No local changes to save';then | ||
stashstatus=blank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"blank" when you're later checking for "empty" is weird -_-'
build-dakkar.sh
Outdated
function save_the_dev() { | ||
if [ -d device/phh/treble ];then | ||
cd device/phh/treble | ||
if git stash -u | grep -q 'No local changes to save';then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to if ! git stash -u;then instead
build-dakkar.sh
Outdated
function restore_the_dev() { | ||
if [ -d device/phh/trble ] && [ -z "$stashstatus" ];then | ||
cd device/phh/treble | ||
git stash apply |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering this might/will fail, some error handling should be done here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails due to set -e
should automatically stop the whole script notifying the user about the failed stash, so I dunno what we should handle further.
dropping $curpath as function should already run in subshells;
typo, trble => treble; function init_main_repo_ref: ask user if it has a reference path to sync from and let him do that in the case.
save_the_dev function that stashes current work to reapply if after sync do get bleeding edge patches on everything saving the dev's ass;
adding some humor to the interation with user;
fix some roms makefiles assign;