git/builtin
Felipe Contreras 49266e8a11 fast-export: don't handle uninteresting refs
They have been marked as UNINTERESTING for a reason, lets respect
that.  Currently the first ref is handled properly, but not the
rest.  Assuming that all the refs point at the same commit in the
following example:

  % git fast-export master ^uninteresting ^foo ^bar
  reset refs/heads/bar
  from :0

  reset refs/heads/foo
  from :0

  reset refs/heads/uninteresting
  from :0

  % git fast-export ^uninteresting ^foo ^bar master
  reset refs/heads/master
  from :0

  reset refs/heads/bar
  from :0

  reset refs/heads/foo
  from :0

Clearly this is wrong; the negative refs should be ignored.

After this patch:

  % git fast-export ^uninteresting ^foo ^bar master
  # nothing
  % git fast-export master ^uninteresting ^foo ^bar
  # nothing

And even more, it would only happen if the ref is pointing to exactly
the same commit, but not otherwise:

 % git fast-export ^next next
 reset refs/heads/next
 from :0

 % git fast-export ^next next^{commit}
 # nothing
 % git fast-export ^next next~0
 # nothing
 % git fast-export ^next next~1
 # nothing
 % git fast-export ^next next~2
 # nothing

The reason this happens is that before traversing the commits,
fast-export checks if any of the refs point to the same object, and any
duplicated ref gets added to a list in order to issue 'reset' commands
after the traversing. Unfortunately, it's not even checking if the
commit is flagged as UNINTERESTING. The fix of course, is to check it.

However, in order to do it properly we need to get the UNINTERESTING
flag from the command line, not from the commit object, because
"^foo bar" will mark the commit 'bar' uninteresting if foo and bar
points at the same commit.  rev_cmdline_info, which was introduced
exactly to handle this situation, contains all the information we
need for get_tags_and_duplicates(), plus the ref flag. This way the
rest of the positive refs will remain untouched; it's only the
negative ones that change in behavior.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-03 09:52:08 -08:00
..
add.c Merge branch 'rj/path-cleanup' 2012-09-14 11:53:53 -07:00
annotate.c
apply.c Merge branch 'maint-1.7.11' into maint 2012-09-12 14:08:05 -07:00
archive.c Reduce translations by using same terminologies 2012-08-22 12:02:28 -07:00
bisect--helper.c
blame.c pretty: remove reencode_commit_message() 2012-10-17 22:42:40 -07:00
branch.c branch: show targets of deleted symrefs, not sha1s 2012-10-18 14:36:17 -07:00
bundle.c
cat-file.c Merge branch 'maint-1.7.11' into maint 2012-09-10 15:31:06 -07:00
check-attr.c Merge branch 'maint' 2012-09-17 15:59:34 -07:00
check-ref-format.c
checkout-index.c Use imperative form in help usage to describe an action 2012-08-22 12:02:28 -07:00
checkout.c checkout: print a message when switching unborn branches 2012-11-15 17:36:26 -08:00
clean.c
clone.c Merge branch 'rt/maint-clone-single' into maint 2012-10-08 11:34:02 -07:00
column.c
commit-tree.c
commit.c status: add --long output format option 2012-10-18 15:01:35 -07:00
config.c Merge branch 'cn/config-missing-path' 2012-11-20 10:40:46 -08:00
count-objects.c
credential.c
describe.c Merge branch 'jk/peel-ref' 2012-10-25 06:42:27 -04:00
diff-files.c
diff-index.c update-index/diff-index: use core.preloadindex to improve performance 2012-11-02 11:38:29 -04:00
diff-tree.c
diff.c Merge branch 'kb/preload-index-more' 2012-11-20 10:32:10 -08:00
fast-export.c fast-export: don't handle uninteresting refs 2012-12-03 09:52:08 -08:00
fetch-pack.c fetch-pack: move core code to libgit.a 2012-10-29 03:40:29 -04:00
fetch.c Merge branch 'dj/fetch-all-tags' into maint 2012-09-24 12:39:21 -07:00
fmt-merge-msg.c
for-each-ref.c Merge branch 'nd/i18n-parseopt-help' 2012-09-07 11:09:09 -07:00
fsck.c
gc.c silence git gc --auto --quiet output 2012-09-27 17:57:26 -07:00
grep.c Merge branch 'nd/grep-true-path' 2012-10-29 04:13:16 -04:00
hash-object.c
help.c
index-pack.c i18n: mark more index-pack strings for translation 2012-08-31 13:05:05 -07:00
init-db.c
log.c log: honor grep.* configuration 2012-10-09 23:21:30 -07:00
ls-files.c
ls-remote.c ls-remote: document the '--get-url' option 2012-09-07 10:58:35 -07:00
ls-tree.c
mailinfo.c Merge branch 'jc/same-encoding' 2012-11-15 10:24:05 -08:00
mailsplit.c
merge-base.c Merge branch 'jc/merge-bases' 2012-09-11 11:36:05 -07:00
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Move try_merge_command and checkout_fast_forward to libgit.a 2012-10-29 03:08:30 -04:00
mktag.c
mktree.c
mv.c
name-rev.c
notes.c builtin/notes.c: mark file-scope private symbols as static 2012-09-15 22:58:20 -07:00
pack-objects.c Merge branch 'jk/peel-ref' 2012-10-25 06:42:27 -04:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c Merge branch 'rj/path-cleanup' 2012-09-14 11:53:53 -07:00
push.c Merge branch 'nd/i18n-parseopt-help' 2012-09-07 11:09:09 -07:00
read-tree.c
receive-pack.c Merge branch 'jk/receive-pack-unpack-error-to-pusher' 2012-10-01 12:58:34 -07:00
reflog.c
remote-ext.c
remote-fd.c
remote.c Merge branch 'nd/maint-remote-remove' 2012-09-12 14:21:58 -07:00
replace.c replace: parse revision argument for -d 2012-11-13 08:34:14 -05:00
rerere.c
reset.c
rev-list.c Move print_commit_list to libgit.a 2012-10-29 03:08:30 -04:00
rev-parse.c Merge branch 'maint-1.7.11' into maint 2012-09-12 14:08:05 -07:00
revert.c Merge branch 'mz/cherry-pick-cmdline-order' 2012-09-10 15:42:55 -07:00
rm.c Merge branch 'jl/submodule-rm' 2012-10-29 04:12:07 -04:00
send-pack.c send-pack: move core code to libgit.a 2012-10-29 03:08:30 -04:00
shortlog.c i18n: shortlog: mark parseopt strings for translation 2012-08-20 12:23:20 -07:00
show-branch.c i18n: show-branch: mark parseopt strings for translation 2012-08-22 10:58:28 -07:00
show-ref.c Merge branch 'jk/peel-ref' 2012-10-25 06:42:27 -04:00
stripspace.c
symbolic-ref.c git symbolic-ref --delete $symref 2012-10-21 12:17:38 -07:00
tag.c Reduce translations by using same terminologies 2012-08-22 12:02:28 -07:00
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c Merge branch 'kb/preload-index-more' 2012-11-20 10:32:10 -08:00
update-ref.c Use imperative form in help usage to describe an action 2012-08-22 12:02:28 -07:00
update-server-info.c i18n: update-server-info: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
upload-archive.c
var.c
verify-pack.c i18n: verify-pack: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
verify-tag.c i18n: verify-tag: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
write-tree.c i18n: write-tree: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00