As aliases

alias g-log="git log --graph --format='format:%C(yellow)%h%C(reset) %s %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)'"
alias g-history='gitk --all &'
alias g-checkout='git checkout $(git branch --sort=-committerdate --no-merged | fzf)'
alias g-commit='git citool &'
alias g-amend='git citool --amend &'
alias g-rebase='git rebase --interactive --autosquash'
alias g-pull='git pull --verbose --rebase'
alias g-pushf='git push --verbose --force-with-lease'
alias g-status='git status --ignored'
alias g-clean='git clean -fdx && git reset --hard && git submodule foreach --recursive git clean -fdx && git submodule foreach --recursive git reset --hard'
  • porous_grey_matter@lemmy.ml
    link
    fedilink
    arrow-up
    5
    arrow-down
    3
    ·
    9 months ago

    I think I understood the example; I think it’s faster to switch branches for the bug-fix than to reorder those commits later

    • lysdexic@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      6
      ·
      9 months ago

      See, I don’t think you understood the example. The commits built upon each other (bugs are fixed while you work on the task, and to work on your task you need the bugs to be fixed) and reordering commits not only take no time at al but they are also the very last thing you do and you have to do the just once.

      • porous_grey_matter@lemmy.ml
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        edit-2
        9 months ago

        Oh, okay. I’ve never encountered a situation where I needed that bug fixed for the task but it shouldn’t be fixed as part of the task; if they’re touching the same functionality like that I really don’t see the need for two PRs. But sure, sounds helpful in that really niche case.

        • lysdexic@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          5
          ·
          edit-2
          9 months ago

          Oh, okay. I’ve never encountered a situation where I needed that bug fixed for the task but it shouldn’t be fixed as part of the task;

          So you never stumbled upon bugs while doing work. That’s ok, but others do. Those who stumble upon bugs see the value of being able to sort out local commits with little to no effort.

          Also, some teams do care about building their work on atomic commits, because they understand the problems caused by mixing up unrelated work on the same PR, specially when auditing changes to track where a regression was introduced. You might feel it’s ok to post a PR that does multiple things like bumping up a package version, linting unrelated code, fixing an issue, and post comments on an unrelated package, but others know those are four separate PRs and should be pushed as four separate PRs.

          if they’re touching the same functionality like that I really don’t see the need for two PRs.

          That’s ok, not everyone works with QA teams. Once you grow over a scale where you have people whose job is to ensure a bug is fixed following specific end to end tests and detect where a regression was introduced, you’ll understand the value of having tests that verify if a bug is fixed, and only afterwards proceed with changing the user-facing behavior. For those with free-for-all commits where “fixes bug” and “update” show up multiple times in their commit history, paying attention to how a commit history is put together is hardly a concern.

          • porous_grey_matter@lemmy.ml
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            9 months ago

            So you never stumbled upon bugs while doing work

            That’s not what I said… Either the bug is related to the task, or it isn’t. If it’s not related to the task, there’s no reason to fix it on the same local branch either.

            Also, some teams do care about building their work on atomic commits, because they understand the problems caused by mixing up unrelated work on the same PR, specially when auditing changes to track where a regression was introduced. You might feel it’s ok to post a PR that does multiple things like bumping up a package version, linting unrelated code, fixing an issue, and post comments on an unrelated package, but others know those are four separate PRs and should be pushed as four separate PRs.

            Well, these things don’t meet the standards of your earlier example at all. Linting unrelated code and posting comments on an unrelated package clearly aren’t needed for someone to work on the main issue fix they’re doing. If it’s unrelated code you again lose nothing by switching branches to do the work.