Push to matching (not tracked) branch by default

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Push to matching (not tracked) branch by default

KeithMoyer
In my situation, I have an "origin/master" branch and a "working" (names changed to protect the innocent, but is analogous) branch.

I'd like the "Pull" button to do a fetch+merge of origin/master into working, but I'd like the "Push" button to push working to "working" (same name as local branch) at origin.

With origin/master as the tracked branch for working, the "Pull" behavior works as expected.  However, the "Push" tries to push to origin/master.

With no tracking branch for working, the "Push" behavior works as expected. However, the "Pull" can't do the merge without having the tracking branch set up.

I haven't found a way to set it up for both to work.  From the git command line it works great once I set "git config push.default current", but SmartGit seems to ignore that setting.

Note: we're evaluating SmartGit for commercial use, so lots of users with varying SCM familiarity/skill will be involved.  Using "Push to" is far from ideal.  We'd like a way to configure things (either via SmartGit or via git) to get the behavior by default with push and pull.

Thanks!

 - Keith
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
> I haven't found a way to set it up for both to work.  From the git command
> line it works great once I set "git config push.default current", but
> SmartGit seems to ignore that setting.

It does ignore that currently. I wouldn't like to change the UI here, because this feature doesn't seem to be widely used, but SmartGit could simply check for the presence of "push.default" and in this case act according to the specified option. Would that work for you?

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com



12/10/2014 18:50 - KeithMoyer [hidden email] [smartgit] wrote:

> In my situation, I have an "origin/master" branch and a "working" (names
> changed to protect the innocent, but is analogous) branch.
>
>
> I'd like the "Pull" button to do a fetch+merge of origin/master into
> working, but I'd like the "Push" button to push working to "working" (same
> name as local branch) at origin.
>
>
> With origin/master as the tracked branch for working, the "Pull" behavior
> works as expected.  However, the "Push" tries to push to origin/master.
>
>
> With no tracking branch for working, the "Push" behavior works as expected.
> However, the "Pull" can't do the merge without having the tracking branch
> set up.
>
>
> I haven't found a way to set it up for both to work.  From the git command
> line it works great once I set "git config push.default current", but
> SmartGit seems to ignore that setting.
>
>
> Note: we're evaluating SmartGit for commercial use, so lots of users with
> varying SCM familiarity/skill will be involved.  Using "Push to" is far from
> ideal.  We'd like a way to configure things (either via SmartGit or via git)
> to get the behavior by default with push and pull.
>
>
> Thanks!
>
>
>  - Keith
>
>
>
>
>
>
> --
> View this message in context:
> http://smartgit.3668570.n2.nabble.com/Push-to-matching-not-tracked-branch-by-default-tp7575469.html
> Sent from the SmartGit mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

KeithMoyer
> It does ignore that currently. I wouldn't like to change the UI here, because this feature doesn't seem to
> be widely used, but SmartGit could simply check for the presence of "push.default" and in this case act
> according to the specified option. Would that work for you?

So, SmartGit would still explicitly specify the remote branch name, thus not relying on Git's configured default behavior?  Instead, it would read in the "push.default" configuration itself and emulate the same decision when explicitly specifying the remote branch?

That sounds reasonable to me and would help out our use-case a lot!

I haven't followed SmartGit development for long.  If you were to make this change, when would you _expect_ (will not treat it as a commitment) it to make it into an available version?  Days, weeks, months, years?

Thanks!

 - Keith
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
> > It does ignore that currently. I wouldn't like to change the UI here,
> because this feature doesn't seem to
> > be widely used, but SmartGit could simply check for the presence of
> > "push.default" and in this case act
> > according to the specified option. Would that work for you?
>
> So, SmartGit would still explicitly specify the remote branch name, thus not
> relying on Git's configured default behavior?

Probably yes, because we are always specifying refs. As you may know, "git push" behaves differently in Git 1.x and Git 2.x and we want to force the same behavior in SmartGit, as the GUI only knows two options: current branch vs. all matching branches

