git-branchless icon indicating copy to clipboard operation
git-branchless copied to clipboard

`amend` moves descendant commits under the amended commit, but they are not visible

Open scottjacobsen opened this issue 8 months ago • 2 comments

Description of the bug

Starting in this state:

◇ 0ff104b 23h (main) [1/2] Fix
┃                                                                         
● 05ad515 22h (ᐅ sej/add_table) add table to db
┃                                                                         
◯ 989826c 6s Add rails model

Then I make some changes and run git amend to amend 05ad515

╰─>$ g amend
branchless: processing 1 update: branch sej/add_table
branchless: creating working copy snapshot
branchless: running command: git reset sej/add_table
branchless: processing 1 update: branch sej/add_table
Attempting rebase in-memory...
[1/1] Committed as: 52f1786 Add rails model
Running post-rewrite hooks
Run CustomScript.......................................[CustomScript] FAILED
The application panicked (crashed).
Message:  A fatal error occurred:
   0: Invalid rewrite line: ""

Location:
   git-branchless-lib/src/core/rewrite/rewrite_hooks.rs:76

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: branchless::core::rewrite::rewrite_hooks::read_rewritten_list_entries
      at git-branchless-lib/src/core/rewrite/rewrite_hooks.rs:61
   1: branchless::core::rewrite::rewrite_hooks::hook_post_rewrite with effects=<Output fancy=false> git_run_info=<GitRunInfo path_to_git="git" working_directory="/Users/scott/dev/portal" env=not shown> rewrite_type="rebase"
      at git-branchless-lib/src/core/rewrite/rewrite_hooks.rs:132
   2: git_branchless_hook::command_main with ctx=CommandContext { effects: <Output fancy=false>, git_run_info: <GitRunInfo path_to_git="git" working_directory="/Users/scott/dev/portal" env=not shown> } args=HookArgs { subcommand: PostRewrite { rewrite_type: "rebase" } }
      at git-branchless-hook/src/lib.rs:613

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Location: git-branchless/src/commands/mod.rs:235

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

✗ One or more post-rewrite hooks failed

branchless: creating working copy snapshot
branchless: running command: git checkout sej/add_table
branchless: processing 1 update: ref HEAD
Switched to branch 'sej/add_table'
Your branch and 'origin/sej/add_table' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" if you want to integrate the remote branch with yours)
Running post-checkout hooks
Run CustomScript.......................................[CustomScript] OK

✓ All post-checkout hooks passed

In-memory rebase succeeded.
Restacked 1 commit.
Amended with 2 staged changes.

Now the state looks like this:

╰─>$ g sl 
◇ 0ff104b 23h (main) [1/2] Fix
┣━┓
┃ ✕ 05ad515 22h (rewritten as 2dea0b77) Add table to db
┃ ┃
┃ ◯ 989826c 6m Add rails model
┃
● 2dea0b7 20s (ᐅ sej/add_table) Add table to db

You can see Add rails model is not visible as a child of 2dea0b7 - however there is an invisible commit there (you can get the sha from the log messages above):

╰─>$ g unhide 52f1786
Unhid commit: 52f1786 Add rails model
To hide this 1 commit, run: git undo
╰─>$ g sl
◇ 0ff104b 23h (main) Fix
┃
● 2dea0b7 1m (ᐅ sej/add_table) Add table to db
┃
◯ 52f1786 1m Add rails model

Expected behavior

When amending a commit, descendant commits should be moved under the new amended commit and also be visible.

Actual behavior

When amending a commit descendant commits appear to be moved to the amended commit, but are not visible.

Version of rustc

No response

Automated bug report

Software version

git-branchless 0.10.0

Operating system

macOS 15.4 (Darwin 24.4.0)

Command-line

git-branchless bug-report 

Environment variables

SHELL=/opt/homebrew/bin/fish
EDITOR=emacsclient

Git version

> git version 
git version 2.49.0

Hooks

Hooks directory: /Users/scott/dev/portal/.git/hooks

Show 7 hooks
Hook post-applypatch
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook post-applypatch "$@"
## END BRANCHLESS CONFIG
Hook post-checkout
#!/usr/bin/env ruby
# frozen_string_literal: true

# Entrypoint for Overcommit hook integration. Installing Overcommit will result
# in all of your git hooks being copied from this file, allowing the framework
# to manage your hooks for you.

# Prevent a Ruby stack trace from appearing when we interrupt the hook.
# Note that this will be overridden when Overcommit is loaded, since the
# InterruptHandler will redefine the trap at that time.
Signal.trap('INT') do
  puts 'Hook run interrupted'
  exit 130
end

# Allow hooks to be disabled via environment variable so git commands can be run
# in scripts without Overcommit running hooks
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
  exit
end

hook_type = File.basename($0)
if hook_type == 'overcommit-hook'
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
       "by each hook in a repository's .git/hooks directory."
  exit 64 # EX_USAGE
end

# Check if Overcommit should invoke a Bundler context for loading gems
File.read('.overcommit.yml') =~ /gemfile: (?:false|['"]?(.*)['"]?)/
gemfile = Regexp.last_match(1)

if gemfile
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'

  begin
    Bundler.setup
  rescue Bundler::BundlerError => e
    puts "Problem loading '#{gemfile}': #{e.message}"
    puts "Try running:\nbundle install --gemfile=#{gemfile}" if e.is_a?(Bundler::GemNotFound)
    exit 78 # EX_CONFIG
  end
end
# rubocop:enable Style/RescueModifier

begin
  require 'overcommit'
rescue LoadError
  if gemfile
    puts 'You have specified the `gemfile` option in your Overcommit ' \
         'configuration but have not added the `overcommit` gem to ' \
         "#{gemfile}."
  else
    puts 'This repository contains hooks installed by Overcommit, but the ' \
         "`overcommit` gem is not installed.\n" \
         'Install it with `gem install overcommit`.'
  end

  exit 64 # EX_USAGE
end

begin
  logger = Overcommit::Logger.new(STDOUT)
  Overcommit::Utils.log = logger

  # Ensure master hook is up-to-date
  installer = Overcommit::Installer.new(logger)
  if installer.run(Overcommit::Utils.repo_root, action: :update)
    exec($0, *ARGV) # Execute the updated hook with all original arguments
  end

  config = Overcommit::ConfigurationLoader.new(logger).load_repo_config

  context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
  config.apply_environment!(context, ENV)

  printer = Overcommit::Printer.new(config, logger, context)
  runner = Overcommit::HookRunner.new(config, logger, context, printer)

  status = runner.run

  exit(status ? 0 : 65) # 65 = EX_DATAERR
rescue Overcommit::Exceptions::ConfigurationError => e
  puts e
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookContextLoadError => e
  puts e
  puts 'Are you running an old version of Overcommit?'
  exit 69 # EX_UNAVAILABLE
rescue Overcommit::Exceptions::HookLoadError,
       Overcommit::Exceptions::InvalidHookDefinition => e
  puts e.message
  puts e.backtrace
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookSetupFailed,
       Overcommit::Exceptions::HookCleanupFailed => e
  puts e.message
  exit 74 # EX_IOERR
rescue Overcommit::Exceptions::HookCancelled
  puts 'You cancelled the hook run'
  exit 130 # Ctrl-C cancel
rescue Overcommit::Exceptions::InvalidGitRepo => e
  puts e
  exit 64 # EX_USAGE
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => e
  puts e
  puts "For more information, see #{Overcommit::REPO_URL}#security"
  exit 1
rescue Overcommit::Exceptions::InvalidHookSignature
  exit 1
rescue StandardError => e
  puts e.message
  puts e.backtrace
  puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
  exit 70 # EX_SOFTWARE
end
Hook post-commit
#!/usr/bin/env ruby
# frozen_string_literal: true

# Entrypoint for Overcommit hook integration. Installing Overcommit will result
# in all of your git hooks being copied from this file, allowing the framework
# to manage your hooks for you.

# Prevent a Ruby stack trace from appearing when we interrupt the hook.
# Note that this will be overridden when Overcommit is loaded, since the
# InterruptHandler will redefine the trap at that time.
Signal.trap('INT') do
  puts 'Hook run interrupted'
  exit 130
end

# Allow hooks to be disabled via environment variable so git commands can be run
# in scripts without Overcommit running hooks
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
  exit
end

hook_type = File.basename($0)
if hook_type == 'overcommit-hook'
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
       "by each hook in a repository's .git/hooks directory."
  exit 64 # EX_USAGE
end

# Check if Overcommit should invoke a Bundler context for loading gems
File.read('.overcommit.yml') =~ /gemfile: (?:false|['"]?(.*)['"]?)/
gemfile = Regexp.last_match(1)

if gemfile
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'

  begin
    Bundler.setup
  rescue Bundler::BundlerError => e
    puts "Problem loading '#{gemfile}': #{e.message}"
    puts "Try running:\nbundle install --gemfile=#{gemfile}" if e.is_a?(Bundler::GemNotFound)
    exit 78 # EX_CONFIG
  end
end
# rubocop:enable Style/RescueModifier

begin
  require 'overcommit'
rescue LoadError
  if gemfile
    puts 'You have specified the `gemfile` option in your Overcommit ' \
         'configuration but have not added the `overcommit` gem to ' \
         "#{gemfile}."
  else
    puts 'This repository contains hooks installed by Overcommit, but the ' \
         "`overcommit` gem is not installed.\n" \
         'Install it with `gem install overcommit`.'
  end

  exit 64 # EX_USAGE
end

begin
  logger = Overcommit::Logger.new(STDOUT)
  Overcommit::Utils.log = logger

  # Ensure master hook is up-to-date
  installer = Overcommit::Installer.new(logger)
  if installer.run(Overcommit::Utils.repo_root, action: :update)
    exec($0, *ARGV) # Execute the updated hook with all original arguments
  end

  config = Overcommit::ConfigurationLoader.new(logger).load_repo_config

  context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
  config.apply_environment!(context, ENV)

  printer = Overcommit::Printer.new(config, logger, context)
  runner = Overcommit::HookRunner.new(config, logger, context, printer)

  status = runner.run

  exit(status ? 0 : 65) # 65 = EX_DATAERR
rescue Overcommit::Exceptions::ConfigurationError => e
  puts e
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookContextLoadError => e
  puts e
  puts 'Are you running an old version of Overcommit?'
  exit 69 # EX_UNAVAILABLE
rescue Overcommit::Exceptions::HookLoadError,
       Overcommit::Exceptions::InvalidHookDefinition => e
  puts e.message
  puts e.backtrace
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookSetupFailed,
       Overcommit::Exceptions::HookCleanupFailed => e
  puts e.message
  exit 74 # EX_IOERR
rescue Overcommit::Exceptions::HookCancelled
  puts 'You cancelled the hook run'
  exit 130 # Ctrl-C cancel
rescue Overcommit::Exceptions::InvalidGitRepo => e
  puts e
  exit 64 # EX_USAGE
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => e
  puts e
  puts "For more information, see #{Overcommit::REPO_URL}#security"
  exit 1
rescue Overcommit::Exceptions::InvalidHookSignature
  exit 1
rescue StandardError => e
  puts e.message
  puts e.backtrace
  puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
  exit 70 # EX_SOFTWARE
end
Hook post-merge
#!/usr/bin/env ruby
# frozen_string_literal: true

# Entrypoint for Overcommit hook integration. Installing Overcommit will result
# in all of your git hooks being copied from this file, allowing the framework
# to manage your hooks for you.

# Prevent a Ruby stack trace from appearing when we interrupt the hook.
# Note that this will be overridden when Overcommit is loaded, since the
# InterruptHandler will redefine the trap at that time.
Signal.trap('INT') do
  puts 'Hook run interrupted'
  exit 130
end

# Allow hooks to be disabled via environment variable so git commands can be run
# in scripts without Overcommit running hooks
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
  exit
end

hook_type = File.basename($0)
if hook_type == 'overcommit-hook'
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
       "by each hook in a repository's .git/hooks directory."
  exit 64 # EX_USAGE
end

# Check if Overcommit should invoke a Bundler context for loading gems
File.read('.overcommit.yml') =~ /gemfile: (?:false|['"]?(.*)['"]?)/
gemfile = Regexp.last_match(1)

if gemfile
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'

  begin
    Bundler.setup
  rescue Bundler::BundlerError => e
    puts "Problem loading '#{gemfile}': #{e.message}"
    puts "Try running:\nbundle install --gemfile=#{gemfile}" if e.is_a?(Bundler::GemNotFound)
    exit 78 # EX_CONFIG
  end
end
# rubocop:enable Style/RescueModifier

begin
  require 'overcommit'
rescue LoadError
  if gemfile
    puts 'You have specified the `gemfile` option in your Overcommit ' \
         'configuration but have not added the `overcommit` gem to ' \
         "#{gemfile}."
  else
    puts 'This repository contains hooks installed by Overcommit, but the ' \
         "`overcommit` gem is not installed.\n" \
         'Install it with `gem install overcommit`.'
  end

  exit 64 # EX_USAGE
end

begin
  logger = Overcommit::Logger.new(STDOUT)
  Overcommit::Utils.log = logger

  # Ensure master hook is up-to-date
  installer = Overcommit::Installer.new(logger)
  if installer.run(Overcommit::Utils.repo_root, action: :update)
    exec($0, *ARGV) # Execute the updated hook with all original arguments
  end

  config = Overcommit::ConfigurationLoader.new(logger).load_repo_config

  context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
  config.apply_environment!(context, ENV)

  printer = Overcommit::Printer.new(config, logger, context)
  runner = Overcommit::HookRunner.new(config, logger, context, printer)

  status = runner.run

  exit(status ? 0 : 65) # 65 = EX_DATAERR
rescue Overcommit::Exceptions::ConfigurationError => e
  puts e
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookContextLoadError => e
  puts e
  puts 'Are you running an old version of Overcommit?'
  exit 69 # EX_UNAVAILABLE
rescue Overcommit::Exceptions::HookLoadError,
       Overcommit::Exceptions::InvalidHookDefinition => e
  puts e.message
  puts e.backtrace
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookSetupFailed,
       Overcommit::Exceptions::HookCleanupFailed => e
  puts e.message
  exit 74 # EX_IOERR
rescue Overcommit::Exceptions::HookCancelled
  puts 'You cancelled the hook run'
  exit 130 # Ctrl-C cancel
rescue Overcommit::Exceptions::InvalidGitRepo => e
  puts e
  exit 64 # EX_USAGE
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => e
  puts e
  puts "For more information, see #{Overcommit::REPO_URL}#security"
  exit 1
rescue Overcommit::Exceptions::InvalidHookSignature
  exit 1
rescue StandardError => e
  puts e.message
  puts e.backtrace
  puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
  exit 70 # EX_SOFTWARE
end
Hook post-rewrite
#!/usr/bin/env ruby
# frozen_string_literal: true

# Entrypoint for Overcommit hook integration. Installing Overcommit will result
# in all of your git hooks being copied from this file, allowing the framework
# to manage your hooks for you.

# Prevent a Ruby stack trace from appearing when we interrupt the hook.
# Note that this will be overridden when Overcommit is loaded, since the
# InterruptHandler will redefine the trap at that time.
Signal.trap('INT') do
  puts 'Hook run interrupted'
  exit 130
end

# Allow hooks to be disabled via environment variable so git commands can be run
# in scripts without Overcommit running hooks
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
  exit
end

hook_type = File.basename($0)
if hook_type == 'overcommit-hook'
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
       "by each hook in a repository's .git/hooks directory."
  exit 64 # EX_USAGE
end

# Check if Overcommit should invoke a Bundler context for loading gems
File.read('.overcommit.yml') =~ /gemfile: (?:false|['"]?(.*)['"]?)/
gemfile = Regexp.last_match(1)

if gemfile
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'

  begin
    Bundler.setup
  rescue Bundler::BundlerError => e
    puts "Problem loading '#{gemfile}': #{e.message}"
    puts "Try running:\nbundle install --gemfile=#{gemfile}" if e.is_a?(Bundler::GemNotFound)
    exit 78 # EX_CONFIG
  end
end
# rubocop:enable Style/RescueModifier

begin
  require 'overcommit'
rescue LoadError
  if gemfile
    puts 'You have specified the `gemfile` option in your Overcommit ' \
         'configuration but have not added the `overcommit` gem to ' \
         "#{gemfile}."
  else
    puts 'This repository contains hooks installed by Overcommit, but the ' \
         "`overcommit` gem is not installed.\n" \
         'Install it with `gem install overcommit`.'
  end

  exit 64 # EX_USAGE
end

begin
  logger = Overcommit::Logger.new(STDOUT)
  Overcommit::Utils.log = logger

  # Ensure master hook is up-to-date
  installer = Overcommit::Installer.new(logger)
  if installer.run(Overcommit::Utils.repo_root, action: :update)
    exec($0, *ARGV) # Execute the updated hook with all original arguments
  end

  config = Overcommit::ConfigurationLoader.new(logger).load_repo_config

  context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
  config.apply_environment!(context, ENV)

  printer = Overcommit::Printer.new(config, logger, context)
  runner = Overcommit::HookRunner.new(config, logger, context, printer)

  status = runner.run

  exit(status ? 0 : 65) # 65 = EX_DATAERR
rescue Overcommit::Exceptions::ConfigurationError => e
  puts e
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookContextLoadError => e
  puts e
  puts 'Are you running an old version of Overcommit?'
  exit 69 # EX_UNAVAILABLE
rescue Overcommit::Exceptions::HookLoadError,
       Overcommit::Exceptions::InvalidHookDefinition => e
  puts e.message
  puts e.backtrace
  exit 78 # EX_CONFIG
rescue Overcommit::Exceptions::HookSetupFailed,
       Overcommit::Exceptions::HookCleanupFailed => e
  puts e.message
  exit 74 # EX_IOERR
rescue Overcommit::Exceptions::HookCancelled
  puts 'You cancelled the hook run'
  exit 130 # Ctrl-C cancel
rescue Overcommit::Exceptions::InvalidGitRepo => e
  puts e
  exit 64 # EX_USAGE
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => e
  puts e
  puts "For more information, see #{Overcommit::REPO_URL}#security"
  exit 1
rescue Overcommit::Exceptions::InvalidHookSignature
  exit 1
rescue StandardError => e
  puts e.message
  puts e.backtrace
  puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
  exit 70 # EX_SOFTWARE
end
Hook pre-auto-gc
#!/bin/sh
## START BRANCHLESS CONFIG

git branchless hook pre-auto-gc "$@"
## END BRANCHLESS CONFIG
Hook reference-transaction
#!/bin/sh
## START BRANCHLESS CONFIG

# Avoid canceling the reference transaction in the case that `branchless` fails
# for whatever reason.
git branchless hook reference-transaction "$@" || (
echo 'branchless: Failed to process reference transaction!'
echo 'branchless: Some events (e.g. branch updates) may have been lost.'
echo 'branchless: This is a bug. Please report it.'
)
## END BRANCHLESS CONFIG

Events

Show 5 events
Event ID: 95227, transaction ID: 55275 (message: hide)
  1. ObsoleteEvent { timestamp: 1744216720.395511, event_tx_id: Id(55275), commit_oid: NonZeroOid(989826c8293b36e93cc2bd4aa78b799235374d7e) }
:
O eef570f 16d (redacted-ref-0) xxxxxx xxxxxxxxxxx xxx xxxxxxxx xxxxxx xxxxxx xxxxxxxxxxx xxxxxxxx
:
O 0c2bde7 1d xxxxxxx xxxxxxxxxxx xxxxx xxx xxxxxxxxxx xxxxxxxx
|\
| o 2b52f60 1d xxxx xxxxxxxxxxxxx xxx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxx
|\
: o 55cec86 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 27e5cf5 1d xxxxxxx xxxxxxxxxxx xx xxxxxxx xxxxxxxx
|\
: o 19b3fe5 1d xxx xxxxxxxxxx xxxxxx
: |
: o 281ea52 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 0ff104b 1d (main) xxxxx xxx xxxxxxxxxx xxxxxx xxxxxxxx
|
@ 2dea0b7 39m (redacted-ref-1) xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
|
o 52f1786 39m xxx xxxxxxxxxxxxx xxxxx
Event ID: 95226, transaction ID: 55274 (message: unhide)
  1. UnobsoleteEvent { timestamp: 1744216709.575606, event_tx_id: Id(55274), commit_oid: NonZeroOid(52f1786f37c801a35374187c92e58b6cdcc06c4c) }
:
O eef570f 16d (redacted-ref-0) xxxxxx xxxxxxxxxxx xxx xxxxxxxx xxxxxx xxxxxx xxxxxxxxxxx xxxxxxxx
:
O 0c2bde7 1d xxxxxxx xxxxxxxxxxx xxxxx xxx xxxxxxxxxx xxxxxxxx
|\
| o 2b52f60 1d xxxx xxxxxxxxxxxxx xxx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxx
|\
: o 55cec86 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 27e5cf5 1d xxxxxxx xxxxxxxxxxx xx xxxxxxx xxxxxxxx
|\
: o 19b3fe5 1d xxx xxxxxxxxxx xxxxxx
: |
: o 281ea52 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 0ff104b 1d (main) xxxxx xxx xxxxxxxxxx xxxxxx xxxxxxxx
|
@ 2dea0b7 39m (redacted-ref-1) xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
|
o 52f1786 39m xxx xxxxxxxxxxxxx xxxxx
Event ID: 95218, transaction ID: 55272 (message: amend)
  1. WorkingCopySnapshot { timestamp: 1744216623.745274, event_tx_id: Id(55272), head_oid: 05ad515301bb4967a07816150c3ec2daf095e390, commit_oid: NonZeroOid(f2b0ab6b6a771a6836a5af21be025c54c731e6f2), ref_name: Some(ReferenceName("refs/heads/redacted-ref-1")) }
  2. RewriteEvent { timestamp: 1744216623.745274, event_tx_id: Id(55272), old_commit_oid: 05ad515301bb4967a07816150c3ec2daf095e390, new_commit_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036 }
  3. RefUpdateEvent { timestamp: 1744216624.086505, event_tx_id: Id(55272), ref_name: ReferenceName("refs/heads/redacted-ref-1"), old_oid: 05ad515301bb4967a07816150c3ec2daf095e390, new_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, message: None }
  4. WorkingCopySnapshot { timestamp: 1744216624.147023, event_tx_id: Id(55272), head_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, commit_oid: NonZeroOid(88920837bfc289e135266f23ebe51de94373f90d), ref_name: Some(ReferenceName("refs/heads/redacted-ref-1")) }
  5. RefUpdateEvent { timestamp: 1744216624.270003, event_tx_id: Id(55272), ref_name: ReferenceName("refs/heads/redacted-ref-1"), old_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, new_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, message: None }
  6. WorkingCopySnapshot { timestamp: 1744216625.073289, event_tx_id: Id(55272), head_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, commit_oid: NonZeroOid(243bfe84de8fd4d3b0255fe32f2aae577500042f), ref_name: None }
  7. RefUpdateEvent { timestamp: 1744216625.15565, event_tx_id: Id(55272), ref_name: ReferenceName("HEAD"), old_oid: 0000000000000000000000000000000000000000, new_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, message: None }
  8. RefUpdateEvent { timestamp: 1744216625.557842, event_tx_id: Id(55272), ref_name: ReferenceName("HEAD"), old_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, new_oid: 2dea0b777253c2e5bda72065cc8d84a359ca6036, message: None }
:
O eef570f 16d (redacted-ref-0) xxxxxx xxxxxxxxxxx xxx xxxxxxxx xxxxxx xxxxxx xxxxxxxxxxx xxxxxxxx
:
O 0c2bde7 1d xxxxxxx xxxxxxxxxxx xxxxx xxx xxxxxxxxxx xxxxxxxx
|\
| o 2b52f60 1d xxxx xxxxxxxxxxxxx xxx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxx
|\
: o 55cec86 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 27e5cf5 1d xxxxxxx xxxxxxxxxxx xx xxxxxxx xxxxxxxx
|\
: o 19b3fe5 1d xxx xxxxxxxxxx xxxxxx
: |
: o 281ea52 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 0ff104b 1d (main) xxxxx xxx xxxxxxxxxx xxxxxx xxxxxxxx
|
@ 2dea0b7 39m (redacted-ref-1) xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
|
o 52f1786 39m xxx xxxxxxxxxxxxx xxxxx
Event ID: 95215, transaction ID: 55271 (message: prev)
  1. WorkingCopySnapshot { timestamp: 1744216272.160639, event_tx_id: Id(55271), head_oid: 989826c8293b36e93cc2bd4aa78b799235374d7e, commit_oid: NonZeroOid(5019588584815ab3c563a050be00a3bcdac4b6e2), ref_name: None }
  2. RefUpdateEvent { timestamp: 1744216272.342959, event_tx_id: Id(55271), ref_name: ReferenceName("HEAD"), old_oid: 0000000000000000000000000000000000000000, new_oid: 05ad515301bb4967a07816150c3ec2daf095e390, message: None }
  3. RefUpdateEvent { timestamp: 1744216272.998882, event_tx_id: Id(55271), ref_name: ReferenceName("HEAD"), old_oid: 989826c8293b36e93cc2bd4aa78b799235374d7e, new_oid: 05ad515301bb4967a07816150c3ec2daf095e390, message: None }
:
O eef570f 16d (redacted-ref-0) xxxxxx xxxxxxxxxxx xxx xxxxxxxx xxxxxx xxxxxx xxxxxxxxxxx xxxxxxxx
:
O 0c2bde7 1d xxxxxxx xxxxxxxxxxx xxxxx xxx xxxxxxxxxx xxxxxxxx
|\
| o 2b52f60 1d xxxx xxxxxxxxxxxxx xxx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxx
|\
: o 55cec86 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 27e5cf5 1d xxxxxxx xxxxxxxxxxx xx xxxxxxx xxxxxxxx
|\
: o 19b3fe5 1d xxx xxxxxxxxxx xxxxxx
: |
: o 281ea52 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 0ff104b 1d (main) xxxxx xxx xxxxxxxxxx xxxxxx xxxxxxxx
|
@ 2dea0b7 39m (redacted-ref-1) xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
|
o 52f1786 39m xxx xxxxxxxxxxxxx xxxxx
Event ID: 95211, transaction ID: 55270 (message: amend)
  1. WorkingCopySnapshot { timestamp: 1744216267.654525, event_tx_id: Id(55270), head_oid: 10c972cc33cd5249ee9920bb6100f12abb28eea4, commit_oid: NonZeroOid(5b1ab6a82749c00e2b75d6ea466dda417a77e9d3), ref_name: None }
  2. RewriteEvent { timestamp: 1744216267.654525, event_tx_id: Id(55270), old_commit_oid: 10c972cc33cd5249ee9920bb6100f12abb28eea4, new_commit_oid: 989826c8293b36e93cc2bd4aa78b799235374d7e }
  3. WorkingCopySnapshot { timestamp: 1744216268.001803, event_tx_id: Id(55270), head_oid: 10c972cc33cd5249ee9920bb6100f12abb28eea4, commit_oid: NonZeroOid(5b1ab6a82749c00e2b75d6ea466dda417a77e9d3), ref_name: None }
  4. RefUpdateEvent { timestamp: 1744216268.120103, event_tx_id: Id(55270), ref_name: ReferenceName("HEAD"), old_oid: 10c972cc33cd5249ee9920bb6100f12abb28eea4, new_oid: 989826c8293b36e93cc2bd4aa78b799235374d7e, message: None }
:
O eef570f 16d (redacted-ref-0) xxxxxx xxxxxxxxxxx xxx xxxxxxxx xxxxxx xxxxxx xxxxxxxxxxx xxxxxxxx
:
O 0c2bde7 1d xxxxxxx xxxxxxxxxxx xxxxx xxx xxxxxxxxxx xxxxxxxx
|\
| o 2b52f60 1d xxxx xxxxxxxxxxxxx xxx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxx
|\
: o 55cec86 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 27e5cf5 1d xxxxxxx xxxxxxxxxxx xx xxxxxxx xxxxxxxx
|\
: o 19b3fe5 1d xxx xxxxxxxxxx xxxxxx
: |
: o 281ea52 1d xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
:
O 0ff104b 1d (main) xxxxx xxx xxxxxxxxxx xxxxxx xxxxxxxx
|
@ 2dea0b7 39m (redacted-ref-1) xxx xxxxxx xxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx xxxxx
|
o 52f1786 39m xxx xxxxxxxxxxxxx xxxxx

Version of git-branchless

git-branchless-opts 0.10.0

Version of git

git version 2.49.0

scottjacobsen avatar Apr 09 '25 17:04 scottjacobsen

This appears to be a bad interaction with overcommit.

In my .overcommit.yml I have:

PostRewrite:
  CustomScript:
    enabled: true
    required_executable: './.git/hooks/old-hooks/post-rewrite

which should call the git branchless hook first (it is in old-hooks/post-rewrite), but that seems to cause a failure.

Instead I disabled the CustomScript in overcommit.yml and manually added

`git branchless hook post-rewrite #{ARGV}`

to the top of overcommit's.git/hooks/post-rewrite file and things seem fine now.

scottjacobsen avatar Apr 09 '25 21:04 scottjacobsen

Re-opened in hopes of converting to a discussion, but I don't know how to do that.

scottjacobsen avatar Apr 09 '25 21:04 scottjacobsen