nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: steveukx/git-js
Pull request #583 (2021-02-20 07:23:23)

Fix: Fetch Progress
fix: Progress plugin should request progress events for fetch as well as other common long running tasks.


Patch:
diff --git a/readme.md b/readme.md
index 336f27e..a3009ef 100644
--- a/readme.md
+++ b/readme.md
@@ -97,9 +97,9 @@ await git.pull();
 await git.raw('pull', '--progress');
 ```
 
-The `checkout`, `clone`, `pull`, `push` methods will automatically enable progress events when
-a progress handler has been set. For any other method that _can_ support progress events, set
-`--progress` in the task's `TaskOptions` for example to receive progress events when running
+The `checkout`, `clone`, 'fetch, `pull`, `push` methods will automatically enable progress events
+when a progress handler has been set. For any other method that _can_ support progress events,
+set `--progress` in the task's `TaskOptions` for example to receive progress events when running
 submodule tasks:
 
 ```typescript
diff --git a/src/lib/plugins/progress-monitor-plugin.ts b/src/lib/plugins/progress-monitor-plugin.ts
index e60cf38..08a4a28 100644
--- a/src/lib/plugins/progress-monitor-plugin.ts
+++ b/src/lib/plugins/progress-monitor-plugin.ts
@@ -5,7 +5,7 @@ import { SimpleGitPlugin } from './simple-git-plugin';
 
 export function progressMonitorPlugin(progress: Exclude<SimpleGitOptions['progress'], void>) {
    const progressCommand = '--progress';
-   const progressMethods = ['checkout', 'clone', 'pull', 'push'];
+   const progressMethods = ['checkout', 'clone', 'fetch', 'pull', 'push'];
 
    const onProgress: SimpleGitPlugin<'spawn.after'> = {
       type: 'spawn.after',


Test patch:
diff --git a/test/unit/plugins.spec.ts b/test/unit/plugins.spec.ts
index f9f2604..6401879 100644
--- a/test/unit/plugins.spec.ts
+++ b/test/unit/plugins.spec.ts
@@ -95,14 +95,16 @@ describe('plugins', () => {
 
       it.each<[string, (git: SimpleGit) => unknown]>([
          ['checkout', (git) => git.checkout('main')],
+         ['clone', (git) => git.clone('some-remote.git')],
+         ['fetch', (git) => git.fetch('some-remote')],
          ['pull', (git) => git.pull()],
          ['push', (git) => git.push()],
-         ['clone', (git) => git.clone('some-remote.git')],
          ['checkout - progress set', (git) => git.checkout('main', ['--progress', 'blah'])],
+         ['clone - progress set', (git) => git.clone('some-remote.git', ['--progress', 'blah'])],
+         ['fetch - progress set', (git) => git.fetch('some-remote', {'--progress': null, '--foo': 'bar'})],
          ['pull - progress set', (git) => git.pull(['--progress', 'blah'])],
          ['push - progress set', (git) => git.push(['--progress', 'blah'])],
-         ['clone - progress set', (git) => git.clone('some-remote.git', ['--progress', 'blah'])],
-         ['raw - progress set', (git) => git.raw('foo','--progress', 'blah')],
+         ['raw - progress set', (git) => git.raw('foo', '--progress', 'blah')],
       ])(`auto-adds to %s`, async (_name, use) => {
          use(newSimpleGit({progress: fn}));
Repository: steveukx/git-js
Pull request #677 (2021-09-04 12:30:34)

fix: support progress events in locales other than Western European character sets.
fix: support progress events in locales other than Western European character sets.

As identified in #579 - characters not recognised by the RegExp `/([a-zA-Z]+):/` cause the progress event handler to not recognise the message, change to the more flexible `/([\s\S]+):/`


Patch:
diff --git a/src/lib/plugins/progress-monitor-plugin.ts b/src/lib/plugins/progress-monitor-plugin.ts
index 08a4a28..bf79032 100644
--- a/src/lib/plugins/progress-monitor-plugin.ts
+++ b/src/lib/plugins/progress-monitor-plugin.ts
@@ -15,7 +15,7 @@ export function progressMonitorPlugin(progress: Exclude<SimpleGitOptions['progre
          }
 
          context.spawned.stderr?.on('data', (chunk: Buffer) => {
-            const message = /^([a-zA-Z ]+):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString('utf8'));
+            const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString('utf8'));
             if (!message) {
                return;
             }


Test patch:
diff --git a/test/unit/plugins.spec.ts b/test/unit/plugins.spec.ts
index 4ebb18e..d600a8c 100644
--- a/test/unit/plugins.spec.ts
+++ b/test/unit/plugins.spec.ts
@@ -46,6 +46,20 @@ describe('plugins', () => {
 
    describe('progress', () => {
 
+      it('caters for non ISO-8859-1 characters', async () => {
+         newSimpleGit({progress: fn}).raw('anything', '--progress');
+
+         await writeToStdErr(`Определение изменений: 90% (9/10)`);
+
+         expect(fn).toHaveBeenCalledWith({
+            method: 'anything',
+            progress: 90,
+            processed: 9,
+            stage: 'определение',
+            total: 10,
+         });
+      })
+
       it('emits progress events when counting objects', async () => {
          newSimpleGit({progress: fn}).raw('something', '--progress');
Repository: callstack/react-native-paper
Pull request #884 (2019-03-02 16:41:06)

Give user the option to change input style in searchbar
https://www.slashgear.com/gmail-app-android-ios-material-design-update-released-21566652/
```
<Searchbar
  placeholder={'Zoeken'}
  onChangeText={this.props.onSearch}
  style={{
    shadowOpacity: 0.07,
    elevation: 2,
  }}
  inputStyle={{
    fontSize: 16,
  }}
  value={value}
  icon={icon}
  onIconPress={this._onMenu}
/>
```


Before:
![9219e44b-52f7-4f5a-b017-62d0b578d9c5](https://user-images.githubusercontent.com/6492229/53686058-f62f7b00-3d22-11e9-9ee3-6c21005e75e1.jpeg)

After:
![e77f1c71-b3af-451a-af15-b9a43992c1be](https://user-images.githubusercontent.com/6492229/53686050-dbf59d00-3d22-11e9-9b82-3718cde31b51.jpeg)


Related pull request:
https://github.com/callstack/react-native-paper/pull/861

callstack-bot: Hey @RichardLindhout, thank you for your pull request 🤗. The documentation from this branch can be viewed [here](https://8461-71323749-gh.circle-artifacts.com/0/docs/index.html). Please remember to update Typescript types if you changed API.

Patch:
diff --git a/src/components/Searchbar.js b/src/components/Searchbar.js
index b3c64a9cb..f97c97978 100644
--- a/src/components/Searchbar.js
+++ b/src/components/Searchbar.js
@@ -30,7 +30,12 @@ type Props = React.ElementConfig<typeof TextInput> & {|
    * Callback to execute if we want the left icon to act as button.
    */
   onIconPress?: () => mixed,
+  /**
+   * Set style of the TextInput component inside the searchbar
+   */
+  inputStyle?: any,
   style?: any,
+
   /**
    * @optional
    */
@@ -118,6 +123,7 @@ class Searchbar extends React.Component<Props> {
       value,
       theme,
       style,
+      inputStyle,
       ...rest
     } = this.props;
     const { colors, roundness, dark, fonts } = theme;
@@ -150,7 +156,7 @@ class Searchbar extends React.Component<Props> {
           icon={icon || 'search'}
         />
         <TextInput
-          style={[styles.input, { color: textColor, fontFamily }]}
+          style={[styles.input, { color: textColor, fontFamily }, inputStyle]}
           placeholder={placeholder || ''}
           placeholderTextColor={colors.placeholder}
           selectionColor={colors.primary}


Test patch:
diff --git a/src/components/__tests__/__snapshots__/Searchbar.test.js.snap b/src/components/__tests__/__snapshots__/Searchbar.test.js.snap
index fd016c3a2..6fd256197 100644
--- a/src/components/__tests__/__snapshots__/Searchbar.test.js.snap
+++ b/src/components/__tests__/__snapshots__/Searchbar.test.js.snap
@@ -120,6 +120,7 @@ exports[`renders with placeholder 1`] = `
           "color": "#000000",
           "fontFamily": "Helvetica Neue",
         },
+        undefined,
       ]
     }
     underlineColorAndroid="transparent"
@@ -332,6 +333,7 @@ exports[`renders with text 1`] = `
           "color": "#000000",
           "fontFamily": "Helvetica Neue",
         },
+        undefined,
       ]
     }
     underlineColorAndroid="transparent"
Repository: callstack/react-native-paper
Pull request #942 (2019-03-21 13:14:13)

feat: add scale to control modal animation speed

ferrannp: @Trancever would this control only Modal/Dialog? More in the future? I want this PR ASAP :D but how the user knows that the theme prop `scale` is for the dialog animation speed?
Trancever: @ferrannp For now it's just for modal but we want to add support for other components too. Feel free to send PRs :D

Patch:
diff --git a/src/components/Modal.js b/src/components/Modal.js
index 7d983014f..ce65ecc79 100644
--- a/src/components/Modal.js
+++ b/src/components/Modal.js
@@ -122,21 +122,33 @@ class Modal extends React.Component<Props, State> {
   };
 
   _showModal = () => {
+    const {
+      theme: {
+        animation: { scale },
+      },
+    } = this.props;
+
     BackHandler.removeEventListener('hardwareBackPress', this._handleBack);
     BackHandler.addEventListener('hardwareBackPress', this._handleBack);
     Animated.timing(this.state.opacity, {
       toValue: 1,
-      duration: 280,
+      duration: scale * 280,
       easing: Easing.ease,
       useNativeDriver: true,
     }).start();
   };
 
   _hideModal = () => {
+    const {
+      theme: {
+        animation: { scale },
+      },
+    } = this.props;
+
     BackHandler.removeEventListener('hardwareBackPress', this._handleBack);
     Animated.timing(this.state.opacity, {
       toValue: 0,
-      duration: 280,
+      duration: scale * 280,
       easing: Easing.ease,
       useNativeDriver: true,
     }).start(({ finished }) => {
diff --git a/src/styles/DefaultTheme.js b/src/styles/DefaultTheme.js
index e1be8f3a5..996b6f150 100644
--- a/src/styles/DefaultTheme.js
+++ b/src/styles/DefaultTheme.js
@@ -29,4 +29,7 @@ export default {
     notification: pinkA400,
   },
   fonts,
+  animation: {
+    scale: 1.0,
+  },
 };
diff --git a/src/types.js b/src/types.js
index e35b15703..508069368 100644
--- a/src/types.js
+++ b/src/types.js
@@ -23,6 +23,9 @@ export type Theme = {
     light: string,
     thin: string,
   },
+  animation: {
+    scale: number,
+  },
 };
 
 export type ThemeShape = $Shape<{


Test patch:
diff --git a/src/components/__tests__/__snapshots__/ListSection.test.js.snap b/src/components/__tests__/__snapshots__/ListSection.test.js.snap
index 829822663..56774d0c6 100644
--- a/src/components/__tests__/__snapshots__/ListSection.test.js.snap
+++ b/src/components/__tests__/__snapshots__/ListSection.test.js.snap
@@ -12,6 +12,9 @@ exports[`renders list section with subheader 1`] = `
   }
   theme={
     Object {
+      "animation": Object {
+        "scale": 1,
+      },
       "colors": Object {
         "accent": "#03dac4",
         "backdrop": "rgba(0, 0, 0, 0.5)",
@@ -314,6 +317,9 @@ exports[`renders list section without subheader 1`] = `
   }
   theme={
     Object {
+      "animation": Object {
+        "scale": 1,
+      },
       "colors": Object {
         "accent": "#03dac4",
         "backdrop": "rgba(0, 0, 0, 0.5)",