git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add git-filter-branch

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Jun 4, 2007, 07:18 UTC
Message-ID
<4663BCDA.F1BADDD8@eudaptics.com>
In-Reply-To
<Pine.LNX.4.64.0706030129110.4046@racer.site>
Johannes Schindelin wrote:
Show 11 quoted lines
> 
> 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>
If you hadn't done that, I'd done it sooner or later. Thanks!
Show 6 quoted lines
> +       -r)
> +               unchanged="$(get_parents "$OPTARG") $unchanged"
> +               ;;
> +       -k)
> +               unchanged="$(git-rev-parse "$OPTARG"^{commit}) $unchanged"
> +               ;;
These two (-r and -k) together with...
> +# seed with identity mappings for the parents where we start off
> +for commit in $unchanged; do
> +       echo $commit > ../map/$commit
> +done
... this and ...
Show 6 quoted lines
> +               if [ -r "../map/$parent" ]; then
> +                       for reparent in $(cat "../map/$parent"); do
> +                               parentstr="$parentstr -p $reparent"
> +                       done
> +               else
> +                       die "assertion failed: parent $parent for commit $commit not found in rewritten ones"
... this, means that any simple command like 
  git filter-branch -k orgin/master origin/next new-next

of your git.git clone will fail with the "assertion failed". (I haven't tried your script, yet, but cg-admin-rewritehist fails.)

I propose that you just get rid of the "seed" stance and don't fail if a commit cannot be mapped - just use it unchanged (don't forget to adjust the map() function, too). Then you can get rid of -r and use -k to specify everything you want under "--not" in the rev-list.

-- Hannes
Previous: Johannes SchindelinNext: Johannes Sixt
Message 13 of 27 in “Add git-filter-branch”
  1. Add git-filter-branchJohannes Schindelin, Jun 3, 2007
  2. Jakub NarebskiJun 3, 2007
  3. Johannes SchindelinJun 3, 2007
  4. Jakub NarebskiJun 3, 2007
  5. Steven GrimmJun 3, 2007
  6. Johannes SchindelinJun 3, 2007
  7. Jonas FonsecaJun 5, 2007
  8. David KastrupJun 5, 2007
  9. Junio C HamanoJun 5, 2007
  10. Jonas FonsecaJun 5, 2007
  11. Johannes SchindelinJun 5, 2007
  12. filter-branch: use $(($i+1)) instead of $((i+1))Johannes Schindelin, Jun 6, 2007
  13. Johannes SixtJun 4, 2007
  14. Johannes SixtJun 4, 2007
  15. Johannes SchindelinJun 4, 2007
  16. Johannes SixtJun 4, 2007
  17. Johannes SchindelinJun 4, 2007
  18. Johannes SixtJun 5, 2007
  19. Johannes SchindelinJun 5, 2007
  20. Johannes SixtJun 6, 2007
  21. Junio C HamanoJun 6, 2007
  22. Johannes SchindelinJun 6, 2007
  23. Johannes SixtJun 6, 2007
  24. Johannes SchindelinJun 6, 2007
  25. filter-branch: also don't fail in map() if a commit cannot be mappedJohannes Sixt, Jun 6, 2007
  26. Johannes SchindelinJun 6, 2007
  27. filter-branch: also don't fail in map() if a commit cannot be mappedJohannes Sixt, Jun 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.