1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-14 21:23:03 +01:00
git/Documentation
Jeff King 9e3751d443 remote.c: drop "remote" pointer from "struct branch"
When we create each branch struct, we fill in the
"remote_name" field from the config, and then fill in the
actual "remote" field (with a "struct remote") based on that
name. However, it turns out that nobody really cares about
the latter field. The only two sites that access it at all
are:

  1. git-merge, which uses it to notice when the branch does
     not have a remote defined. But we can easily replace this
     with looking at remote_name instead.

  2. remote.c itself, when setting up the @{upstream} merge
     config. But we don't need to save the "remote" in the
     "struct branch" for that; we can just look it up for
     the duration of the operation.

So there is no need to have both fields; they are redundant
with each other (the struct remote contains the name, or you
can look up the struct from the name). It would be nice to
simplify this, especially as we are going to add matching
pushremote config in a future patch (and it would be nice to
keep them consistent).

So which one do we keep and which one do we get rid of?

If we had a lot of callers accessing the struct, it would be
more efficient to keep it (since you have to do a lookup to
go from the name to the struct, but not vice versa). But we
don't have a lot of callers; we have exactly one, so
efficiency doesn't matter. We can decide this based on
simplicity and readability.

And the meaning of the struct value is somewhat unclear. Is
it always the remote matching remote_name? If remote_name is
NULL (i.e., no per-branch config), does the struct fall back
to the "origin" remote, or is it also NULL? These questions
will get even more tricky with pushremotes, whose fallback
behavior is more complicated. So let's just store the name,
which pretty clearly represents the branch.*.remote config.
Any lookup or fallback behavior can then be implemented in
helper functions.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-21 10:48:10 -07:00
..
howto Documentation: typofixes 2014-11-04 13:14:44 -08:00
RelNotes Git 2.4.0-rc0 2015-03-26 11:59:05 -07:00
technical remote.c: drop "remote" pointer from "struct branch" 2015-05-21 10:48:10 -07:00
.gitattributes
.gitignore
asciidoc.conf
blame-options.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
config.txt Merge branch 'jk/push-config' 2015-03-23 11:28:14 -07:00
date-formats.txt
diff-config.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
diff-format.txt diff-format doc: a score can follow M for rewrite 2015-01-28 22:22:03 -08:00
diff-generate-patch.txt
diff-options.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
docbook-xsl.css
docbook.xsl
everyday.txto doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
fetch-options.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
fix-texi.perl
git-add.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-am.txt Merge branch 'mm/am-c-doc' into maint 2015-03-06 14:57:56 -08:00
git-annotate.txt
git-apply.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-bisect.txt
git-blame.txt
git-branch.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-bundle.txt
git-cat-file.txt
git-check-attr.txt
git-check-ignore.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-check-mailmap.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt Merge branch 'mr/doc-clean-f-f' into maint 2015-03-13 22:56:12 -07:00
git-clone.txt clone: --dissociate option to mark that reference is only temporary 2014-10-15 14:34:45 -07:00
git-column.txt
git-commit-tree.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-commit.txt Merge branch 'nd/config-doc-camelCase' 2015-03-23 11:28:12 -07:00
git-config.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt docs/credential-store: s/--store/--file/ 2014-11-06 09:51:08 -08:00
git-credential.txt
git-cvsexportcommit.txt
git-cvsimport.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-cvsserver.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt difftool: add support for --trust-exit-code 2014-10-28 10:36:57 -07:00
git-fast-export.txt Merge branch 'mh/doc-remote-helper-xref' 2014-11-19 13:47:56 -08:00
git-fast-import.txt doc: add some crossrefs between manual pages 2014-11-11 14:47:04 -08:00
git-fetch-pack.txt
git-fetch.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-filter-branch.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-fmt-merge-msg.txt
git-for-each-ref.txt
git-format-patch.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-fsck-objects.txt
git-fsck.txt
git-gc.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-get-tar-commit-id.txt
git-grep.txt
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt imap-send: use cURL automatically when NO_OPENSSL defined 2015-03-10 15:19:05 -07:00
git-index-pack.txt
git-init-db.txt
git-init.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-instaweb.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-interpret-trailers.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-log.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt git-mailinfo: add --message-id 2014-11-25 15:24:55 -08:00
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt builtin/notes: add --allow-empty, to allow storing empty notes 2014-11-12 11:00:11 -08:00
git-p4.txt git-p4: support excluding paths on sync 2015-02-11 13:38:29 -08:00
git-pack-objects.txt pack-objects: use --objects-edge-aggressive for shallow repos 2014-12-29 09:58:25 -08:00
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-prune-packed.txt Documentation: adjust document title underlining 2014-10-13 13:35:18 -07:00
git-prune.txt
git-pull.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-push.txt Merge branch 'jk/push-config' 2015-03-23 11:28:14 -07:00
git-quiltimport.txt Documentation: adjust document title underlining 2014-10-13 13:35:18 -07:00
git-read-tree.txt
git-rebase.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-receive-pack.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-reflog.txt reflog_expire(): ignore --updateref for symbolic references 2015-03-05 12:35:37 -08:00
git-relink.txt
git-remote-ext.txt doc: add some crossrefs between manual pages 2014-11-11 14:47:04 -08:00
git-remote-fd.txt doc: add some crossrefs between manual pages 2014-11-11 14:47:04 -08:00
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt Merge branch 'mg/doc-remote-tags-or-not' into maint 2015-03-13 22:56:05 -07:00
git-repack.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-replace.txt
git-request-pull.txt
git-rerere.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-reset.txt
git-rev-list.txt rev-list: add an option to mark fewer edges as uninteresting 2014-12-29 09:57:55 -08:00
git-rev-parse.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-revert.txt
git-rm.txt
git-send-email.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-send-pack.txt send-pack.c: add --atomic command line argument 2015-01-07 19:56:44 -08:00
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-stage.txt Documentation: adjust document title underlining 2014-10-13 13:35:18 -07:00
git-stash.txt
git-status.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-stripspace.txt Documentation/git-stripspace: add synopsis for --comment-lines 2014-12-04 14:18:30 -08:00
git-submodule.txt submodule: improve documentation of update subcommand 2015-03-02 14:59:55 -08:00
git-svn.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
git-symbolic-ref.txt
git-tag.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt Merge branch 'po/doc-assume-unchanged' 2014-12-22 12:27:38 -08:00
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-commit.txt
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt
git-write-tree.txt
git.txt Merge branch 'nd/doc-git-index-version' 2015-03-25 12:54:28 -07:00
gitattributes.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
gitcli.txt
gitcore-tutorial.txt doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
gitcredentials.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
gitcvs-migration.txt doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
gitdiffcore.txt
giteveryday.txt doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
gitglossary.txt doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
githooks.txt receive-pack: support push-to-checkout hook 2015-01-08 14:28:43 -08:00
gitignore.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
gitk.txt
gitmodules.txt submodule: improve documentation of update subcommand 2015-03-02 14:59:55 -08:00
gitnamespaces.txt
gitremote-helpers.txt doc: add some crossrefs between manual pages 2014-11-11 14:47:04 -08:00
gitrepository-layout.txt
gitrevisions.txt
gittutorial-2.txt Merge branch 'sn/tutorial-status-output-example' 2014-11-19 13:47:59 -08:00
gittutorial.txt Merge branch 'sn/tutorial-status-output-example' 2014-11-19 13:47:59 -08:00
gitweb.conf.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
gitweb.txt
gitworkflows.txt
glossary-content.txt Documentation: typofixes 2014-11-04 13:14:44 -08:00
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
line-range-format.txt
mailmap.txt
Makefile Documentation: fix version numbering 2015-01-22 13:44:14 -08:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
merge-options.txt
merge-strategies.txt
pretty-formats.txt Merge branch 'bc/asciidoc-pretty-formats-fix' into maint 2014-10-29 10:35:10 -07:00
pretty-options.txt "log --pretty" documentation: do not forget "tformat:" 2015-01-15 17:38:58 -08:00
pull-fetch-param.txt
rev-list-options.txt Merge branch 'dj/log-graph-with-no-walk' 2015-03-25 12:54:22 -07:00
revisions.txt
sequencer.txt
SubmittingPatches Merge branch 'jc/submitting-patches-mention-send-email' 2015-03-25 12:54:23 -07:00
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00