7 comments

  • ajoberstar2 days ago
    Nice to see some seemingly jujutsu inspired features getting into Git core.<p><pre><code> git history reword ~= jj describe git history split ~= jj split </code></pre> <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-history" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-history</a><p><a href="https:&#x2F;&#x2F;www.jj-vcs.dev&#x2F;latest&#x2F;cli-reference&#x2F;#jj-describe" rel="nofollow">https:&#x2F;&#x2F;www.jj-vcs.dev&#x2F;latest&#x2F;cli-reference&#x2F;#jj-describe</a><p><a href="https:&#x2F;&#x2F;www.jj-vcs.dev&#x2F;latest&#x2F;cli-reference&#x2F;#jj-split" rel="nofollow">https:&#x2F;&#x2F;www.jj-vcs.dev&#x2F;latest&#x2F;cli-reference&#x2F;#jj-split</a>
    • aulin1 hour ago
      Not familiar with jj and don&#x27;t want to get into bike shedding, but how is describe supposed to be a good name for history rewrites?
      • roblabla1 hour ago
        jj describe gives a name to a commit. In jj, everything rewrites the history, so there&#x27;s no real point in calling it out in the command name since it&#x27;s just the default behavior.
      • auscompgeek1 hour ago
        describe is also the command you can use to edit the commit message of the change you&#x27;re currently drafting. In jj there&#x27;s no staging area, every modification to the working tree immediately gets integrated into the current commit. (This means if you have no diff in your working tree, you&#x27;re actually on an empty commit.)
      • skydhash1 hour ago
        Not really familiar too, but jj has everything committed by default (no index, staging area, and uncommitted changes). You use ‘jj new’ to stop adding changes to the current commit.<p>‘jj describe’ lets you add a message to a commit as it’s not there by default.
  • ufo1 hour ago
    I have always had this problem with hooks and new contributors: since hooks don&#x27;t run by default if you just clone the repository, my open source projects get many PRs from new contributors that did not run the linting and commit hooks. I understand there&#x27;s a security reason for this but what workflows have worked best for you to get everyone to run the hooks? And do you think the new config-based hooks can help new contributors?
    • jbverschoor10 minutes ago
      I don&#x27;t want you to run arbitrary hooks on my machine. As with CI&#x2F;CD... your hooks should simply point to a script instead
    • sethops11 hour ago
      &gt; what workflows have worked best for you to get everyone to run the hooks<p>By running the linters and any other checks on CI instead.
      • ufo55 minutes ago
        We do run the linter on CI as well, but I think our comitters would get faster feedback if they ran those checks locally.
        • esafak0 minutes ago
          You can issue installation instructions on linter failure in CI.
        • lou130631 minutes ago
          Well you can tell them to please enable hooks in the PR guidelines, but you cannot really police what they do or don&#x27;t run on their own machines.
      • baq1 hour ago
        autoformatter and autofix linter results can be committed and pushed by CI into the PR branch itself. this is a pain sometimes, but as a repo owner it should protect your sanity.
        • sgarland15 minutes ago
          Yep. Nothing I hate more than some trivial formatting error that could easily fix itself halting CI. I am all for consistent formatting and linting, I just think it should be silently handled without fuss.
        • skydhash1 hour ago
          I just add a check workflow that test that the files are well formatted and linted. If it passes, one of the key things I check are changes to the configuration. Some tools allows for bypass comments, so I keep an eye out for those too.
      • IshKebab1 hour ago
        <i>As well</i>, not instead. Just add `pre-commit run -a` to your CI. Job done.<p>It&#x27;s still annoying for new contributors though because they might not know how to set up pre-commit (which was quite a pain until recently because it&#x27;s written in Python).
        • Flimm48 minutes ago
          To clear up any confusion, Git runs pre-commit hooks, and they can be written in any programming language. There&#x27;s a completely separate and independent project that gave itself the confusing &quot;pre-commit&quot; name, and it is written in Python. This project aims to make it easier to configure pre-commit hooks. An alternative to it is &quot;prek&quot;, written in Rust.
          • sgarland6 minutes ago
            Yes, and I hate it so, so much, and frankly don’t get the appeal. You want one-click installation of hooks? Bundle a shell script called run_first.sh that symlinks the hooks into .git.
    • purerandomness24 minutes ago
      In PHP, an established tool is adding GrumPHP [0] to your dependencies.<p>It will then handle git hooks on each commit via composer script by default (but can be omitted per commit).<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;phpro&#x2F;grumphp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;phpro&#x2F;grumphp</a>
    • sestep23 minutes ago
      I agree with the other replies saying to just run the checks in CI and have the CI error message mention how to install the pre-commit hook.<p>I&#x27;m glad cloning a repo doesn&#x27;t automatically install hooks since I strongly dislike them: I often use Git commands in the terminal but sometimes I use the VS Code UI to commit, and it&#x27;s extremely frustrating when simply creating a commit runs for several seconds because of some pre-commit hook.
      • sgarland18 minutes ago
        There’s almost certainly a way to make VS Code use --no-verify.
    • scq50 minutes ago
      The approach some JS projects have taken is to use Husky, which automatically sets up the git hooks when you install the project&#x27;s dependencies during development.
    • 171862744028 minutes ago
      My project needs other things on setup as well, so I just have a setup script in my repo. `mv hooks&#x2F;foo .git&#x2F;hooks` is then just yet another step.
    • XorNot34 minutes ago
      I add an autogen.sh script to all my repositories that does things like this as it&#x27;s first action.
      • misnome10 minutes ago
        You can also set up a central git template repository, so hooks get automatically added into every repository you clone
  • greg_dc19 minutes ago
    Those new git history commands will save me an average of maybe a minute a day, but it&#x27;s still definitely handy nonetheless! After 2 months, that&#x27;s an hour back!<p>The git log -L change is nice to see as well. Anything that makes git more filterable gets my vote.
  • jinushaun36 minutes ago
    `git history reword` is great. Using `git rebase -i` just to fix a spelling error is overkill and doesn’t actually do what I want.
  • WhyNotHugo42 minutes ago
    The new additions to `git add -p` seem pretty neat. Staging changes with `-p` is seriously underrated!
  • Rover22216 minutes ago
    I do almost no direct git work myself these days. Using claude in Conductor. Working on a team. I&#x27;ll tell claude what do do in git sometimes, but there doesn&#x27;t seem to be much need to do it myself anymore, even with complicated rebases, reflogs, etc.
  • samtrack20192 days ago
    the new git history command seems to be useful for quick reword, altho since i use lazygit&#x2F;magit i don&#x27;t really see much of a problem to me
    • olejorgenb1 hour ago
      Wish reword took a commit range though