> Instead, it would read in the
> "push.default" configuration itself and emulate the same decision when
> explicitly specifying the remote branch?

This is what I have in mind, at least as a rather quick fix (SG-9084). A more elaborate fix could be to evaluate "push.default" and to show this option in the GUI, as well.

> I haven't followed SmartGit development for long.  If you were to make this
> change, when would you _expect_ (will not treat it as a commitment) it to
> make it into an available version?  Days, weeks, months, years?

I've scheduled the quick fix for 6.5.x, so you may expect it to be present in one of the next bug-fix versions.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com



12/12/2014 17:30 - KeithMoyer [hidden email] [smartgit] wrote:

> > It does ignore that currently. I wouldn't like to change the UI here,
> because this feature doesn't seem to
> > be widely used, but SmartGit could simply check for the presence of
> > "push.default" and in this case act
> > according to the specified option. Would that work for you?
>
> So, SmartGit would still explicitly specify the remote branch name, thus not
> relying on Git's configured default behavior?  Instead, it would read in the
> "push.default" configuration itself and emulate the same decision when
> explicitly specifying the remote branch?
>
> That sounds reasonable to me and would help out our use-case a lot!
>
> I haven't followed SmartGit development for long.  If you were to make this
> change, when would you _expect_ (will not treat it as a commitment) it to
> make it into an available version?  Days, weeks, months, years?
>
> Thanks!
>
>  - Keith
>
>
>
> --
> View this message in context:
> http://smartgit.3668570.n2.nabble.com/Push-to-matching-not-tracked-branch-by-default-tp7575469p7575475.html
> Sent from the SmartGit mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

MKindel
Marc Strapetz syntevo GmbH wrote
> > It does ignore that currently. I wouldn't like to change the UI here,
> because this feature doesn't seem to
> > be widely used, but SmartGit could simply check for the presence of
> > "push.default" and in this case act
> > according to the specified option. Would that work for you?
>
> So, SmartGit would still explicitly specify the remote branch name, thus not
> relying on Git's configured default behavior?

Probably yes, because we are always specifying refs. As you may know, "git push" behaves differently in Git 1.x and Git 2.x and we want to force the same behavior in SmartGit, as the GUI only knows two options: current branch vs. all matching branches

> Instead, it would read in the
> "push.default" configuration itself and emulate the same decision when
> explicitly specifying the remote branch?

This is what I have in mind, at least as a rather quick fix (SG-9084). A more elaborate fix could be to evaluate "push.default" and to show this option in the GUI, as well.
I'd also like to have this available in the GUI :)

Apart from an informative text in the 'Push' dialog (telling the push target when its different configured), my favourite would be to extend the 'Push To' dialog to offer this as additional option, when configured. So the user can easily choose between the standard target, the configured push.default target and the free text.

Marc Strapetz syntevo GmbH wrote
> I haven't followed SmartGit development for long.  If you were to make this
> change, when would you _expect_ (will not treat it as a commitment) it to
> make it into an available version?  Days, weeks, months, years?

I've scheduled the quick fix for 6.5.x, so you may expect it to be present in one of the next bug-fix versions.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
> Apart from an informative text in the 'Push' dialog (telling the push target
> when its different configured), my favourite would be to extend the 'Push
> To' dialog to offer this as additional option, when configured. So the user
> can easily choose between the standard target, the configured push.default
> target and the free text.

Push should work correctly (according to your Git configuration), but still be as simple as possible. Hence, I would not like to add additional options to the Push dialog. You can always use Push To for more advanced usages.

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


01/02/2015 15:50 - MKindel [hidden email] [smartgit] wrote:

> Marc Strapetz syntevo GmbH wrote
> >> > It does ignore that currently. I wouldn't like to change the UI here,
> >> because this feature doesn't seem to
> >> > be widely used, but SmartGit could simply check for the presence of
> >> > "push.default" and in this case act
> >> > according to the specified option. Would that work for you?
> >>
> >> So, SmartGit would still explicitly specify the remote branch name, thus
> >> not
> >> relying on Git's configured default behavior?
> >
> > Probably yes, because we are always specifying refs. As you may know, "git
> > push" behaves differently in Git 1.x and Git 2.x and we want to force the
> > same behavior in SmartGit, as the GUI only knows two options: current
> > branch vs. all matching branches
> >
> >> Instead, it would read in the
> >> "push.default" configuration itself and emulate the same decision when
> >> explicitly specifying the remote branch?
> >
> > This is what I have in mind, at least as a rather quick fix (SG-9084). A
> > more elaborate fix could be to evaluate "push.default" and to show this
> > option in the GUI, as well.
>
> I'd also like to have this available in the GUI :)
>
> Apart from an informative text in the 'Push' dialog (telling the push target
> when its different configured), my favourite would be to extend the 'Push
> To' dialog to offer this as additional option, when configured. So the user
> can easily choose between the standard target, the configured push.default
> target and the free text.
>
>
> Marc Strapetz syntevo GmbH wrote
> >> I haven't followed SmartGit development for long.  If you were to make
> >> this
> >> change, when would you _expect_ (will not treat it as a commitment) it to
> >> make it into an available version?  Days, weeks, months, years?
> >
> > I've scheduled the quick fix for 6.5.x, so you may expect it to be present
> > in one of the next bug-fix versions.
> >
> > --
> > Best regards,
> > Marc Strapetz
> > syntevo GmbH
> > http://www.syntevo.com
> > http://blog.syntevo.com
>
>
>
>
>
> --
> View this message in context:
> http://smartgit.3668570.n2.nabble.com/Push-to-matching-not-tracked-branch-by-default-tp7575469p7575494.html
> Sent from the SmartGit mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
In reply to this post by SmartGit mailing list
Marc,
I just came by the group to ask if there was a way to set a 'default' remote for fetching when the local branch isn't tracking a remote branch rather than always selecting the alphabetically 1st remote that exists. I'm perfectly happy w/ the current behavior of selecting the tracked remote if there is one.

Is it possible that "push.default" already does provide that and all I have to do is set it? (if so where is that setting?)

Thanks,
Mike
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

MKindel
In reply to this post by SmartGit mailing list
SmartGit mailing list wrote
> Apart from an informative text in the 'Push' dialog (telling the push target
> when its different configured), my favourite would be to extend the 'Push
> To' dialog to offer this as additional option, when configured. So the user
> can easily choose between the standard target, the configured push.default
> target and the free text.

Push should work correctly (according to your Git configuration), but still be as simple as possible. Hence, I would not like to add additional options to the Push dialog. You can always use Push To for more advanced usages.
I think you got me wrong. I didn't suggest to extend 'Push' with more options, just with more information.

I suggested to extend 'Push To' with more preconfigurable choices for easier use.
e.g. for use with Gerrit you always have to specfiy 'refs/for/<branchname>' to push commits for review. This is hard to remember for not so experienced users. It would be really cool to pre-configure that and make this a (checkbox) selectable choice.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
In reply to this post by SmartGit mailing list
> Is it possible that "push.default" already does provide that and all I have to do
> is set it? (if so where is that setting?)

"push.default" isn't supported yet by SmartGit and would not affect pull behavior. However, if there is no reasonable remote to select, SmartGit will prefer "origin". Hence, try to make sure your default remote is called "origin".

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


01/06/2015 21:40 - [hidden email] [smartgit] wrote:

> Marc,
> I just came by the group to ask if there was a way to set a 'default' remote for
> fetching when the local branch isn't tracking a remote branch rather than always
> selecting the alphabetically 1st remote that exists. I'm perfectly happy w/ the
> current behavior of selecting the tracked remote if there is one.
>
> Is it possible that "push.default" already does provide that and all I have to do
> is set it? (if so where is that setting?)
>
> Thanks,
> Mike
>  
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
In reply to this post by MKindel
> I think you got me wrong. I didn't suggest to extend 'Push' with more
> options, just with more information.

OK, got it.

> I suggested to extend 'Push To' with more preconfigurable choices for easier
> use.
> e.g. for use with Gerrit you always have to specfiy 'refs/for/<branchname>'
> to push commits for review. This is hard to remember for not so experienced
> users. It would be really cool to pre-configure that and make this a
> (checkbox) selectable choice.

Added as RFE (SG-9131).

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


01/07/2015 08:40 - MKindel [hidden email] [smartgit] wrote:

> SmartGit mailing list wrote
> >> Apart from an informative text in the 'Push' dialog (telling the push
> >> target
> >> when its different configured), my favourite would be to extend the 'Push
> >> To' dialog to offer this as additional option, when configured. So the
> >> user
> >> can easily choose between the standard target, the configured
> >> push.default
> >> target and the free text.
> >
> > Push should work correctly (according to your Git configuration), but
> > still be as simple as possible. Hence, I would not like to add additional
> > options to the Push dialog. You can always use Push To for more advanced
> > usages.
>
> I think you got me wrong. I didn't suggest to extend 'Push' with more
> options, just with more information.
>
> I suggested to extend 'Push To' with more preconfigurable choices for easier
> use.
> e.g. for use with Gerrit you always have to specfiy 'refs/for/<branchname>'
> to push commits for review. This is hard to remember for not so experienced
> users. It would be really cool to pre-configure that and make this a
> (checkbox) selectable choice.
>
>
>
> --
> View this message in context:
> http://smartgit.3668570.n2.nabble.com/Push-to-matching-not-tracked-branch-by-default-tp7575469p7575502.html
> Sent from the SmartGit mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
In reply to this post by KeithMoyer
> So, SmartGit would still explicitly specify the remote branch name, thus not
> relying on Git's configured default behavior?  Instead, it would read in the
> "push.default" configuration itself and emulate the same decision when
> explicitly specifying the remote branch?
>
> That sounds reasonable to me and would help out our use-case a lot!

I've now uploaded a new build for which "push.default=current" is honored: if configured, Push and Sync will push to the matching remote branch. The push dialog will show the target branch if "push.default=current" is configured or the upstream is not identical with the local branch. Anyone interested in this feature, please give it a try: Help > Check for Latest Build

Btw, I feel with "push.default=current" the GUI is now not consistent because Outgoing Commits only honors the upstream. However, fixing this would be a too large change for version 6.5 .

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


12/12/2014 17:30 - KeithMoyer [hidden email] [smartgit] wrote:

> > It does ignore that currently. I wouldn't like to change the UI here,
> because this feature doesn't seem to
> > be widely used, but SmartGit could simply check for the presence of
> > "push.default" and in this case act
> > according to the specified option. Would that work for you?
>
> So, SmartGit would still explicitly specify the remote branch name, thus not
> relying on Git's configured default behavior?  Instead, it would read in the
> "push.default" configuration itself and emulate the same decision when
> explicitly specifying the remote branch?
>
> That sounds reasonable to me and would help out our use-case a lot!
>
> I haven't followed SmartGit development for long.  If you were to make this
> change, when would you _expect_ (will not treat it as a commitment) it to
> make it into an available version?  Days, weeks, months, years?
>
> Thanks!
>
>  - Keith
>
>
>
> --
> View this message in context:
> http://smartgit.3668570.n2.nabble.com/Push-to-matching-not-tracked-branch-by-default-tp7575469p7575475.html
> Sent from the SmartGit mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
In reply to this post by SmartGit mailing list
Marc,
You said:
> However, if there is no reasonable remote to select, SmartGit will prefer "origin".
 
But that isn't the behavior I'm getting. For one of my repos I have 2 remotes github and origin. If I pull when my current checked out branch is not tracking a remote branch the alphabetically 1st remote, which is 1st in the Fetch from: dropdown, namely github, is selected, not origin.

Mike

---In [hidden email], <smartgit@...> wrote :

 > Is it possible that "push.default" already does provide that and all I have to do
 > is set it? (if so where is that setting?)
 
 "push.default" isn't supported yet by SmartGit and would not affect pull behavior. However, if there is no reasonable remote to select, SmartGit will prefer "origin". Hence, try to make sure your default remote is called "origin".
 
 --
 Best regards,
 Marc Strapetz
 syntevo GmbH
 http://www.syntevo.com http://www.syntevo.com
 http://blog.syntevo.com http://blog.syntevo.com
 
 
 01/06/2015 21:40 - mlippert255@... mailto:mlippert255@... [smartgit] wrote:
 
 > Marc,
 > I just came by the group to ask if there was a way to set a 'default' remote for
 > fetching when the local branch isn't tracking a remote branch rather than always
 > selecting the alphabetically 1st remote that exists. I'm perfectly happy w/ the
 > current behavior of selecting the tracked remote if there is one.
 >
 > Is it possible that "push.default" already does provide that and all I have to do
 > is set it? (if so where is that setting?)
 >
 > Thanks,
 > Mike
 >
 >
 >

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
> > However, if there is no reasonable remote to select, SmartGit will prefer "origin".
>  
> But that isn't the behavior I'm getting. For one of my repos I have 2 remotes
> github and origin. If I pull when my current checked out branch is not tracking a
> remote branch the alphabetically 1st remote, which is 1st in the Fetch from:
> dropdown, namely github, is selected, not origin.

Thanks for pointing out. Actually, I was sure that "origin" would have precedence. I've fixed that for the latest build: Help > Check for Latest Build

--
Best regards,
Marc Strapetz
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


01/16/2015 20:40 - [hidden email] [smartgit] wrote:

> Marc,
> You said:
> > However, if there is no reasonable remote to select, SmartGit will prefer "origin".
>  
> But that isn't the behavior I'm getting. For one of my repos I have 2 remotes
> github and origin. If I pull when my current checked out branch is not tracking a
> remote branch the alphabetically 1st remote, which is 1st in the Fetch from:
> dropdown, namely github, is selected, not origin.
>
> Mike
>
> ---In [hidden email], <smartgit@...> wrote :
>
>  > Is it possible that "push.default" already does provide that and all I have to
> do
>  > is set it? (if so where is that setting?)
>  
>  "push.default" isn't supported yet by SmartGit and would not affect pull
> behavior. However, if there is no reasonable remote to select, SmartGit will
> prefer "origin". Hence, try to make sure your default remote is called "origin".
>  
>  --
>  Best regards,
>  Marc Strapetz
>  syntevo GmbH
>  http://www.syntevo.com http://www.syntevo.com
>  http://blog.syntevo.com http://blog.syntevo.com
>  
>  
>  01/06/2015 21:40 - mlippert255@... mailto:mlippert255@... [smartgit] wrote:
>  
>  > Marc,
>  > I just came by the group to ask if there was a way to set a 'default' remote
> for
>  > fetching when the local branch isn't tracking a remote branch rather than
> always
>  > selecting the alphabetically 1st remote that exists. I'm perfectly happy w/ the
>  > current behavior of selecting the tracked remote if there is one.
>  >
>  > Is it possible that "push.default" already does provide that and all I have to
> do
>  > is set it? (if so where is that setting?)
>  >
>  > Thanks,
>  > Mike
>  >
>  >
>  >
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Push to matching (not tracked) branch by default

SmartGit mailing list
Got the latest build and that's working as described now. Thanks.

If you haven't I'd suggest updating the doc to mention that a remote named 'origin' will be selected when there current local branch has no tracked remote branch, and if there is no remote named origin the alphabetically 1st remote will be selected for a pull/fetch request.

Mike
Loading...