* BUG. Git config pager when --edit
@ 2011-11-07 13:26 Alexey Shumkin
2011-11-07 13:43 ` Frans Klaver
2011-11-07 14:54 ` how to merge sub directory or file? Emily
0 siblings, 2 replies; 9+ messages in thread
From: Alexey Shumkin @ 2011-11-07 13:26 UTC (permalink / raw)
To: git
Hello!
I've found an annoying bug.
When I wanna review my config I run
$ git config --list
When I wanna edit config I run
$ git config --edit [--global]
As far as my config is large enough to be paged I set pager.config=less
setting. But since that moment when I run
$ git config --edit
I get
Vim: Warning: Output is not to a terminal
And some messed config output
The same happens if to run
$ vim .git/config | less
Can anybody skilled enough fix it? :)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: BUG. Git config pager when --edit
2011-11-07 13:26 BUG. Git config pager when --edit Alexey Shumkin
@ 2011-11-07 13:43 ` Frans Klaver
2011-11-07 16:42 ` Jeff King
2011-11-07 14:54 ` how to merge sub directory or file? Emily
1 sibling, 1 reply; 9+ messages in thread
From: Frans Klaver @ 2011-11-07 13:43 UTC (permalink / raw)
To: Alexey Shumkin; +Cc: git
Hi,
On Mon, Nov 7, 2011 at 2:26 PM, Alexey Shumkin <Alex.Crezoff@gmail.com> wrote:
> As far as my config is large enough to be paged I set pager.config=less
> setting. But since that moment when I run
> $ git config --edit
> I get
> Vim: Warning: Output is not to a terminal
> And some messed config output
>
> The same happens if to run
> $ vim .git/config | less
So git is trying to tell vim to pipe its output to less. vim can't do
that because it needs a terminal, as it's the only way vim is usable.
Should pager.config then only be used with --list?
^ permalink raw reply [flat|nested] 9+ messages in thread
* how to merge sub directory or file?
2011-11-07 13:26 BUG. Git config pager when --edit Alexey Shumkin
2011-11-07 13:43 ` Frans Klaver
@ 2011-11-07 14:54 ` Emily
2011-11-07 15:37 ` Konstantin Khomoutov
1 sibling, 1 reply; 9+ messages in thread
From: Emily @ 2011-11-07 14:54 UTC (permalink / raw)
To: git@vger.kernel.org
Hi,
I have two git projects A and B, content of B is subset of A. For example, Project A and B's tree are as below:
A
--- dir1
--- dir2
--- dir3
|---file1
|---dir4
|---dir5
--- dir6
--- dir7
B
--- dir1
--- dir3
|--- file1
|--- dir4
When there's new changes in project A, how can I merge them to project B without changing B's directory structure?
Your help will be highly appreciated.
Thanks,
Emily
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: how to merge sub directory or file?
2011-11-07 14:54 ` how to merge sub directory or file? Emily
@ 2011-11-07 15:37 ` Konstantin Khomoutov
2011-11-08 7:08 ` Emily Ren
0 siblings, 1 reply; 9+ messages in thread
From: Konstantin Khomoutov @ 2011-11-07 15:37 UTC (permalink / raw)
To: Emily; +Cc: git@vger.kernel.org
On Mon, 7 Nov 2011 22:54:18 +0800
Emily <lingyan.ren@gmail.com> wrote:
> I have two git projects A and B, content of B is subset of A. For
> example, Project A and B's tree are as below:
[...]
> When there's new changes in project A, how can I merge them to
> project B without changing B's directory structure?
>
> Your help will be highly appreciated.
Subtree merging maybe?
See http://progit.org/book/ch6-7.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: BUG. Git config pager when --edit
2011-11-07 13:43 ` Frans Klaver
@ 2011-11-07 16:42 ` Jeff King
2011-11-07 17:02 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2011-11-07 16:42 UTC (permalink / raw)
To: Frans Klaver; +Cc: Alexey Shumkin, git
On Mon, Nov 07, 2011 at 02:43:41PM +0100, Frans Klaver wrote:
> > As far as my config is large enough to be paged I set pager.config=less
> > setting. But since that moment when I run
> > $ git config --edit
> > I get
> > Vim: Warning: Output is not to a terminal
> > And some messed config output
> >
> > The same happens if to run
> > $ vim .git/config | less
>
> So git is trying to tell vim to pipe its output to less. vim can't do
> that because it needs a terminal, as it's the only way vim is usable.
>
> Should pager.config then only be used with --list?
Yes, but it can't, because it is not the config command, but the git
wrapper that respects "pager.config". We have similar issues with
setting "pager.tag" (you want it for listing, but not for tag creation)
and others.
I should probably polish and submit the patch here:
http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: BUG. Git config pager when --edit
2011-11-07 16:42 ` Jeff King
@ 2011-11-07 17:02 ` Junio C Hamano
2011-11-07 17:18 ` Jeff King
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2011-11-07 17:02 UTC (permalink / raw)
To: Jeff King; +Cc: Frans Klaver, Alexey Shumkin, git
Jeff King <peff@peff.net> writes:
> I should probably polish and submit the patch here:
>
> http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475
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"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: BUG. Git config pager when --edit
2011-11-07 17:02 ` Junio C Hamano
@ 2011-11-07 17:18 ` Jeff King
2011-11-07 20:45 ` Frans Klaver
0 siblings, 1 reply; 9+ messages in thread
From: Jeff King @ 2011-11-07 17:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Frans Klaver, Alexey Shumkin, git
On Mon, Nov 07, 2011 at 09:02:23AM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > I should probably polish and submit the patch here:
> >
> > http://thread.gmane.org/gmane.comp.version-control.git/182238/focus=182475
>
> 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?
-Peff
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: BUG. Git config pager when --edit
2011-11-07 17:18 ` Jeff King
@ 2011-11-07 20:45 ` Frans Klaver
0 siblings, 0 replies; 9+ messages in thread
From: Frans Klaver @ 2011-11-07 20:45 UTC (permalink / raw)
To: Junio C Hamano, Jeff King; +Cc: Alexey Shumkin, git
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 [flat|nested] 9+ messages in thread
* Re: how to merge sub directory or file?
2011-11-07 15:37 ` Konstantin Khomoutov
@ 2011-11-08 7:08 ` Emily Ren
0 siblings, 0 replies; 9+ messages in thread
From: Emily Ren @ 2011-11-08 7:08 UTC (permalink / raw)
To: Konstantin Khomoutov; +Cc: git
Hi Kon,
Thank you ! I tried that method, it failed on read-tree because
B/dir3 already exists, Cannot bind.
$ git read-tree --prefix=dir3 -u A:dir3
error: Entry 'dir3/file1' overlaps with 'dir3/file1'. Cannot bind.
And my case is that not all A's sub direcotries are in B.
For example, in A's dir3, there are file1, dir4 and dir5. But in B's
dir3, only file1 and dir4 exist, there's no dir5. How to handle this
case ?
Thanks,
Emily
On Mon, Nov 7, 2011 at 11:37 PM, Konstantin Khomoutov
<flatworm@users.sourceforge.net> wrote:
>
> On Mon, 7 Nov 2011 22:54:18 +0800
> Emily <lingyan.ren@gmail.com> wrote:
>
> > I have two git projects A and B, content of B is subset of A. For
> > example, Project A and B's tree are as below:
> [...]
> > When there's new changes in project A, how can I merge them to
> > project B without changing B's directory structure?
> >
> > Your help will be highly appreciated.
> Subtree merging maybe?
> See http://progit.org/book/ch6-7.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-11-08 7:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 13:26 BUG. Git config pager when --edit Alexey Shumkin
2011-11-07 13:43 ` Frans Klaver
2011-11-07 16:42 ` Jeff King
2011-11-07 17:02 ` Junio C Hamano
2011-11-07 17:18 ` Jeff King
2011-11-07 20:45 ` Frans Klaver
2011-11-07 14:54 ` how to merge sub directory or file? Emily
2011-11-07 15:37 ` Konstantin Khomoutov
2011-11-08 7:08 ` Emily Ren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).