<!DOCTYPE refentry PUBLIC "-//Norman Walsh/DTD DocBk XML V4.1.2//EN"
"http://www.docbook.org/xml/4.1.2/docbookx.dtd" [
  <!-- vim: set tw=78 et sw=2 sts=2 ft=txt: -->
  <!ENTITY dhfirstname "<firstname>Osamu</firstname>">
  <!ENTITY dhsurname   "<surname>Aoki</surname>">
  <!ENTITY dhdate      "<date>2021-06-04</date>">
  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
  <!ENTITY dhemail     "<email>osamu@debian.org</email>">
  <!ENTITY dhusername  "Osamu Aoki">
  <!ENTITY dhucpackage "<refentrytitle>git-ime</refentrytitle>">
  <!ENTITY dhpackage   "git-ime">
  <!ENTITY dhtitle     "git-ime User Manual">
  <!ENTITY dhucpackage "git-ime">

  <!ENTITY gnu         "<acronym>GNU</acronym>">
]>

<refentry>
  <refentryinfo>
    <title>&dhtitle;</title>
    <productname>&dhpackage;</productname>
    <address>
      &dhemail;
    </address>
    <author>
      &dhfirstname;
      &dhsurname;
      <contrib>Original author of this script.</contrib>
    </author>
    <copyright>
      <year>2018-2021</year>
      <holder>&dhusername; &dhemail;</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>
    <refpurpose>An interactive git commit split helper tool</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage;</command>
      <arg><option>-a</option></arg>
      <arg><option>--auto</option></arg>
      <arg><option>-n</option></arg>
      <arg><option>--notag</option></arg>
      <arg><option>-v</option></arg>
      <arg><option>--verbose</option></arg>
      <arg><option>-h</option></arg>
      <arg><option>--help</option></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>

   <title>DESCRIPTION</title>

<para>This <command>git ime</command> is a simple shell wrapper script on
<command>git</command> and <command>imediff</command> to split the latest
commit from HEAD^ to HEAD on the current git repository into multiple
commits.</para>

<para>If any staged changes or local uncommitted changes are found in the git
repository, <command>git ime</command> immediately exits without changes to be
on the safe side.</para>

<para>If the latest commit involves multiple files, this big commit is split
by the file into multiple smaller commits involving a single file.</para>

<para>If the latest commit involves only a single file, the commit is split
into multiple smaller commits involving  a set of meaningful partial changes
selected by <command>imediff</command> interactively.</para>

<para>This <command>git-ime</command> is not only useful at the checked out
branch head but also at "edit" prompt during the interactive execution of
<command>git rebase -i <replaceable>treeish</replaceable></command>.  Execute
<command>git-ime</command> after committing the pending commit.</para>

<para>To preserve good accessibility to the original state, this
<command>git-ime</command> tags the original commit with
"git-ime-aYYYYMMDD-HHMMSS" if it hasn't been tagged.  Also this
<command>git-ime</command> tags its final commit with
"git-ime-zYYYYMMDD-HHMMSS" for the convenience of subsequent operations such
as <command>git-rebase</command>. This is not applicable during
<command>git-rebase</command> .</para>

<para>Please note this <command>git-ime</command> creates or overwrites
<replaceable>file</replaceable>.tmp_a and
<replaceable>file</replaceable>.tmp_b files.  So they should not exist before
execution of this command.</para>

  </refsect1>

  <refsect1>
    <title>OPTIONS</title>

    <variablelist>

      <varlistentry>
      <term><option>-a</option></term> <term><option>--auto</option></term>
        <listitem>

<para>When operating on a single file change commit, the <command>git
ime</command> command executes <command>imediff</command> with
<command>--macro "Abw"</command> to select a series of minimum partial changes
automatically and repeatedly to create a series of commits, instead.</para>

        </listitem>
      </varlistentry>

      <varlistentry>
      <term><option>-v</option></term> <term><option>--verbose</option></term>
        <listitem>

<para>The <command>git ime</command> command is executed with verbose console
outputs.</para>

        </listitem>
      </varlistentry>

      <varlistentry>
      <term><option>-n</option></term> <term><option>--notag</option></term>
        <listitem>

<para>Disable automatic tagging feature.  Since the use of this option is
desirable if this <command>git ime</command> command is used during the
<command>git rebase</command> operation.  In such case, this is automatically
turned on as the default behavior.</para>

        </listitem>
      </varlistentry>

      <varlistentry>
      <term><option>-h</option></term> <term><option>--help</option></term>
        <listitem>

<para>The <command>git ime</command> outputs help message.</para>

        </listitem>
      </varlistentry>

    </variablelist>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>

<para>imediff (1), git(1), and git-rebase(1).</para>

  </refsect1>
  <refsect1>
    <title>COPYRIGHT</title>

<para>This manual page as well as the program itself was written by
<author>&dhfirstname; &dhsurname;</author> (&dhemail;).  This document has been
placed into the Public Domain.  </para>

  </refsect1>
</refentry>
