Skip to content

Instantly share code, notes, and snippets.

@ftrader
Created July 1, 2017 19:07
Show Gist options
  • Select an option

  • Save ftrader/46dae4ea107db129d0a3b1603416f9f2 to your computer and use it in GitHub Desktop.

Select an option

Save ftrader/46dae4ea107db129d0a3b1603416f9f2 to your computer and use it in GitHub Desktop.
Tool to obtain diff of Bitcoin ABC to similarly formatted baseline Core commit(to eliminate as much as possible the formatting changes from the diff)
#!/bin/bash
#
# Copyright (c) 2017 freetrader (freetrader@tuta.io)
# This script is placed in the public domain.
#
# It obtains the difference between the reformatted Core baseline commit
# on top of which Bitcoin ABC was developed.
#
# After running this script, you should have a 'abc_diff_to_core_base'
# subfolder, in which there is the full .diff and the repo from which
# it was produced (containing a 'baseline' branch which is the reformatted
# Core 0.14.1 baseline, and the latest Bitcoin ABC 'master' branch).
set -e
OUTPUT_FOLDER=abc_diff_to_core_base
pushd .
mkdir $OUTPUT_FOLDER
cd $OUTPUT_FOLDER
# Clone the current ABC repo's 'master' branch.
git clone -b master https://github.com/Bitcoin-ABC/bitcoin-abc.git bitcoin-abc-diffs
cd bitcoin-abc-diffs
# Fetch reformatted baseline tree from freetrader's repo.
git fetch https://github.com/ftrader-bitcoinabc/bitcoin-abc.git format_core_0_14_1_baseline_for_comparison:baseline
# Run the comparison.
git diff baseline master > ../abc_baseline_to_master.diff
# Output some stats for the diff.
git diff --stat baseline master | tail -1
popd
@ftrader

ftrader commented Jul 1, 2017

Copy link
Copy Markdown
Author

This uses about 93MB on the disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment