summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Rename resolve_ref() to resolve_ref_unsafe()nd/resolve-refNguyễn Thái Ngọc Duy2011-12-1313-26/+26
| | | | | | | | | | | | | | | | resolve_ref() may return a pointer to a shared buffer and can be overwritten by the next resolve_ref() calls. Callers need to pay attention, not to keep the pointer when the next call happens. Rename with "_unsafe" suffix to warn developers (or reviewers) before introducing new call sites. This patch is generated using the following command git grep -l 'resolve_ref(' -- '*.[ch]'|xargs sed -i 's/resolve_ref(/resolve_ref_unsafe(/g' Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Convert resolve_ref+xstrdup to new resolve_refdup functionNguyễn Thái Ngọc Duy2011-12-1312-50/+47
| | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* revert: convert resolve_ref() to read_ref_full()Nguyễn Thái Ngọc Duy2011-12-121-1/+1
| | | | | | | | | This is the follow up of c689332 (Convert many resolve_ref() calls to read_ref*() and ref_exists() - 2011-11-13). See the said commit for rationale. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update draft release notes for 1.7.9Junio C Hamano2011-12-091-1/+36
| | | | | | The first two of more important topics slated for 1.7.9 have been merged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'sg/complete-refs'Junio C Hamano2011-12-091-91/+110
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sg/complete-refs: completion: remove broken dead code from __git_heads() and __git_tags() completion: fast initial completion for config 'remote.*.fetch' value completion: improve ls-remote output filtering in __git_refs_remotes() completion: query only refs/heads/ in __git_refs_remotes() completion: support full refs from remote repositories completion: improve ls-remote output filtering in __git_refs() completion: make refs completion consistent for local and remote repos completion: optimize refs completion completion: document __gitcomp() Conflicts: contrib/completion/git-completion.bash
| * completion: remove broken dead code from __git_heads() and __git_tags()sg/complete-refsSZEDER Gábor2011-10-211-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __git_heads() was introduced in 5de40f5 (Teach bash about git-repo-config., 2006-11-27), and __git_tags() in 88e21dc (Teach bash about completing arguments for git-tag, 2007-08-31). As their name suggests, __git_heads() is supposed to list only branches, and __git_tags() only tags. Since their introduction both of these functions consist of two distinct parts. The first part gets branches or tags, respectively, from a local repositoty using 'git for-each-ref'. The second part queries a remote repository given as argument using 'git ls-remote'. These remote-querying parts are broken in both functions since their introduction, because they list both branches and tags from the remote repository. (The 'git ls-remote' query is not limited to list only heads or tags, respectively, and the for loop filtering the query results prints everything except dereferenced tags.) This breakage could be easily fixed by passing the '--heads' or '--tags' options or appropriate refs patterns to the 'git ls-remote' invocations. However, that no one noticed this breakage yet is probably not a coincidence: neither of these two functions were used to query a remote repository, the remote-querying parts were dead code already upon thier introduction and remained dead ever since. Since those parts of code are broken, are and were never used, stop the bit-rotting and remove them. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: fast initial completion for config 'remote.*.fetch' valueSZEDER Gábor2011-10-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refspecs for branches in a remote repository start with 'refs/heads/', so completing those refspecs with 'git config remote.origin.fetch <TAB>' always offers 'refs/heads/' first, because that's the unique part of the possible refspecs. But it does so only after querying the remote with 'git ls-remote', which can take a while when the request goes through some slower network to a remote server. Don't waste the user's time and offer 'refs/heads/' right away for 'git config remote.origin.fetch <TAB>'. The reason for putting 'refs/heads/' directly into COMPREPLY instead of using __gitcomp() is to avoid __gitcomp() adding a trailing space. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: improve ls-remote output filtering in __git_refs_remotes()SZEDER Gábor2011-10-211-9/+4
| | | | | | | | | | | | | | | | | | This follows suit of a previous patch for __git_refs(): use a while-read loop and let bash's word splitting get rid of object names from 'git ls-remote's output. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: query only refs/heads/ in __git_refs_remotes()SZEDER Gábor2011-10-211-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __git_refs_remotes() is used to provide completion for refspecs to set 'remote.*.fetch' config variables for branches on the given remote. So it's really only interested in refs under 'refs/heads/', but it queries the remote for all its refs and then filters out all refs outside of 'refs/heads/'. Let 'git ls-remote' do the filtering. Also remove the unused $cmd variable from __git_refs_remotes(). Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: support full refs from remote repositoriesSZEDER Gábor2011-10-211-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the __git_refs() completion helper function lists refs from a local repository, it usually lists the refs' short name, except when it needs to provide completion for words starting with refs, because in that case it lists full ref names, see 608efb87 (bash: complete full refs, 2008-11-28). Add the same functionality to the code path dealing with remote repositories, too. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: improve ls-remote output filtering in __git_refs()SZEDER Gábor2011-10-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The remote-handling part of __git_refs() has a nice for loop and state machine case statement to iterate over all words from the output of 'git ls-remote' to identify object names and ref names. Since each line in the output of 'git ls-remote' consists of an object name and a ref name, we can do more effective filtering by using a while-read loop and letting bash's word splitting take care of object names. This way the code is easier to understand and the loop will need only half the number of iterations than before. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: make refs completion consistent for local and remote reposSZEDER Gábor2011-10-211-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a local repository the __git_refs() completion helper function lists refs under 'refs/(tags|heads|remotes)/', plus some special refs like HEAD and ORIG_HEAD. For a remote repository, however, it lists all refs. Fix this inconsistency by specifying refs filter patterns for 'git ls-remote' to only list refs under 'refs/(tags|heads|remotes)/'. For now this makes it impossible to complete refs outside of 'refs/(tags|heads|remotes)/' in a remote repository, but a followup patch will resurrect that. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: optimize refs completionSZEDER Gábor2011-10-211-45/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a unique command or option is completed, in most cases it is a good thing to add a trailing a space, but sometimes it doesn't make sense, e.g. when the completed word is an option taking an argument ('--option=') or a configuration section ('core.'). Therefore the completion script uses the '-o nospace' option to prevent bash from automatically appending a space to unique completions, and it has the __gitcomp() function to add that trailing space only when necessary. See 72e5e989 (bash: Add space after unique command name is completed., 2007-02-04), 78d4d6a2 (bash: Support unique completion on git-config., 2007-02-04), and b3391775 (bash: Support unique completion when possible., 2007-02-04). __gitcomp() therefore iterates over all possible completion words it got as argument, and checks each word whether a trailing space is necessary or not. This is ok for commands, options, etc., i.e. when the number of words is relatively small, but can be noticeably slow for large number of refs. However, while options might or might not need that trailing space, refs are always handled uniformly and always get that trailing space (or a trailing '.' for 'git config branch.<head>.'). Since refs listed by __git_refs() & co. are separated by newline, this allows us some optimizations with 'compgen'. So, add a specialized variant of __gitcomp() that only deals with possible completion words separated by a newline and uniformly appends the trailing space to all words using 'compgen -S " "' (or any other suffix, if specified), so no iteration over all words is needed. But we need to fiddle with IFS, because the default IFS containing a space would cause the added space suffix to be stripped off when compgen's output is stored in the COMPREPLY array. Therefore we use only newline as IFS, hence the requirement for the newline-separated possible completion words. Convert all callsites of __gitcomp() where it's called with refs, i.e. when it gets the output of either __git_refs(), __git_heads(), __git_tags(), __git_refs2(), __git_refs_remotes(), or the odd 'git for-each-ref' somewhere in _git_config(). Also convert callsites where it gets other uniformly handled newline separated word lists, i.e. either remotes from __git_remotes(), names of set configuration variables from __git_config_get_set_variables(), stashes, or commands. Here are some timing results for dealing with 10000 refs. Before: $ refs="$(__git_refs ~/tmp/git/repo-with-10k-refs/)" $ time __gitcomp "$refs" real 0m1.134s user 0m1.060s sys 0m0.130s After: $ time __gitcomp_nl "$refs" real 0m0.373s user 0m0.360s sys 0m0.020s Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * completion: document __gitcomp()SZEDER Gábor2011-10-211-2/+7
| | | | | | | | | | | | | | | | I always forget which argument is which, and got tired of figuring it out over and over again. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'nd/resolve-ref'Junio C Hamano2011-12-0917-59/+98
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nd/resolve-ref: Copy resolve_ref() return value for longer use Convert many resolve_ref() calls to read_ref*() and ref_exists() Conflicts: builtin/fmt-merge-msg.c builtin/merge.c refs.c
| * | Copy resolve_ref() return value for longer useNguyễn Thái Ngọc Duy2011-12-058-28/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolve_ref() may return a pointer to a static buffer. Callers that use this value longer than a couple of statements should copy the value to avoid some hidden resolve_ref() call that may change the static buffer's value. The bug found by Tony Wang <wwwjfy@gmail.com> in builtin/merge.c demonstrates this. The first call is in cmd_merge() branch = resolve_ref("HEAD", head_sha1, 0, &flag); Then deep in lookup_commit_or_die() a few lines after, resolve_ref() may be called again and destroy "branch". lookup_commit_or_die lookup_commit_reference lookup_commit_reference_gently parse_object lookup_replace_object do_lookup_replace_object prepare_replace_object for_each_replace_ref do_for_each_ref get_loose_refs get_ref_dir get_ref_dir resolve_ref All call sites are checked and made sure that xstrdup() is called if the value should be saved. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Convert many resolve_ref() calls to read_ref*() and ref_exists()Nguyễn Thái Ngọc Duy2011-11-1312-32/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolve_ref() may return a pointer to a static buffer, which is not safe for long-term use because if another resolve_ref() call happens, the buffer may be changed. Many call sites though do not care about this buffer. They simply check if the return value is NULL or not. Convert all these call sites to new wrappers to reduce resolve_ref() calls from 57 to 34. If we change resolve_ref() prototype later on to avoid passing static buffer out, this helps reduce changes. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/pull-signed-tag'Junio C Hamano2011-12-0983-406/+825
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/pull-signed-tag: commit-tree: teach -m/-F options to read logs from elsewhere commit-tree: update the command line parsing commit: teach --amend to carry forward extra headers merge: force edit and no-ff mode when merging a tag object commit: copy merged signed tags to headers of merge commit merge: record tag objects without peeling in MERGE_HEAD merge: make usage of commit->util more extensible fmt-merge-msg: Add contents of merged tag in the merge message fmt-merge-msg: package options into a structure fmt-merge-msg: avoid early returns refs DWIMmery: use the same rule for both "git fetch" and others fetch: allow "git fetch $there v1.0" to fetch a tag merge: notice local merging of tags and keep it unwrapped fetch: do not store peeled tag object names in FETCH_HEAD Split GPG interface into its own helper library Conflicts: builtin/fmt-merge-msg.c builtin/merge.c
| * | | commit-tree: teach -m/-F options to read logs from elsewhereJunio C Hamano2011-11-122-6/+53
| | | | | | | | | | | | | | | | | | | | | | | | Just like "git commit" does. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | commit-tree: update the command line parsingJunio C Hamano2011-11-091-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have kept the original "git commit-tree <tree> -p <parent> ..." syntax forever, but "git commit-tree -p <parent> -p <parent> ... <tree>" would be more intuitive way to spell it. Dashed flags along with their arguments come first and then the "thing" argument after the flags. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | commit: teach --amend to carry forward extra headersJunio C Hamano2011-11-093-3/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After running "git pull $there for-linus" to merge a signed tag, the integrator may need to amend the resulting merge commit to fix typoes in it. Teach --amend option to read the existing extra headers, and carry them forward. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: force edit and no-ff mode when merging a tag objectJunio C Hamano2011-11-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we allow pulling a tag from the remote site to validate the authenticity, we should give the user the final chance to verify and edit the merge message. The integrator is expected to leave a meaningful merge commit log in the history. Disallow fast-forwarding in such a case to ensure that a merge commit is always recorded. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | commit: copy merged signed tags to headers of merge commitJunio C Hamano2011-11-093-11/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now MERGE_HEAD records the tag objects without peeling, we could record the result of manual conflict resolution via "git commit" without losing the tag information. Introduce a new "mergetag" multi-line header field to the commit object, and use it to store the entire contents of each signed tag merged. A commit header that has a multi-line payload begins with the header tag (e.g. "mergetag" in this case), SP, the first line of payload, LF, and all the remaining lines have a SP inserted at the beginning. In hindsight, it would have been better to make "merge --continue" as the way to continue from such an interrupted merge, not "commit", but this is a backward compatibility baggage we would need to carry around for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: record tag objects without peeling in MERGE_HEADJunio C Hamano2011-11-082-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, "git commit" wouldn't have a way to tell that we were in the middle of merging an annotated or signed tag, not a plain commit, after "git merge" stops to ask the user to resolve conflicts. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: make usage of commit->util more extensibleJunio C Hamano2011-11-084-47/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The merge-recursive code uses the commit->util field directly to annotate the commit objects given from the command line, i.e. the remote heads to be merged, with a single string to be used to describe it in its trace messages and conflict markers. Correct this short-signtedness by redefining the field to be a pointer to a structure "struct merge_remote_desc" that later enhancements can add more information. Store the original objects we were told to merge in a field "obj" in this struct, so that we can recover the tag we were told to merge. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: Add contents of merged tag in the merge messageJunio C Hamano2011-11-083-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a contributor asks the integrator to merge her history, a signed tag can be a good vehicle to communicate the authenticity of the request while conveying other information such as the purpose of the topic. E.g. a signed tag "for-linus" can be created, and the integrator can run: $ git pull git://example.com/work.git/ for-linus This would allow the integrator to run "git verify-tag FETCH_HEAD" to validate the signed tag. Update fmt-merge-msg so that it pre-fills the merge message template with the body (but not signature) of the tag object to help the integrator write a better merge message, in the same spirit as the existing merge.log summary lines. The message that comes from GPG signature validation is also included in the merge message template to help the integrator verify it, but they are prefixed with "#" to make them comments. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: package options into a structureJunio C Hamano2011-11-073-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | This way new features can be added more easily Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fmt-merge-msg: avoid early returnsJunio C Hamano2011-11-071-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In various places in the codepath, the program tries to return early assuming there is no more work needed. That is generally untrue when over time new features are added. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | refs DWIMmery: use the same rule for both "git fetch" and othersJunio C Hamano2011-11-073-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git log frotz" can DWIM to "refs/remotes/frotz/HEAD", but in the remote access context, "git fetch frotz" to fetch what the other side happened to have fetched from what it calls 'frotz' (which may not have any relation to what we consider is 'frotz') the last time would not make much sense, so the fetch rules table did not include "refs/remotes/%.*s/HEAD". When the user really wants to, "git fetch $there remotes/frotz/HEAD" would let her do so anyway, so this is not about safety or security; it merely is about confusion avoidance and discouraging meaningless usage. Specifically, it is _not_ about ambiguity avoidance. A name that would become ambiguous if we use the same rules table for both fetch and local rev-parse would be ambiguous locally at the remote side. So for the same reason as we added rule to allow "git fetch $there v1.0" instead of "git fetch $there tags/v1.0" in the previous commit, here is a bit longer rope for the users, which incidentally simplifies our code. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fetch: allow "git fetch $there v1.0" to fetch a tagJunio C Hamano2011-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | You can already do so with "git fetch $there tags/v1.0" but if it is not ambiguous there is no reason to force users to type more. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | merge: notice local merging of tags and keep it unwrappedJunio C Hamano2011-11-075-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This also updates the autogenerated merge title message from "merge commit X" to "merge tag X", and its effect can be seen in the changes to the test suite. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fetch: do not store peeled tag object names in FETCH_HEADLinus Torvalds2011-11-0459-176/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not want to record tags as parents of a merge when the user does "git pull $there tag v1.0" to merge tagged commit, but that is not a good enough excuse to peel the tag down to commit when storing in FETCH_HEAD. The caller of underlying "git fetch $there tag v1.0" may have other uses of information contained in v1.0 tag in mind. [jc: the test adjustment is to update for the new expectation] Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Split GPG interface into its own helper libraryJunio C Hamano2011-11-046-100/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly moves existing code from builtin/tag.c (for signing) and builtin/verify-tag.c (for verifying) to a new gpg-interface.c file to provide a more generic library interface. - sign_buffer() takes a payload strbuf, a signature strbuf, and a signing key, runs "gpg" to produce a detached signature for the payload, and appends it to the signature strbuf. The contents of a signed tag that concatenates the payload and the detached signature can be produced by giving the same strbuf as payload and signature strbuf. - verify_signed_buffer() takes a payload and a detached signature as <ptr, len> pairs, and runs "gpg --verify" to see if the payload matches the signature. It can optionally capture the output from GPG to allow the callers to pretty-print it in a way more suitable for their contexts. "verify-tag" (aka "tag -v") used to save the whole tag contents as if it is a detached signature, and fed gpg the payload part of the tag. It relied on gpg to fail when the given tag is not signed but just is annotated. The updated run_gpg_verify() function detects the lack of detached signature in the input, and errors out without bothering "gpg". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/request-pull-show-head-4'Junio C Hamano2011-12-0912-59/+313
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/request-pull-show-head-4: request-pull: use the annotated tag contents fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error environment.c: Fix an sparse "symbol not declared" warning builtin/log.c: Fix an "Using plain integer as NULL pointer" warning fmt-merge-msg: use branch.$name.description request-pull: use the branch description request-pull: state what commit to expect request-pull: modernize style branch: teach --edit-description option format-patch: use branch description in cover letter branch: add read_branch_desc() helper function Conflicts: builtin/branch.c
| * | | | request-pull: use the annotated tag contentsJunio C Hamano2011-11-092-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The integrator tool will start allowing to pull a signed or an annotated tag, i.e. $ git pull $there tags/for-linus and the description in the tag is used to convey a meaningful message from the lieutenant to the integrator to justify the history being pulled. Include the message in the pull request e-mail, as the same information is useful in this context, too. It would encourage the lieutenants to write meaningful messages in their signed tags. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse errorRamsay Jones2011-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | environment.c: Fix an sparse "symbol not declared" warningRamsay Jones2011-10-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, sparse issues the following warning: environment.c:62:5: warning: symbol 'merge_log_config' was not \ declared. Should it be static? In order to supress the warning, we include the "fmt-merge-msg.h" header file, since it contains an appropriate extern declaration for the 'merge_log_config' variable. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | builtin/log.c: Fix an "Using plain integer as NULL pointer" warningRamsay Jones2011-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | fmt-merge-msg: use branch.$name.descriptionJunio C Hamano2011-10-075-26/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches "merge --log" and fmt-merge-msg to use branch description information when merging a local topic branch into the mainline. The description goes between the branch name label and the list of commit titles. The refactoring to share the common configuration parsing between merge and fmt-merge-msg needs to be made into a separate patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | request-pull: use the branch descriptionJunio C Hamano2011-10-051-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have branch descriptions stored in the repository, we can use it when preparing the request-pull message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | request-pull: state what commit to expectJunio C Hamano2011-10-052-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message gives a detailed explanation of the commit the requester based the changes on, but lacks information that is necessary for the person who performs a fetch & merge in order to verify that the correct branch was fetched when responding to the pull request. Add a few more lines to describe the commit at the tip expected to be fetched to the same level of detail as the base commit. Also update the warning message slightly when the script notices that the commit may not have been pushed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | request-pull: modernize styleJunio C Hamano2011-10-051-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it a bit more conforming to Documentation/Codingstyle Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | branch: teach --edit-description optionJunio C Hamano2011-10-052-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using branch.$name.description as the configuration key, give users a place to write about what the purpose of the branch is and things like that, so that various subsystems, e.g. "push -s", "request-pull", and "format-patch --cover-letter", can later be taught to use this information. The "-m" option similar to "commit/tag" is deliberately omitted, as the whole point of branch description is about giving descriptive information (the name of the branch itself is a better place for information that fits on a single-line). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | format-patch: use branch description in cover letterJunio C Hamano2011-10-051-3/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the description for the branch when preparing the cover letter when available. While at it, mark a loosely written codepath that would do a random and useless thing given an unusual input (e.g. "^master HEAD HEAD^"), which we may want to fix someday. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | branch: add read_branch_desc() helper functionJunio C Hamano2011-10-052-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used by various callers that make use of the branch description throughout the system, so that if we need to update the implementation the callers do not have to be modified. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Merge branch 'bk/ancestry-path' into jc/branch-descJunio C Hamano2011-09-213-10/+101
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bk/ancestry-path: t6019: avoid refname collision on case-insensitive systems revision: do not include sibling history in --ancestry-path output revision: keep track of the end-user input from the command line rev-list: Demonstrate breakage with --ancestry-path --all
* | \ \ \ \ Merge branch 'ab/pull-rebase-config'Junio C Hamano2011-12-094-7/+42
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ab/pull-rebase-config: pull: introduce a pull.rebase option to enable --rebase
| * | | | | | pull: introduce a pull.rebase option to enable --rebaseab/pull-rebase-configÆvar Arnfjörð Bjarmason2011-11-074-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we either need to set branch.<name>.rebase for existing branches if we'd like "git pull" to mean "git pull --rebase", or have the forethought of setting "branch.autosetuprebase" before we create the branch. Introduce a "pull.rebase" option to globally configure "git pull" to mean "git pull --rebase" for any branch. This option will be considered at a lower priority than branch.<name>.rebase, i.e. we could set pull.rebase=true and branch.<name>.rebase=false and the latter configuration option would win. Reviewed-by: Sverre Rabbelier <srabbelier@gmail.com> Reviewed-by: Fernando Vezzosi <buccia@repnz.net> Reviewed-by: Eric Herman <eric@freesa.org> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Liked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'rs/allocate-cache-entry-individually'Junio C Hamano2011-12-092-53/+33
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/allocate-cache-entry-individually: cache.h: put single NUL at end of struct cache_entry read-cache.c: allocate index entries individually Conflicts: read-cache.c
| * | | | | | | cache.h: put single NUL at end of struct cache_entryrs/allocate-cache-entry-individuallyRené Scharfe2011-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since in-memory index entries are allocated individually now, the variable slack at the end meant to provide an eight byte alignment is not needed anymore. Have a single NUL instead. This saves zero to seven bytes for an entry, depending on its filename length. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>