Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Feb 6, 2009
  1. @dscho @gitster

    filter-branch: do not consider diverging submodules a 'dirty worktree'

    dscho authored gitster committed
    At the end of filter-branch in a non-bare repository, the work tree is
    updated with "read-tree -m -u HEAD", to carry the change forward in case
    the current branch was rewritten.  In order to avoid losing any local
    change during this step, filter-branch refuses to work when there are
    local changes in the work tree.
    
    This "read-tree -m -u HEAD" operation does not affect what commit is
    checked out in a submodule (iow, it does not touch .git/HEAD in a
    submodule checkout), and checking if there is any local change to the
    submodule is not useful.
    
    Staged submodules _are_ considered to be 'dirty', however,  as the
    "read-tree -m -u HEAD" could result in loss of staged information
    otherwise.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 29, 2007
  1. @dscho @gitster

    Replace instances of export VAR=VAL with VAR=VAL; export VAR

    dscho authored gitster committed
    It might be POSIX, but there are shells that do not like the
    expression 'export VAR=VAL'.  To be on the safe side, rewrite them
    into 'VAR=VAL' and 'export VAR'.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 28, 2007
  1. @dscho @gitster

    filter-branch: fix dirty way to provide the helpers to commit filters

    dscho authored gitster committed
    The helper functions 'map' and 'skip_commit' were provided to commit
    filters by sourcing filter-branch itself.  This was done with a certain
    environment variable set to indicate that only the functions should be
    defined, and the script should return then.
    
    This was really hacky, and it did not work all that well, since the
    full path to git-filter-branch was not known at all times.
    
    Avoid that by putting the functions into a variable, and eval'ing
    that variable.  The commit filter gets these functions by prepending
    the variable to the specified commands.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 17, 2007
  1. @dscho @spearce

    filter-branch: update current branch when rewritten

    dscho authored spearce committed
    Earlier, "git filter-branch --<options> HEAD" would not update the
    working tree after rewriting the branch.  This commit fixes it.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Sep 1, 2007
  1. @dscho @gitster

    filter-branch: introduce convenience function "skip_commit"

    dscho authored gitster committed
    With this function, a commit filter can leave out unwanted commits
    (such as temporary commits).  It does _not_ undo the changeset
    corresponding to that commit, but it _skips_ the revision.  IOW
    no tree object is changed by this.
    
    If you like to commit early and often, but want to filter out all
    intermediate commits, marked by "@@@" in the commit message, you can
    now do this with
    
    	git filter-branch --commit-filter '
    		if git cat-file commit $GIT_COMMIT | grep '@@@' > /dev/null;
    		then
    			skip_commit "$@";
    		else
    			git commit-tree "$@";
    		fi' newbranch
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @dscho @gitster

    filter-branch: provide the convenience functions also for commit filters

    dscho authored gitster committed
    Move the convenience functions to the top of git-filter-branch.sh, and
    return from the script when the environment variable SOURCE_FUNCTIONS is
    set.
    
    By sourcing git-filter-branch with that variable set automatically, all
    commit filters may access the convenience functions like "map".
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 24, 2007
  1. @dscho @gitster

    filter-branch: Big syntax change; support rewriting multiple refs

    dscho authored gitster committed
    We used to take the first non-option argument as the name for the new
    branch.  This syntax is not extensible to support rewriting more than just
    HEAD.
    
    Instead, we now have the following syntax:
    
    	git filter-branch [<filter options>...] [<rev-list options>]
    
    All positive refs given in <rev-list options> are rewritten.  Yes,
    in-place.  If a ref was changed, the original head is stored in
    refs/original/$ref now, for your inspecting pleasure, in addition to the
    reflogs (since it is easier to inspect "git show-ref | grep original" than
    to inspect all the reflogs).
    
    This commit also adds the --force option to remove .git-rewrite/ and all
    refs from refs/original/ before filtering.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 19, 2007
  1. @dscho @gitster

    filter-branch: get rid of "set -e"

    dscho authored gitster committed
    It was reported by Alex Riesen that "set -e" can break something as
    trivial as "unset CDPATH" in bash.
    
    So get rid of "set -e".
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 6, 2007
  1. @dscho @gitster

    filter-branch: fail gracefully when a filter fails

    dscho authored gitster committed
    A common mistake is to provide a filter which fails unwantedly. For
    example, this will stop in the middle:
    
    	git filter-branch --env-filter '
    		test $GIT_COMMITTER_EMAIL = xyz &&
    		export GIT_COMMITTER_EMAIL = abc' rewritten
    
    When $GIT_COMMITTER_EMAIL is not "xyz", the test fails, and consequently
    the whole filter has a non-zero exit status. However, as demonstrated
    in this example, filter-branch would just stop, and the user would be
    none the wiser.
    
    Also, a failing msg-filter would not have been caught, as was the
    case with one of the tests.
    
    This patch fixes both issues, by paying attention to the exit status
    of msg-filter, and by saying what failed before exiting.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 4, 2007
  1. @dscho @gitster

    filter-branch: make output nicer

    dscho authored gitster committed
    Instead of filling the screen with progress lines, use \r so that
    the progress can be seen, but warning messages are more visible.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @dscho @gitster

    Document git-filter-branch

    dscho authored gitster committed
    This moves the documentation in git-filter-branch.sh to its own
    man page, with a few touch ups (incorporating comments by Frank
    Lichtenheld).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 23, 2007
  1. @dscho @gitster

    filter-branch: add example to move everything into a subdirectory

    dscho authored gitster committed
    This is based on Jeff King's example in
    
    	20070621130137.GB4487@coredump.intra.peff.net
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 9, 2007
  1. @dscho @gitster

    Teach filter-branch about subdirectory filtering

    dscho authored gitster committed
    With git-filter-branch --subdirectory-filter <subdirectory> you can
    get at the history, as seen by a certain subdirectory. The history
    of the rewritten branch will only contain commits that touched that
    subdirectory, and the subdirectory will be rewritten to be the new
    project root.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 6, 2007
  1. @dscho @gitster

    filter-branch: fix behaviour of '-k'

    dscho authored gitster committed
    The option '-k' says that the given commit and _all_ of its ancestors
    are kept as-is.
    
    However, if a to-be-rewritten commit branched from an ancestor of an
    ancestor of a commit given with '-k', filter-branch would fail.
    
    Example:
    
    	A - B
    	  \
    	    C
    
    If filter-branch was called with '-k B -s C', it would actually keep
    B (and A as its parent), but would rewrite C, and its parent.
    
    Noticed by Johannes Sixt.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @dscho @gitster

    filter-branch: use $(($i+1)) instead of $((i+1))

    dscho authored gitster committed
    The expression $((i+1)) is not portable at all: even some bash versions
    do not grok it. So do not use it.
    
    Noticed by Jonas Fonseca.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 3, 2007
  1. @dscho

    Add git-filter-branch

    dscho authored Junio C Hamano committed
    This script is derived from Pasky's cg-admin-rewritehist.
    
    In fact, it _is_ the same script, minimally adapted to work without cogito.
    It _should_ be able to perform the same tasks, even if only relying on
    core-git programs.
    
    All the work is Pasky's, just the adaption is mine.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Hopefully-signed-off-by: Petr "cogito master" Baudis <pasky@suse.cz>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.