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

[giti] giti branch delete: If user deleted current branch, switch them to main development branch #272

Open
NadiaIdris opened this issue Dec 12, 2023 · 0 comments

Comments

@NadiaIdris
Copy link
Contributor

NadiaIdris commented Dec 12, 2023

Prerequisites

Install and run giti

  1. Move to ./tuify folder in your terminal
  2. Run nu run.nu install-giti to install giti locally to ~/.cargo/bin
  3. Run giti from anywhere on your system
  4. To delete one or more branches in your repo run giti branch delete

Private giti design document

Task

User wants to delete current branch which is not main development branch. Main development branch is generally called main, master, develop or trunk.

Improve giti branch delete user experience (UX)

  • Use case: User deletes a current branch which is not main development branch
  • Switch user to local main development branch (main/master/develop/trunk etc)

Below are the UX steps:

> giti branch delete
Space:           select or unselect branches
Return:          confirm selection
Esc or Ctrl+C:   exit program

Please select branches you want to delete
     ☐ aaronsmith/branch-1
     ☐ main
  ›  ✔ (current) NadiaIdris/branch-2
     ☐ NadiaIdris/branch-3
     ☐ NadiaIdris/branch-4
--------------------------------------------------------
(next step)

Space:           select or unselect branches
Return:          confirm selection
Esc or Ctrl+C:   exit program

Confirm deleting 1 branch: NadiaIdris/branch-2?
    ◉ Yes, delete branch      
    ◌ Exit    
--------------------------------------------------------
(next step)

Space:           select or unselect branches
Return:          confirm selection
Esc or Ctrl+C:   exit program

✅ `NadiaIdris/branch-2` deleted
Your current branch is now `main`

Note: Issue #276 takes care of prefixing current branch with (current) .

Current behaviour

Currently if a user is on a feature branch and then tries to delete that branch, they get an error.

Change that so if user is on a feature branch and then tries to delete that branch, we switch them to main/master branch and delete the current feature branch. If they don't have a main/master branch for whatever reason, we show them a single select component with the local branches to choose from.

Image

@NadiaIdris NadiaIdris changed the title [tuify][giti] Account for user deleting current branch [tuify][giti] Switch user to main development branch if deleted a current branch Dec 12, 2023
@NadiaIdris NadiaIdris changed the title [tuify][giti] Switch user to main development branch if deleted a current branch [tuify][giti] giti branch delete Switch user to main development branch if deleted a current branch Dec 13, 2023
@NadiaIdris NadiaIdris changed the title [tuify][giti] giti branch delete Switch user to main development branch if deleted a current branch [tuify][giti] giti branch delete: Switch user to main development branch if deleted a current branch Dec 13, 2023
@NadiaIdris NadiaIdris changed the title [tuify][giti] giti branch delete: Switch user to main development branch if deleted a current branch [tuify][giti] giti branch delete: If user deleted current branch, switch them to main development branch Dec 13, 2023
@nazmulidris nazmulidris changed the title [tuify][giti] giti branch delete: If user deleted current branch, switch them to main development branch [giti] giti branch delete: If user deleted current branch, switch them to main development branch Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant