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 i18n: bisect--helper: mark parseopt strings for translation 2012-08-20 12:23:15 -07:00
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 Teach progress eye-candy to fetch_refs_from_bundle() 2011-09-19 11:07:21 -07:00
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 Change check_refname_format() to reject unnormalized refnames 2011-10-05 13:45:30 -07:00
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 i18n: clean: mark parseopt strings for translation 2012-08-20 12:23:16 -07:00
clone.c Merge branch 'rt/maint-clone-single' into maint 2012-10-08 11:34:02 -07:00
column.c i18n: column: mark parseopt strings for translation 2012-08-20 12:23:16 -07:00
commit-tree.c Merge branch 'kk/maint-commit-tree' 2012-07-23 20:55:54 -07:00
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 i18n: count-objects: mark parseopt strings for translation 2012-08-20 12:23:16 -07:00
credential.c git credential fill: output the whole 'struct credential' 2012-06-25 11:56:24 -07:00
describe.c Merge branch 'jk/peel-ref' 2012-10-25 06:42:27 -04:00
diff-files.c Convert struct diff_options to use struct pathspec 2011-02-03 12:28:15 -08:00
diff-index.c update-index/diff-index: use core.preloadindex to improve performance 2012-11-02 11:38:29 -04:00
diff-tree.c diffcore-rename: fall back to -C when -C -C busts the rename limit 2011-03-22 14:29:07 -07:00
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 i18n: fmt-merge-msg: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
for-each-ref.c Merge branch 'nd/i18n-parseopt-help' 2012-09-07 11:09:09 -07:00
fsck.c i18n: fsck: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
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 i18n: hash-object: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
help.c i18n: help: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
index-pack.c i18n: mark more index-pack strings for translation 2012-08-31 13:05:05 -07:00
init-db.c i18n: init-db: mark parseopt strings for translation 2012-08-20 12:23:17 -07:00
log.c log: honor grep.* configuration 2012-10-09 23:21:30 -07:00
ls-files.c i18n: ls-files: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
ls-remote.c ls-remote: document the '--get-url' option 2012-09-07 10:58:35 -07:00
ls-tree.c i18n: ls-tree: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
mailinfo.c Merge branch 'jc/same-encoding' 2012-11-15 10:24:05 -08:00
mailsplit.c Use parentheses and `...' where appropriate 2010-10-08 12:31:07 -07:00
merge-base.c Merge branch 'jc/merge-bases' 2012-09-11 11:36:05 -07:00
merge-file.c i18n: merge-file: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
merge-index.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-ours.c
merge-recursive.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-tree.c sparse: Fix an "symbol 'merge_file' not decared" warning 2011-04-11 10:35:25 -07:00
merge.c Move try_merge_command and checkout_fast_forward to libgit.a 2012-10-29 03:08:30 -04:00
mktag.c read_sha1_file(): get rid of read_sha1_file_repl() madness 2011-05-15 15:23:33 -07:00
mktree.c i18n: mktree: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
mv.c i18n: mv: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
name-rev.c i18n: name-rev: mark parseopt strings for translation 2012-08-20 12:23:18 -07:00
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 Fix sparse warnings 2011-03-22 10:16:54 -07:00
pack-refs.c i18n: pack-refs: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
patch-id.c patch-id.c: use strbuf instead of a fixed buffer 2011-09-22 09:35:07 -07:00
prune-packed.c i18n: prune-packed: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
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 i18n: read-tree: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
receive-pack.c Merge branch 'jk/receive-pack-unpack-error-to-pusher' 2012-10-01 12:58:34 -07:00
reflog.c reflog: remove i18n legos in pruning message 2012-06-07 11:49:16 -07:00
remote-ext.c Remove unused variables 2011-03-22 11:43:27 -07:00
remote-fd.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
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 i18n: rerere: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
reset.c i18n: reset: mark parseopt strings for translation 2012-08-20 12:23:19 -07:00
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 Update documentation for stripspace 2011-12-12 16:48:54 -08:00
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 Fix sparse warnings 2011-03-22 10:16:54 -07:00
unpack-objects.c remove superfluous newlines in error messages 2012-04-30 15:45:51 -07:00
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 upload-archive: use start_command instead of fork 2011-11-21 14:32:40 -08:00
var.c ident: rename IDENT_ERROR_ON_NO_NAME to IDENT_STRICT 2012-05-24 17:16:41 -07:00
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