Я создал несколько псевдонимов , чтобы упростить использование команд git commit --fixup
и git commit --squash
, добавленных в git 1.7. Добавьте их к ~/.gitconfig
:
[alias]
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -
Использование:
$ git commit -am 'bad commit'
$ git commit -am 'good commit'
$ git add . # Stage changes to correct the bad commit
$ git fixup HEAD^ # HEAD^ can be replaced by the SHA of the bad commit
Плохой коммит может быть несколько коммитов назад.
Я здесь иду по кругу. Очевидно, есть кое-что фундаментальное, чего я не понимаю ...
В моем RootViewController, чтобы загрузить FlipsideView:
FlipsideViewController *viewController = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
self.flipsideViewController = viewController;
[viewController release];
// Set up the navigation bar
UINavigationBar *aNavigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)];
aNavigationBar.barStyle = UIBarStyleBlackTranslucent;
self.flipsideNavigationBar = aNavigationBar;
[aNavigationBar release];
UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(toggleView)];
UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@"App Title"];
navigationItem.rightBarButtonItem = buttonItem;
[flipsideNavigationBar pushNavigationItem:navigationItem animated:NO];
[navigationItem release];
[buttonItem release];
Между тем, в моем FlipViewController это показывает средство выбора изображения:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
// THIS IS NOT WORKING
[self.navigationController.navigationBar setHidden:YES];
[self presentModalViewController:picker animated:YES];
[picker release];
Я прокомментировал бит, который я думал бы убрать панель навигации.
Внутри блока анимации, в котором выполняется UIViewTransitionAnimationFlipFromLeft (или UIViewTransitionAnimationFlipFromRight), добавьте удаление панели навигации:
[flipsideNavigationBar removeFromSuperView];