* Re: pretty placeholders for reflog entries
From: Jeff King @ 2011-11-07 21:13 UTC (permalink / raw)
To: Jack Nagel; +Cc: git
In-Reply-To: <CAMYxyaWPWVGUHz0qQOnARb9wexHCx73a04Bu_UhrJR=xrinX7g@mail.gmail.com>
On Sun, Nov 06, 2011 at 11:49:48PM -0600, Jack Nagel wrote:
> I have the reflog enabled on a bare repo so that I can have a record of
> "who pushed what, when". I'd like to define a custom pretty format for
> use with "git log -g" for reading it, but unfortunately the placeholders
> for reflog information are somewhat limited. In particular, I'd like to
> be able to access the identity (i.e., name and email) and date from each
> reflog entry.
>
> Is it possible to extract this information in current git? Perhaps I
> overlooked something.
Sorry, but there aren't convenient placeholders for that. There probably
should be.
As a workaround, you can get the reflog selector ("%gD"), and then
cross-reference it with the output of "git log -g". But obviously that's
inefficient and a giant pain. We really should have "%gn" and "%ge" for
the reflog name and email. And related date options, though annoyingly
"%gd" is already taken for the default format.
I doubt it would be a very big patch. Want to get your feet wet in git
development? :)
-Peff
^ permalink raw reply
* Re: [RFC/PATCH] remote: add new sync command
From: Jeff King @ 2011-11-07 21:01 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git
In-Reply-To: <CAMP44s0M-qnZeHCUadSJJCYO=t881sUOi11G3fCG2vaAakPyBQ@mail.gmail.com>
On Mon, Nov 07, 2011 at 10:51:10PM +0200, Felipe Contreras wrote:
> > What I don't understand is why it is not:
> >
> > git push --mirror <URL|remote>
>
> Because that pushes *everything*.
Ahh, I think I see. It is doing --mirror, but only on a reduced refspec?
In that case, is there a reason that:
git push --prune <URL|remote> refs/heads/*
would not do what you want (note that "--prune" does not exist, but I
think it should).
> > That's what I don't understand from your proposal. Your command is just
> > pushing something to the remote, right? Why isn't "push" the command,
> > and your sync options become options to push?
>
> How exactly? --sync-prune, --sync-new, --sync-all? But actually, I was
> thinking on adding an option to sync the other way around; to get all
> the remote branches and have them locally.
If I understand correctly, you have three modes:
1. update remote refs with local values, prune anything remote that we
don't have locally (--sync-prune)
2. update remote refs with local values, including pushing anything
new that we don't have locally (--sync-new)
3. push new and prune (i.e., 1 and 2 together)
If we had "git push --prune" as above, those would be:
1. git push --prune <remote> :
I.e., use the "matching" refspec to not push new things, but turn
on pruning.
2. git push <remote> refs/heads/*
Turn off pruning, but use an explicit refspec, not just "matching",
which will push all local branches.
3. git push --prune <remote> refs/heads/*
Turn on both features.
> Well, I usually have quite a lot of branches in my local repositories,
> like a dozen of so. And I like to back them up in some remote
> repository, however, not all the branches all the time. git push
> --mirror not only pushes branches, but also tags (and I don't want
> that), and even other refs. Does that clarifies things?
That makes sense. But I think it fits in with git's current UI to do
this via a combination of push options and refspecs. Even if we want to
wrap it in some "git remote" command for convenience, I think what
you're asking should be implemented as part of "git push".
-Peff
^ permalink raw reply
* Re: [RFC/PATCH] remote: add new sync command
From: Felipe Contreras @ 2011-11-07 20:51 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20111107183938.GA5155@sigill.intra.peff.net>
On Mon, Nov 7, 2011 at 8:39 PM, Jeff King <peff@peff.net> wrote:
> On Mon, Nov 07, 2011 at 08:35:07PM +0200, Felipe Contreras wrote:
>
>> I don't know, seems logical to me what 'git remote sync' does, but
>> 'git push sync'? That sounds weird, and there are no 'git push foo'
>> commands.
>
> What I don't understand is why it is not:
>
> git push --mirror <URL|remote>
Because that pushes *everything*.
>> > And how does this differ from "git push --mirror"? It looks like you
>> > have more options for what pushing all versus pruning, but wouldn't it
>> > be better for "git push" to grow those options?
>>
>> But how? --mirror is just an option, I want a separate command, with
>> it's own options.
>
> That's what I don't understand from your proposal. Your command is just
> pushing something to the remote, right? Why isn't "push" the command,
> and your sync options become options to push?
How exactly? --sync-prune, --sync-new, --sync-all? But actually, I was
thinking on adding an option to sync the other way around; to get all
the remote branches and have them locally.
> Can you step back and describe the problem you're trying to solve? Maybe
> we're not connecting there.
Well, I usually have quite a lot of branches in my local repositories,
like a dozen of so. And I like to back them up in some remote
repository, however, not all the branches all the time. git push
--mirror not only pushes branches, but also tags (and I don't want
that), and even other refs. Does that clarifies things?
--
Felipe Contreras
^ permalink raw reply
* Re: BUG. Git config pager when --edit
From: Frans Klaver @ 2011-11-07 20:45 UTC (permalink / raw)
To: Junio C Hamano, Jeff King; +Cc: Alexey Shumkin, git
In-Reply-To: <20111107171800.GA3621@sigill.intra.peff.net>
On Mon, 07 Nov 2011 18:18:00 +0100, Jeff King <peff@peff.net> wrote:
>> I was actually hoping that you won't go that route, but the route to
>> push
>> further to decide/spawn pager as late as possible. Clearly no sane
>> person
>> would want to run --edit subcommand under pager and "pager.config =
>> less"
>> should just be ignored in such a case.
>
> The problem with that is that it dumps the responsibility for running
> the pager to every subcommand. For builtins, we can have a flag that
> says "respect the pager.log config" or "foo will handle this itself;
> don't respect pager.tag".
>
> But what about externals? If "pager.stash" does nothing in git.c, and
> leaves it to "git-stash.sh" to start the pager if and when it's
> appropriate, then what about my personal "git-foo" that I drop into my
> PATH? Now I can't use "config.foo" without carrying code to do so in my
> external command.
>
> Maybe that's an OK tradeoff. But it's more of a pain for existing
> scripts, and it's not backwards compatible. What do you think?
For both cases there's something to say. In any new design I might dump
the responsibility on the external, but I would prefer to keep the
decision logic centralized. But as I understand, removing the
responsibility from git.c is going to require a whole bunch of other
changes to get the pager functional again in the scripts. So if there is a
somewhat decent way to be sure about whether or not to use the pager (i.e.
no editing) in git.c, why not keep it there? If, on the other hand, the
code is going to turn out to be a big hack, I'd say move it out.
Frans
^ permalink raw reply
* Re: A Python script to put CTAN into git (from DVDs)
From: Jonathan Fine @ 2011-11-07 20:21 UTC (permalink / raw)
To: Jakub Narebski; +Cc: python-list, git
In-Reply-To: <m3zkg92dxq.fsf@localhost.localdomain>
On 06/11/11 20:28, Jakub Narebski wrote:
> Note that for gitPAN each "distribution" (usually but not always
> corresponding to single Perl module) is in separate repository.
> The dependencies are handled by CPAN / CPANPLUS / cpanm client
> (i.e. during install).
Thank you for your interest, Jakub, and also for this information. With
TeX there's a difficult which Perl, I think, does not have. With TeX we
process documents, which may demand specific versions of packages.
LaTeX users are concerned that move on to a later version will cause
documents to break.
> Putting all DVD (is it "TeX Live" DVD by the way?) into single
> repository would put quite a bit of stress to git; it was created for
> software development (although admittedly of large project like Linux
> kernel), not 4GB+ trees.
I'm impressed by how well git manages it. It took about 15 minutes to
build the 4GB tree, and it was disk speed rather than CPU which was the
bottleneck.
>> Once you've done that, it is then possible and sensible to select
>> suitable interesting subsets, such as releases of a particular
>> package. Users could even define their own subsets, such as "all
>> resources needed to process this file, exactly as it processes on my
>> machine".
>
> This could be handled using submodules, by having superrepository that
> consist solely of references to other repositories by the way of
> submodules... plus perhaps some administrativa files (like README for
> whole CTAN, or search tool, or DVD install, etc.)
>
> This could be the used to get for example contents of DVD from 2010.
We may be at cross purposes. My first task is get the DVD tree into
git, performing necessary transformations such as expanding zip files
along the way. Breaking the content into submodules can, I believe, be
done afterwards.
With DVDs from several years it could take several hours to load
everything into git. For myself, I'd like to do that once, more or less
as a batch process, and then move on to the more interesting topics.
Getting the DVD contents into git is already a significant piece of work.
Once done, I can them move on to what you're interested in, which is
organising the material. And I hope that others in the TeX community
will get involved with that, because I'm not building this repository
just for myself.
> But even though submodules (c.f. Subversion svn:external, Mecurial
> forest extension, etc.) are in Git for quite a bit of time, it doesn't
> have best user interface.
>
>> In addition, many TeX users have a TeX DVD. If they import it into a
>> git repository (using for example my script) then the update from 2011
>> to 2012 would require much less bandwidth.
>
> ???
A quick way to bring your TeX distribution up to date is to do a delta
with a later distribution, and download the difference. That's what git
does, and it does it well. So I'm keen to convert a TeX DVD into a git
repository, and then differences can be downloaded.
>> Finally, I'd rather be working within git that modified copy of the
>> ISO when doing the subsetting. I'm pretty sure that I can manage to
>> pull the small repositories from the big git-CTAN repository.
>
> No you cannot. It is all or nothing; there is no support for partial
> _clone_ (yet), and it looks like it is a hard problem.
>
> Nb. there is support for partial _checkout_, but this is something
> different.
From what I know, I'm confident that I can achieve what I want using
git. I'm also confident that my approach is not closing off any
possible approached. But if I'm wrong you'll be able to say: I told you so.
> Commit = tree + parent + metadata.
Actually, any number of parents, including none. What metadata do I
have to provide? At this time nothing, I think, beyond that provided by
the name of a reference (to the root of a tree).
> I think you would very much want to have linear sequence of trees,
> ordered via DAG of commits. "Naked" trees are rather bad idea, I think.
>
>> As I recall the first 'commit' to the git repository for the Linux
>> kernel was just a tree, with a reference to that tree as a tag. But
>> no commit.
>
> That was a bad accident that there is a tag that points directly to a
> tree of _initial import_, not something to copy.
Because git is a distributed version control system, anyone who wants to
can create such a directed acyclic graph of commits. And if it's useful
I'll gladly add it to my copy of the repository.
best regards
Jonathan
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Andreas Schwab @ 2011-11-07 20:13 UTC (permalink / raw)
To: Jeff King
Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
Jim Meyering, Fredrik Gustafsson
In-Reply-To: <20111107185536.GA5450@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I do still question the value of the check at all, though, given that
> static analysis can find those bugs.
Then you should remove the whole statement.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Jonathan Nieder @ 2011-11-07 19:49 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason
Cc: git, Junio C Hamano, Jim Meyering, Fredrik Gustafsson
In-Reply-To: <1320581184-4557-4-git-send-email-avarab@gmail.com>
Hi,
> --- a/grep.c
> +++ b/grep.c
> @@ -327,7 +327,7 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
> for (p = opt->header_list; p; p = p->next) {
> if (p->token != GREP_PATTERN_HEAD)
> die("bug: a non-header pattern in grep header list.");
> - if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
> + if (GREP_HEADER_FIELD_MAX <= p->field)
I imagine the following would be less controversial.
-- >8 --
From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Subject: grep: get rid of bounds check on "enum grep_header_field" value
The grep_header_field enum is defined as:
enum grep_header_field {
GREP_HEADER_AUTHOR = 0,
GREP_HEADER_COMMITTER
};
Git's grep code sanity-checks the value of p->field before using it in
order to avoid reading and writing past the end of an array.
Unfortunately that test trips up misguided static analyzers like
"gcc -Wtype-limits" that do not recognize that C allows this enum to
be a signed integer type and an "x < 0" comparison really could fire
if someone passed in an uninitialized value.
Let's just drop the check. Luckily git always does initialize
p->field correctly, and if it were to stop doing so, then hopefully
running the test suite with valgrind would catch it.
Noticed with clang -Wtautological-compare.
[jn: drop the GREP_HEADER_FIELD_MAX <= p->field check, too,
for symmetry]
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
grep.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/grep.c b/grep.c
index b29d09c7..424c46cd 100644
--- a/grep.c
+++ b/grep.c
@@ -327,8 +327,6 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
for (p = opt->header_list; p; p = p->next) {
if (p->token != GREP_PATTERN_HEAD)
die("bug: a non-header pattern in grep header list.");
- if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
- die("bug: unknown header field %d", p->field);
compile_regexp(p, opt);
}
--
1.7.8.rc0
^ permalink raw reply related
* Re: hook for rebase --continue
From: Martin Fick @ 2011-11-07 19:46 UTC (permalink / raw)
To: Matt Graham; +Cc: git
In-Reply-To: <CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com>
On Monday, November 07, 2011 12:42:32 pm Matt Graham wrote:
> Does anyone else share my expectation that the pre-commit
> hook should run during a rebase? Or at least for the
> first commit following a rebase conflict?
I have had the same concern. We use a change-id hook for
Gerrit development, and it adds a footer line to commit
messages. If during a rebase, it is accidentally removed,
the hook does not get run and does not re-add it,
-Martin
--
Employee of Qualcomm Innovation Center, Inc. which is a
member of Code Aurora Forum
^ permalink raw reply
* hook for rebase --continue
From: Matt Graham @ 2011-11-07 19:42 UTC (permalink / raw)
To: git
Hi,
I did some testing and it appears that during a rebase, if I resolve a
conflict and call git rebase --continue, the pre-commit hook doesn't
run. This means that if I don't resolve the conflict correctly, our
check for invalid syntax doesn't get run and creates the risk that
someone could push code with invalid syntax, not realizing that the
check didn't run.
Does anyone else share my expectation that the pre-commit hook should
run during a rebase? Or at least for the first commit following a
rebase conflict?
If not, is there another hook that is triggered by a rebase that I
should be using instead?
Thanks,
Matt
^ permalink raw reply
* Re: [PATCH 1/3] apply: get rid of useless x < 0 comparison on a size_t type
From: Giuseppe Bilotta @ 2011-11-07 19:09 UTC (permalink / raw)
To: Junio C Hamano
Cc: Ævar Arnfjörð, git, Jim Meyering,
Fredrik Gustafsson
In-Reply-To: <7vsjm15cap.fsf@alter.siamese.dyndns.org>
On Sun, Nov 6, 2011 at 7:35 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>> This check was originally added in v1.6.5-rc0~53^2 by Giuseppe Bilotta
>> while adding an option to git-apply to ignore whitespace differences.
>
> I agree that these quantities can never be negative, so I'll apply the
> patch as is.
I agree too. In fact I spotted this some time ago when I started
compiling git with Clang but never found the time to look into it.
> But I have this suspicion that this was a rather sloppy defensive check to
> protect this codepath against potential breakage in another codepath (most
> likely update_pre_post_images() touched by the same patch) that adjusts
> image->line[].len the caller of this function uses to feed these two
> parameters. Giuseppe may have been not confident enough that the code
> added to that function ensures not to undershoot when it reduces "len", or
> something.
>
> Giuseppe, can you explain what is going on?
No, I can't, so I guess the sloppy coding is the right motivation. I
remember working this patch from a rather older submission that was
never followed-up to, so my guess is that I just forgot to clean it up
properly, and during review the focus was obviously on other aspects
of the submission too. Also, having a look at the current caller of
the function, I don't see how the check would even be needed.
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: Is there a pdf git manual?
From: Peng Yu @ 2011-11-07 19:07 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <m3obwn3gtz.fsf@localhost.localdomain>
Hi Jakub,
> "make pdf" would generate PDF version of (some of) documentation.
I get the pdf generated. When you say 'some of", what is missing from the pdf?
--
Regards,
Peng
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Ævar Arnfjörð Bjarmason @ 2011-11-07 19:06 UTC (permalink / raw)
To: Jeff King
Cc: Andreas Schwab, git, Junio C Hamano, Jim Meyering,
Fredrik Gustafsson
In-Reply-To: <20111107185536.GA5450@sigill.intra.peff.net>
On Mon, Nov 7, 2011 at 19:55, Jeff King <peff@peff.net> wrote:
> I do still question the value of the check at all, though, given that
> static analysis can find those bugs.
Agreed, which is why I submitted this patch.
Also if this is the sort of thing we'd like to guard against we should
be discussing it more generally. We have a bunch of occurances where
we'd probably break down if someone manually assigned -1 to an enum
variable:
$ git grep -E -A1 'enum.*\{' | grep -B1 '=.*0' | grep enum
builtin/branch.c:enum color_branch {
builtin/branch.c:static enum merge_filter {
builtin/fetch-pack.c:enum ack_type {
builtin/fetch.c:enum {
builtin/grep.c: enum {
builtin/mv.c: enum update_mode { BOTH = 0, WORKING_DIRECTORY,
INDEX } *modes;
builtin/remote.c:enum {
builtin/remote.c: enum {
cache.h:enum rebase_setup_type {
cache.h:enum push_default_type {
cache.h:enum object_creation_mode {
cache.h:enum sharedrepo {
cache.h:enum date_mode {
cache.h: enum {
convert.h:enum safe_crlf {
convert.h:enum auto_crlf {
diff.h:enum diff_words_type {
diff.h:enum color_diff {
dir.c:enum exist_status {
dir.h: enum {
grep.h:enum grep_header_field {
http-push.c:enum dav_header_flag {
imap-send.c:enum CAPABILITY {
log-tree.c:enum decoration_type {
merge-recursive.c:enum rename_type {
merge-recursive.h: enum {
notes-merge.h: enum {
remote.h:enum match_refs_flags {
rerere.c: enum {
unpack-trees.h:enum unpack_trees_error_types {
wt-status.h:enum color_wt_status {
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Jeff King @ 2011-11-07 18:55 UTC (permalink / raw)
To: Andreas Schwab
Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
Jim Meyering, Fredrik Gustafsson
In-Reply-To: <20111107183402.GA5118@sigill.intra.peff.net>
On Mon, Nov 07, 2011 at 01:34:02PM -0500, Jeff King wrote:
> > The whole point of the statement is a sanity check to uncover bugs. If
> > you remove the first condition you completely ruin its point.
> [...]
> Yes, static analysis can miss some bugs (like passing the address of the
> enum through a void pointer (e.g., when memset'ing a struct)). But
> couldn't it just as easily be out of range in the other direction?
Oops, I just looked at the actual conditional, and it is indeed
range-checking the whole enum. So if you are going to do that at all,
then yes, checking both sides is sensible, and that is what the original
conditional does. Sorry for my confusion.
I do still question the value of the check at all, though, given that
static analysis can find those bugs.
-Peff
^ permalink raw reply
* Re: Is there a pdf git manual?
From: Jakub Narebski @ 2011-11-07 18:53 UTC (permalink / raw)
To: Peng Yu; +Cc: git
In-Reply-To: <CABrM6wkzV58WLnHkZ88y=MQVWjD8dwYMtG9HTto8t8QXBEW-hA@mail.gmail.com>
Peng Yu <pengyu.ut@gmail.com> writes:
> Hi,
>
> http://schacon.github.com/git/user-manual.html
>
> The manual is in html. I'm not able to find a pdf version. Running
> make in git/Documentation doesn't generate a pdf document
> automatically. Could anybody generated the pdf document and post it to
> the git project website? Thanks!
"make pdf" would generate PDF version of (some of) documentation.
--
Jakub Narębski
^ permalink raw reply
* Re: [PATCH v2] pull: introduce a pull.rebase option to enable --rebase
From: Ævar Arnfjörð Bjarmason @ 2011-11-07 18:48 UTC (permalink / raw)
To: Junio C Hamano
Cc: Johannes Sixt, git, Eric Herman, Sverre Rabbelier,
Fernando Vezzosi, Johannes Schindelin
In-Reply-To: <7v39dz3ms7.fsf@alter.siamese.dyndns.org>
On Mon, Nov 7, 2011 at 17:44, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Sun, Nov 6, 2011 at 20:53, Johannes Sixt <j6t@kdbg.org> wrote:
>>> When you continue an indented item in a separate paragraph, then you
>>> must not use an empty line, but have line with '+' and un-indented
>>> continuation paragraphs. See examples in this file.
>>
>> Thanks for spotting that.
>>
>> Junio: Should I spam you with another patch or is something you'd
>> prefer to just fix up?
>
> It is about the same amount of work for me; I've just dedented the two
> paragraphs that start with "*NOTE*:" and replaced the blank lines before
> them with a single "+". Is that what you wanted to resend, or is there
> anything else?
That should cover it, thanks!
^ permalink raw reply
* Re: [RFC/PATCH] remote: add new sync command
From: Jeff King @ 2011-11-07 18:39 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git
In-Reply-To: <CAMP44s358k4EsCg+K6MeLEU4eLbb4mWyX9AdAf4P9CHvf9Lrwg@mail.gmail.com>
On Mon, Nov 07, 2011 at 08:35:07PM +0200, Felipe Contreras wrote:
> I don't know, seems logical to me what 'git remote sync' does, but
> 'git push sync'? That sounds weird, and there are no 'git push foo'
> commands.
What I don't understand is why it is not:
git push --mirror <URL|remote>
> > And how does this differ from "git push --mirror"? It looks like you
> > have more options for what pushing all versus pruning, but wouldn't it
> > be better for "git push" to grow those options?
>
> But how? --mirror is just an option, I want a separate command, with
> it's own options.
That's what I don't understand from your proposal. Your command is just
pushing something to the remote, right? Why isn't "push" the command,
and your sync options become options to push?
Can you step back and describe the problem you're trying to solve? Maybe
we're not connecting there.
-Peff
^ permalink raw reply
* Re: [RFC/PATCH] remote: add new sync command
From: Felipe Contreras @ 2011-11-07 18:35 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20111107172218.GB3621@sigill.intra.peff.net>
On Mon, Nov 7, 2011 at 7:22 PM, Jeff King <peff@peff.net> wrote:
> On Mon, Nov 07, 2011 at 06:07:12PM +0200, Felipe Contreras wrote:
>
>> This is useful to mirror all the branches in the current repo to
>> another.
>> [...]
>> +'sync'::
>> +
>> +Synchronizes local branches with certain remote. This is useful to backup all
>> +the branches in a local repository to a remote one, regardless of what upstream
>> +is configured for each branch.
>> ++
>> +With `--prune`, remote branches will be deleted if they are not also locally.
>> ++
>> +With `--new`, local branches that are not yet in the remote will be pushed too.
>> ++
>> +With `--all`, basically both `--prune` and `--new` will be selected.
>> ++
>> +With `--force`, existing branches will be forced to update, like `git push
>> +--force`.
>> ++
>> +With `--dry-run`, all the changes will be reported, but not really happen.
>
> Why is this in "git remote", and not "git push"? The former is usually
> about managing the configuration of remotes, not about actually doing
> the ref transfer (the "-f" flag excepted, but that is clearly just
> calling out to "fetch").
I don't know, seems logical to me what 'git remote sync' does, but
'git push sync'? That sounds weird, and there are no 'git push foo'
commands.
> And how does this differ from "git push --mirror"? It looks like you
> have more options for what pushing all versus pruning, but wouldn't it
> be better for "git push" to grow those options?
But how? --mirror is just an option, I want a separate command, with
it's own options.
Cheers.
--
Felipe Contreras
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Jeff King @ 2011-11-07 18:34 UTC (permalink / raw)
To: Andreas Schwab
Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
Jim Meyering, Fredrik Gustafsson
In-Reply-To: <m2k47b4wqi.fsf@igel.home>
On Mon, Nov 07, 2011 at 07:24:05PM +0100, Andreas Schwab wrote:
> Jeff King <peff@peff.net> writes:
>
> > Yes, but now you are getting into implementation-defined behavior, which
> > is also something to avoid.
>
> The whole point of the statement is a sanity check to uncover bugs. If
> you remove the first condition you completely ruin its point.
I'm somewhat dubious of the value of a bug-check that may or may not
actually kick in depending on your compiler's choice of enum
representation, and whose bugs are generally easier to check via static
analysis (i.e., making sure the enum value is one of the enumerated
values when it is initialized or assigned).
Yes, static analysis can miss some bugs (like passing the address of the
enum through a void pointer (e.g., when memset'ing a struct)). But
couldn't it just as easily be out of range in the other direction?
It seems like the bug trying to be caught is probably something like:
enum foo v = function_which_returns_value_or_negative_error();
if (v < 0)
die("BUG");
But in that case the bug is on the first line, and it is easily caught
by static analysis, no?
-Peff
^ permalink raw reply
* Re: Is there a pdf git manual?
From: Tony Godshall @ 2011-11-07 18:29 UTC (permalink / raw)
To: Peng Yu; +Cc: git
In-Reply-To: <CABrM6wkzV58WLnHkZ88y=MQVWjD8dwYMtG9HTto8t8QXBEW-hA@mail.gmail.com>
CUPS-PDF is a free program
that will generate PDFs from
any document- it's as easy as
printing.
On Mon, Nov 7, 2011 at 9:24 AM, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> http://schacon.github.com/git/user-manual.html
>
> The manual is in html. I'm not able to find a pdf version. Running
> make in git/Documentation doesn't generate a pdf document
> automatically. Could anybody generated the pdf document and post it to
> the git project website? Thanks!
>
> --
> Regards,
> Peng
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Best Regards.
This is unedited.
^ permalink raw reply
* Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member
From: Andreas Schwab @ 2011-11-07 18:24 UTC (permalink / raw)
To: Jeff King
Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano,
Jim Meyering, Fredrik Gustafsson
In-Reply-To: <20111107163823.GB27055@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Yes, but now you are getting into implementation-defined behavior, which
> is also something to avoid.
The whole point of the statement is a sanity check to uncover bugs. If
you remove the first condition you completely ruin its point.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [PATCHv2] blame.c: Properly initialize strbuf after calling textconv_object(), again
From: Jeff King @ 2011-11-07 17:41 UTC (permalink / raw)
To: Sebastian Schuberth; +Cc: git, Junio C Hamano
In-Reply-To: <4EB8166E.9000703@gmail.com>
On Mon, Nov 07, 2011 at 06:33:34PM +0100, Sebastian Schuberth wrote:
> 2564aa4 started to initialize buf.alloc, but that should actually be one
> more byte than the string length due to the trailing \0. Also, do not
> modify buf.alloc out of the strbuf code. Use the existing strbuf_attach
> instead.
Heh. When I wrote the previous email I just made up the name
"strbuf_attach" as the opposite of "strbuf_detach". I didn't know it
actually already existed.
> - textconv_object(read_from, mode, null_sha1, &buf.buf, &buf_len)) {
> - buf.alloc = buf_len;
> - buf.len = buf_len;
> - }
> + textconv_object(read_from, mode, null_sha1, &buf_ptr, &buf_len))
> + strbuf_attach(&buf, buf_ptr, buf_len, buf_len + 1);
Looks OK to me.
-Peff
^ permalink raw reply
* [PATCHv2] blame.c: Properly initialize strbuf after calling textconv_object(), again
From: Sebastian Schuberth @ 2011-11-07 17:33 UTC (permalink / raw)
To: Jeff King; +Cc: git, Junio C Hamano
In-Reply-To: <20111107164946.GD27055@sigill.intra.peff.net>
2564aa4 started to initialize buf.alloc, but that should actually be one
more byte than the string length due to the trailing \0. Also, do not
modify buf.alloc out of the strbuf code. Use the existing strbuf_attach
instead.
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
builtin/blame.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index 86c0537..80febbe 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2096,6 +2096,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
if (!contents_from || strcmp("-", contents_from)) {
struct stat st;
const char *read_from;
+ char *buf_ptr;
unsigned long buf_len;
if (contents_from) {
@@ -2113,10 +2114,8 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
switch (st.st_mode & S_IFMT) {
case S_IFREG:
if (DIFF_OPT_TST(opt, ALLOW_TEXTCONV) &&
- textconv_object(read_from, mode, null_sha1, &buf.buf, &buf_len)) {
- buf.alloc = buf_len;
- buf.len = buf_len;
- }
+ textconv_object(read_from, mode, null_sha1, &buf_ptr, &buf_len))
+ strbuf_attach(&buf, buf_ptr, buf_len, buf_len + 1);
else if (strbuf_read_file(&buf, read_from, st.st_size) != st.st_size)
die_errno("cannot open or read '%s'", read_from);
break;
--
1.7.8.rc0.47.gf2c75.dirty
^ permalink raw reply related
* Re: [PATCH] blame.c: Properly initialize strbuf after calling textconv_object(), again
From: Sebastian Schuberth @ 2011-11-07 17:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy5vr282s.fsf@alter.siamese.dyndns.org>
On 07.11.2011 17:47, Junio C Hamano wrote:
>> 2564aa4 started to initialize buf.alloc, but that should actually be one
>> more byte than the string length due to the trailing \0.
>
> Even when the conversion result is a zero-length string?
In this case, yes. The string buffer is initialized (and detached) in
run_textconv, which calls strbuf_read, which grows the (yet empty)
string to 8192 bytes. So alloc is always > 0, and the detach will trim
alloc to len + 1.
However, Peff made another valid point and I'll send v2 soon.
--
Sebastian Schuberth
^ permalink raw reply
* Is there a pdf git manual?
From: Peng Yu @ 2011-11-07 17:24 UTC (permalink / raw)
To: git
Hi,
http://schacon.github.com/git/user-manual.html
The manual is in html. I'm not able to find a pdf version. Running
make in git/Documentation doesn't generate a pdf document
automatically. Could anybody generated the pdf document and post it to
the git project website? Thanks!
--
Regards,
Peng
^ permalink raw reply
* Re: [RFC/PATCH] remote: add new sync command
From: Jeff King @ 2011-11-07 17:22 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git
In-Reply-To: <1320682032-12698-1-git-send-email-felipe.contreras@gmail.com>
On Mon, Nov 07, 2011 at 06:07:12PM +0200, Felipe Contreras wrote:
> This is useful to mirror all the branches in the current repo to
> another.
> [...]
> +'sync'::
> +
> +Synchronizes local branches with certain remote. This is useful to backup all
> +the branches in a local repository to a remote one, regardless of what upstream
> +is configured for each branch.
> ++
> +With `--prune`, remote branches will be deleted if they are not also locally.
> ++
> +With `--new`, local branches that are not yet in the remote will be pushed too.
> ++
> +With `--all`, basically both `--prune` and `--new` will be selected.
> ++
> +With `--force`, existing branches will be forced to update, like `git push
> +--force`.
> ++
> +With `--dry-run`, all the changes will be reported, but not really happen.
Why is this in "git remote", and not "git push"? The former is usually
about managing the configuration of remotes, not about actually doing
the ref transfer (the "-f" flag excepted, but that is clearly just
calling out to "fetch").
And how does this differ from "git push --mirror"? It looks like you
have more options for what pushing all versus pruning, but wouldn't it
be better for "git push" to grow those options?
-Peff
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox